/* Liquid Glass Menu - Apple Glassmorphism Style */
/* Universal liquid glass menu styles for all pages */

/* Enhanced Glassmorphism Menu Styles */
.menu-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1003;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: rgba(0, 0, 0, 0.9);
}

.menu-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1002;
    padding: 80px 24px 24px;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08),
                inset 1px 0 0 rgba(255, 255, 255, 0.3);
    overflow-y: auto;
    transform: translateX(100%);
}

.menu-panel.open {
    right: 0;
    transform: translateX(0);
}

.menu-panel .nav-link {
    color: rgba(0, 0, 0, 0.85);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    text-decoration: none;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.menu-panel .nav-link:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: rgba(0, 0, 0, 0.9);
}

.menu-panel .nav-link i {
    margin-right: 12px;
    font-size: 1.1em;
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.menu-panel .user-section {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    margin-top: 24px;
    padding-top: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px 20px 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.menu-panel .user-email {
    color: rgba(0, 0, 0, 0.8);
    font-size: 0.9em;
    margin-bottom: 16px;
    padding: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.menu-panel .btn-cosmic {
    width: 100%;
    margin-bottom: 12px;
    background: rgba(106, 17, 203, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(106, 17, 203, 0.3);
    transition: all 0.3s ease;
    font-weight: 500;
    color: rgba(106, 17, 203, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.menu-panel .btn-cosmic:hover {
    background: rgba(106, 17, 203, 0.3);
    border-color: rgba(106, 17, 203, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(106, 17, 203, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: rgba(106, 17, 203, 1);
}

/* Dark Mode Glassmorphism Support */
body.dark-mode .menu-toggle {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.dark-mode .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.dark-mode .menu-panel {
    background: rgba(0, 0, 0, 0.15);
    border-left-color: rgba(255, 255, 255, 0.1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
}

body.dark-mode .menu-panel .nav-link {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .menu-panel .nav-link:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body.dark-mode .menu-panel .user-section {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .menu-panel .btn-cosmic {
    background: rgba(106, 17, 203, 0.4);
    border-color: rgba(106, 17, 203, 0.5);
}

body.dark-mode .menu-panel .btn-cosmic:hover {
    background: rgba(106, 17, 203, 0.6);
    border-color: rgba(106, 17, 203, 0.7);
}

/* Dynamic Adaptive Menu Styles - Apple Liquid Glass Effect */
.menu-panel.adaptive-light {
    /* When content behind is light - subtle tint */
    background: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
}

.menu-panel.adaptive-light .nav-link {
    color: rgba(0, 0, 0, 0.85);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.menu-panel.adaptive-light .nav-link:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(0, 0, 0, 0.9);
}

.menu-panel.adaptive-light .user-email {
    color: rgba(0, 0, 0, 0.8);
}

.menu-panel.adaptive-dark {
    /* When content behind is dark - subtle white tint */
    background: rgba(0, 0, 0, 0.15);
    border-left-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
}

.menu-panel.adaptive-dark .nav-link {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.menu-panel.adaptive-dark .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 1);
}

.menu-panel.adaptive-dark .user-email {
    color: rgba(255, 255, 255, 0.85);
}

.menu-panel.adaptive-dark .user-section {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.2);
}

/* Adaptive Button Styles */
.menu-panel.adaptive-dark .btn-cosmic {
    background: rgba(106, 17, 203, 0.8);
    border-color: rgba(106, 17, 203, 0.9);
    color: white;
}

.menu-panel.adaptive-dark .btn-cosmic:hover {
    background: rgba(106, 17, 203, 0.9);
    border-color: rgba(106, 17, 203, 1);
}

/* Smooth transitions between adaptive states */
.menu-panel,
.menu-panel .nav-link,
.menu-panel .user-section,
.menu-panel .user-email,
.menu-panel .btn-cosmic {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Menu Toggle Adaptive Styles */
.menu-toggle.adaptive-light {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.5);
}

.menu-toggle.adaptive-dark {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.5);
    color: rgba(0, 0, 0, 0.9);
}

/* Adaptive Menu Loading State */
.menu-panel.analyzing {
    background: rgba(128, 128, 128, 0.9);
    transition: background 0.2s ease;
}

.menu-panel.analyzing::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: adaptiveSpinner 0.8s linear infinite;
    z-index: 1001;
}

@keyframes adaptiveSpinner {
    to { transform: rotate(360deg); }
}

/* Performance optimization classes */
.menu-panel.adaptive-transition {
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Enhanced contrast for edge cases */
.menu-panel.adaptive-high-contrast .nav-link {
    font-weight: 700;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.menu-panel.adaptive-high-contrast.adaptive-dark .nav-link {
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* Menu Backdrop */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.menu-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .menu-toggle {
        top: auto !important;
        bottom: 80px !important;
        right: 20px !important;
        z-index: 1003 !important;
        width: 56px !important;
        height: 56px !important;
        font-size: 18px !important;
        background: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    }
    
    .menu-panel {
        width: 100vw !important;
        right: -100vw !important;
        padding: 70px 20px 20px !important;
        border-left: none !important;
        box-shadow: 0 0 32px rgba(0, 0, 0, 0.3) !important;
    }

    .menu-panel.open {
        right: 0 !important;
        transform: translateX(0) !important;
    }
    
    .menu-panel .nav-link {
        padding: 18px 20px;
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    .menu-panel .user-section {
        padding: 24px 20px 20px;
        margin-top: 30px;
    }
    
    /* Add subtle background to buttons for better visibility */
    .menu-toggle::before {
        content: '';
        position: absolute;
        top: -5px;
        left: -5px;
        right: -5px;
        bottom: -5px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 50%;
        z-index: -1;
    }
}

@media (max-width: 480px) {
    /* Adjust for very small screens */
    .menu-toggle {
        bottom: 70px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 16px !important;
    }
    
    .menu-panel {
        width: 100vw !important;
        right: -100vw !important;
        padding: 60px 15px 20px !important;
    }

    .menu-panel.open {
        right: 0 !important;
        transform: translateX(0) !important;
    }
    
    .menu-panel .nav-link {
        padding: 16px 15px;
        font-size: 1.05em;
        margin-bottom: 10px;
    }
    
    .menu-panel .user-section {
        padding: 20px 15px 15px;
        margin-top: 25px;
    }
}

/* Educational Resources Section Styling */
.educational-resources-section {
    margin-top: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    color: #d4af37;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    margin: 1rem 0;
}

.external-link {
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.external-link:hover {
    background: rgba(212, 175, 55, 0.1) !important;
    border-left: 3px solid #d4af37;
    padding-left: 1.5rem !important;
}

.external-link i.fab.fa-youtube {
    color: #ff6b6b;
}

.external-link i.fas.fa-book {
    color: #87ceeb;
}

.external-link .fa-external-link-alt {
    margin-left: auto;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.external-link:hover .fa-external-link-alt {
    opacity: 1;
}

/* Collapsible Menu Categories - Additional Styling */
.menu-category .category-header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-category .category-header:active {
    transform: translateX(2px) scale(0.98);
}

.menu-category .category-content {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    margin: 0 12px 8px 12px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.menu-category .category-item {
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.menu-category .category-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Enhanced mobile touch targets */
@media (max-width: 768px) {
    .menu-category .category-header {
        min-height: 48px;
        padding: 16px 20px;
        margin: 8px 12px;
    }

    .menu-category .category-item {
        min-height: 44px;
        padding: 14px 18px !important;
        margin: 6px 12px 6px 28px !important;
    }

    .category-icon {
        font-size: 1.1rem;
    }

    .category-title {
        font-size: 1.05rem;
    }
}

/* Smooth animations for better UX */
.menu-category .category-content.expanded {
    animation: expandCategory 0.3s ease-out;
}

@keyframes expandCategory {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        max-height: 500px;
        opacity: 1;
        transform: translateY(0);
    }
}
