/* DiF v5 - Navigation Styles */

/* Enhanced Navigation */
.navbar {
    background: linear-gradient(135deg, #3b4a5a 0%, #5a6b7a 100%) !important; /* blue-gray gradient */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
    border-bottom: 1px solid #4a5a6a;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #f6f8fa !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(246, 248, 250, 0.92) !important;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
    background-color: rgba(246, 248, 250, 0.10);
}

.navbar-nav .nav-link.active {
    background-color: rgba(246, 248, 250, 0.18);
    color: #fff !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #e9eef3;
    color: #23272f;
}

/* Mobile header with speaker background */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 2000;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
}

/* Transparent overlay for better text visibility */
.mobile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}

/* Mobile menu is now handled by the floating hamburger menu from base.html */

/* Mobile menu content styles are now handled by slide-menu styles */

/* Hamburger Menu and Navigation Styles - More Subtle */
.hamburger-menu {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2001; /* Increased to overlay mobile banner (z-index: 2000) */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1.5px solid #d4af37; /* Thin gold border */
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #f0d575; /* Lighter gold on hover */
}

.hamburger-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 100%; /* Fill entire circle */
    height: 100%; /* Fill entire circle */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px; /* Space between lines */
    border-radius: 50%; /* Match parent shape */
    transition: transform 0.3s ease;
}

.hamburger-button:hover {
    transform: scale(1.05);
}

.hamburger-line {
    width: 20px; /* Fixed width for the lines */
    height: 1.5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger lines stay as three horizontal lines - no X transformation */

.slide-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: #f5f5f0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.slide-menu.active {
    transform: translateX(0);
}

.slide-menu-header {
    padding: 1.5rem 1.25rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #8b9d83 0%, #a67c52 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.slide-menu-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.slide-menu-brand:hover {
    opacity: 0.8;
    color: #ffffff;
    text-decoration: none;
}

.slide-menu-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.slide-menu-close:hover,
.slide-menu-close:focus {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    outline: none;
}

.slide-menu-close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.slide-menu-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    background-color: #f5f5f0;
}

.slide-menu-section {
    border-bottom: 1px solid #e8e8e0;
}

.slide-menu-section-header {
    padding: 1rem 1.25rem 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.slide-menu-section-header:hover {
    background-color: #e8e8e0;
    color: #495057;
}

.slide-menu-section-header.accordion-toggle {
    position: relative;
}

.slide-menu-section-header.accordion-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1.25rem;
    transition: transform 0.3s ease;
}

.slide-menu-section-header.accordion-toggle.expanded::after {
    transform: rotate(180deg);
}

.slide-menu-submenu {
    padding: 0 0 0.5rem 0;
}

/* Only apply accordion behavior to submenus that should be collapsible */
.slide-menu-submenu.accordion-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.slide-menu-submenu.accordion-submenu.expanded {
    max-height: 800px; /* Increased to accommodate all speakers */
}

.slide-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
}

.slide-menu-item:hover {
    background-color: #e8e8e0;
    color: #212529;
    text-decoration: none;
}

.slide-menu-item:active {
    background-color: #d8d8d0;
}

.slide-submenu-item {
    padding-left: 2.5rem;
    font-size: 0.95rem;
}

.slide-menu-warning {
    color: #fd7e14;
}

.slide-menu-warning:hover {
    background-color: #fff3cd;
    color: #856404;
}

.slide-menu-danger {
    color: #dc3545;
}

.slide-menu-danger:hover {
    background-color: #f8d7da;
    color: #721c24;
}

.slide-menu-dev {
    color: #6f42c1;
}

.slide-menu-dev:hover {
    background-color: #f3e8ff;
    color: #581c87;
}

.slide-menu-divider {
    height: 1px;
    background: #d8d8d0;
    margin: 0.5rem 1.25rem;
}

/* Slide Menu Footer */
.slide-menu-footer {
    margin-top: auto;
    padding: 1.5rem 1.25rem;
    border-top: 1px solid #e8e8e0;
    background-color: #f0f0eb;
}

.slide-menu-footer-content {
    text-align: center;
}

