/* Extracted from templates/layout.html inline styles */

/* Mega menu container */
.mega-menu {
    position: absolute;
    width: 250px; /* Only show the first column by default */
    left: 0;
    top: 100%;
    display: none;
    z-index: 1000;
    padding: 0;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.mega-menu.expanded {
    width: 500px; /* Expand to show both columns when needed */
}

.mega-menu-inner {
    display: flex;
    flex-direction: row;
}

.mega-menu-column {
    width: 250px;
    padding: 0;
}

.mega-menu-column:first-child {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.mega-menu-column.second-column { display: none; }
.mega-menu.expanded .mega-menu-column.second-column { display: block; }

.mega-menu-item {
    padding: 10px 15px;
    color: #212529;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: normal;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}
.mega-menu-item:last-child { border-bottom: none; }
.mega-menu-item:hover,
.mega-menu-item.active { background-color: #e9ecef; text-decoration: none; color: #000; }
.mega-menu-item:active { background-color: #dee2e6; transform: translateY(1px); }

/* Click ripple effect */
.mega-menu-item .ripple {
    position: absolute;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 0;
    z-index: 9999;
    display: none;
}
.cookie-consent-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.cookie-consent-text { flex: 1; margin-right: 20px; min-width: 280px; }
.cookie-consent-buttons { display: flex; gap: 10px; }
.cookie-btn { padding: 8px 16px; border-radius: 4px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; text-decoration: none; border: none; }
.cookie-btn-accept { background-color: #198754; color: white; }
.cookie-btn-accept:hover { background-color: #146c43; }
.cookie-btn-more { background-color: transparent; color: white; border: 1px solid white; }
.cookie-btn-more:hover { background-color: rgba(255, 255, 255, 0.1); }

.footer-link {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
  .cookie-consent-content { flex-direction: column; align-items: flex-start; }
  .cookie-consent-text { margin-right: 0; margin-bottom: 15px; }
}

/* Visited link styling */
.mega-menu-item.visited { font-weight: 500; }
.mega-menu-item.visited::after { content: '✓'; position: absolute; right: 15px; font-size: 12px; opacity: 0.7; }

.submenu-column { display: none; }
.submenu-column.active { display: block; }

/* Stile per i sottomenu a discesa */
.dropdown-submenu { position: relative; }
.dropdown-submenu .dropdown-menu { top: 0; left: 100%; margin-top: -1px; margin-left: 0.125rem; display: none; }
.dropdown-submenu:hover > .dropdown-menu { display: block; }
.dropdown-submenu > a:after {
  display: block; content: " "; float: right; width: 0; height: 0; border-color: transparent; border-style: solid; border-width: 5px 0 5px 5px; border-left-color: #6c757d; margin-top: 5px; margin-right: -10px;
}
.dropdown-submenu:hover > a:after { border-left-color: #fff; }

.dropdown-toggle::after {
  display: inline-block; margin-left: 0.255em; vertical-align: 0.255em; content: "";
  border-top: 0.3em solid; border-right: 0.3em solid transparent; border-bottom: 0; border-left: 0.3em solid transparent;
}

/* Position fix for the mega menu */
.nav-item.dropdown.has-mega-menu { position: relative; }

/* Modal: conferma */
#confirmModal { z-index: 1999 !important; }
#confirmModal .modal-dialog { max-width: 400px; }
#confirmModal .modal-content { border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
#confirmModal .modal-header { border-bottom: 1px solid #dee2e6; }
#confirmModal .modal-footer { border-top: 1px solid #dee2e6; }

/* Modal: logout */
#logoutModal { z-index: 1999 !important; }
#logoutModal .modal-dialog { max-width: 400px; }
#logoutModal .modal-content { border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
#logoutModal .modal-header { border-bottom: 1px solid #dee2e6; }
#logoutModal .modal-footer { border-top: 1px solid #dee2e6; }
