/* 
 * Mobile Drawer Styles 
 */
.menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 5000; /* Extremely high */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

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

.mobile-menu {
    position: fixed;
    top: 0; right: 0;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 5001; /* Above overlay */
    transform: translateX(100%);
    opacity: 1;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    transform: translateX(0);
    visibility: visible;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-close {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.mobile-menu-close:hover {
    background: #e2e8f0;
}

.mobile-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.mobile-menu-nav > a, .accordion-btn-toggle {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    text-decoration: none;
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
}

.mobile-menu-nav > a:hover, .accordion-btn-toggle:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.accordion-item {
    display: flex;
    flex-direction: column;
}

.accordion-menu {
    display: none;
    background: #fdfdfd;
    padding-left: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.accordion-item.expanded .accordion-menu {
    display: block;
}

.accordion-menu a {
    display: flex;
    align-items: center;
    padding: 12px 48px;
    font-size: 0.95rem;
    color: #475569;
    border-bottom: 1px solid #f8fafc;
    width: 100%;
}

.accordion-menu a:last-child {
    border-bottom: none;
}

.accordion-btn-toggle .chevron {
    margin-left: auto;
    transition: transform 0.3s;
}

.accordion-item.expanded .accordion-btn-toggle .chevron {
    transform: rotate(180deg);
}

.mobile-menu-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: #2563eb;
    font-size: 1.2rem;
}

.mobile-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0 20px;
}

.link-icon {
    width: 24px;
    margin-right: 12px;
    color: #64748b;
    font-size: 1.1rem;
}

body.no-scroll {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* ===== MODERN CLASS SELECTION POPUP ===== */
.nav-popup-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-popup-modal {
    background: #fff;
    width: 90%;
    max-width: 480px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.nav-popup-overlay.active .nav-popup-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.nav-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.header-texts h3 {
    margin: 0 0 4px 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.header-texts p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

.nav-popup-close {
    background: #f1f5f9;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #64748b; cursor: pointer;
    transition: all 0.2s ease;
}

.nav-popup-close:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

.nav-popup-body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding-left: 4px;
}

.nav-class-card {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 16px;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-class-card:hover {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.nav-class-card:active {
    transform: scale(0.98);
}

.nav-class-card.is-selected {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.nav-class-card .card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: #ffffff;
    color: #64748b;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-class-card.is-selected .card-icon {
    background: #3b82f6;
    color: white;
}

.nav-class-card .card-info {
    display: flex; flex-direction: column; gap: 4px; flex: 1;
}

.title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-wrap strong {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 700;
}

.title-wrap .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-popular { background: #dcfce7; color: #16a34a; }
.badge-hot { background: #fee2e2; color: #ef4444; }

.nav-class-card .card-info span.desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.card-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-class-card.is-selected .card-indicator {
    background: #3b82f6;
    border-color: #3b82f6;
}

.nav-class-card.is-selected .card-indicator::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

/* Mobile Bottom Sheet */
@media (max-width: 768px) {
    .nav-popup-overlay {
        align-items: flex-end;
    }
    
    .nav-popup-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 32px 32px 0 0;
        transform: translateY(100%);
        max-height: 85vh;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        margin: 0;
        box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    }
    
    .nav-popup-overlay.active .nav-popup-modal {
        transform: translateY(0);
    }
    
    .nav-class-card {
        padding: 14px 16px;
    }
    
    .nav-popup-header {
        padding: 20px;
    }
}