.slide-menu-footer-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.slide-menu-footer-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.slide-menu-footer-links {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.slide-menu-footer-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.slide-menu-footer-links a:hover {
    color: #374151;
    text-decoration: underline;
}

.slide-menu-footer-copyright {
    font-size: 0.75rem;
    color: #9ca3af;
}

.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 480px) {
    .slide-menu {
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
    }
    .slide-menu-content {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 1rem; /* Add some bottom padding to ensure content is visible */
    }
    .slide-menu-footer {
        flex-shrink: 0; /* Ensure footer doesn't shrink */
        margin-top: auto; /* Push footer to bottom */
    }
    .hamburger-menu {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        border: 1.5px solid #d4af37; /* Maintain gold border on mobile */
    }
    .hamburger-menu:hover {
        border-color: #f0d575; /* Lighter gold on hover */
    }
    .hamburger-button {
        width: 100%; /* Fill entire circle on mobile */
        height: 100%; /* Fill entire circle on mobile */
    }
    .hamburger-line {
        width: 18px; /* Slightly smaller lines on mobile */
    }
    .slide-menu-close {
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
        padding: 0.5rem;
    }
}

/* Additional mobile optimizations for slide menu */
@media (max-width: 768px) {
    .slide-menu {
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
        top: 0 !important; /* Ensure it starts from the very top */
        z-index: 1999; /* Above mobile header, but below modals */
    }
    .slide-menu-content {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 1rem;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    .slide-menu-footer {
        flex-shrink: 0;
        margin-top: auto;
        position: sticky;
        bottom: 0;
        background-color: #f0f0eb;
    }
    /* Ensure all sections are visible */
    .slide-menu-section {
        display: block !important;
    }
    #devSection {
        display: block !important; /* Force show development section on mobile */
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 1 !important;
        border: 2px solid #6f42c1 !important; /* Purple border to make it more visible for debugging */
        background-color: rgba(111, 66, 193, 0.05) !important; /* Light purple background */
    }
}

@media (prefers-color-scheme: dark) {
    .hamburger-menu {
        background: rgba(30, 30, 30, 0.15);
        border: 1.5px solid #d4af37; /* Keep gold border in dark mode */
    }
    .hamburger-menu:hover {
        background: rgba(30, 30, 30, 0.25);
        border-color: #f0d575; /* Lighter gold on hover in dark mode */
    }
    .hamburger-line {
        background: rgba(255, 255, 255, 0.9);
    }
    .slide-menu {
        background: #f5f5f0;
        color: #374151;
    }
    .slide-menu-header {
        background: linear-gradient(135deg, #8b9d83 0%, #a67c52 100%);
        border-color: rgba(255, 255, 255, 0.2);
    }
    .slide-menu-brand {
        color: #ffffff;
    }
    .slide-menu-close {
        color: rgba(255, 255, 255, 0.9);
        background: none;
        border: none;
    }
    .slide-menu-close:hover,
    .slide-menu-close:focus {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
        outline: none;
    }
    
    .slide-menu-close:focus-visible {
        outline: 2px solid #60a5fa;
        outline-offset: 2px;
    }
    .slide-menu-item {
        color: #374151;
    }
    .slide-menu-item:hover {
        background-color: #e8e8e0;
        color: #212529;
    }
    .slide-menu-section-header {
        color: #374151;
    }
    .slide-menu-section-header:hover {
        background-color: #e8e8e0;
        color: #495057;
    }
    .slide-menu-divider {
        background: #d8d8d0;
    }
}

/* CRITICAL FIX: Force all modals above slide-menu and hamburger-menu */
/* This must be at the END of this file to override all other z-index rules */
.modal.show,
.modal.fade.show,
.modal,
div.modal,
#bannerGalleryModal,
#profileImageModal,
#tokenAnalyticsModal,
#userDetailsModal,
#editUserModal {
    z-index: 2500 !important;
}

.modal-backdrop.show,
.modal-backdrop.fade.show,
.modal-backdrop,
div.modal-backdrop {
    z-index: 2499 !important;
}

/* When ANY modal is open, HIDE slide-menu completely */
body.modal-open .slide-menu,
.modal-open .slide-menu {
    display: none !important;
}

body.modal-open .hamburger-menu,
.modal-open .hamburger-menu {
    display: none !important;
}

/* Additional safeguard: when modal backdrop exists, force navigation elements below */
.modal-backdrop ~ .slide-menu,
.modal-backdrop ~ .hamburger-menu {
    z-index: 1500 !important;
    pointer-events: none !important;
}
