/* ============================================================
   sidebar.css — Sidebar & navigation layout styles
   Extracted from navbar.php inline <style> block (#16)
   ============================================================ */

/* ─── Layout ─────────────────────────────────────────────── */
.student-layout {
    display: flex !important;
    min-height: 100vh;
    position: relative;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.student-sidebar {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    height: 100vh !important;
    background: #E8EDF7 !important;   /* Slate Blue Light */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-right: 1px solid rgba(37, 99, 235, 0.12) !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 20px !important;
    box-sizing: border-box !important;
}
[data-theme="dark"] .student-sidebar,
body.dark-mode .student-sidebar {
    background: #12243A !important;
    border-right: 1px solid rgba(37, 99, 235, 0.15) !important;
}

/* ─── Main content area ───────────────────────────────────── */
.student-main-content {
    flex: 1 !important;
    margin-left: 220px !important;
    min-height: 100vh;
    display: block !important;
    /* Reserve top strip for the fixed topbar */
    padding-top: 58px !important;
}

/* ─── Sidebar header ──────────────────────────────────────── */
.student-sidebar-header {
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid rgba(37, 99, 235, 0.10);
    margin-bottom: 8px;
    box-sizing: border-box;
}
.student-sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    width: 100%;
    padding: 18px 12px 16px;
    background: #ffffff;
    border-radius: 0;
}
.student-sidebar-logo img {
    display: block;
    width: 60px !important;
    height: auto;
    border-radius: 8px;
    filter: none;
}
/* Site name text under logo */
.student-sidebar-logo .sidebar-site-name {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1E3A5F;
    margin: 0;
    text-align: center;
}

/* ─── Sidebar nav list ────────────────────────────────────── */
.student-sidebar-nav {
    flex: 1;
    width: 100%;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    list-style: none;
    margin: 0;
    box-sizing: border-box;
}

/* ─── Nav links ───────────────────────────────────────────── */
.student-nav-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    text-decoration: none;
    color: #2D4A7A;
    font-weight: 600;
    border-radius: 14px;
    transition: all 0.18s ease;
    font-style: normal;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    position: relative;
}
.student-nav-link .s-icon {
    font-size: 1.45rem;
    line-height: 1;
    font-style: normal;
    display: block;
}
.student-nav-link .s-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
    line-height: 1.1;
    white-space: nowrap;
    color: #3D5A8A;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.student-nav-link:hover {
    background: rgba(37, 99, 235, 0.10);
    color: #1E3A5F;
}
.student-nav-link:hover .s-label { color: #1E3A5F; }
.student-nav-link.active {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37,99,235,0.45);
}
.student-nav-link.active .s-label { color: #fff; }

/* ─── Warm Premium Icon Tints (on dark navy background) ───── */
/* Icons glow in warm amber/peach tones to contrast navy sidebar */
.student-nav-link:not(.active) .ph-house            { color: #1E3A5F; }
.student-nav-link:not(.active) .ph-books            { color: #1E3A5F; }
.student-nav-link:not(.active) .ph-book-open        { color: #1E3A5F; }
.student-nav-link:not(.active) .ph-clipboard-text   { color: #FCD34D; }
.student-nav-link:not(.active) .ph-envelope         { color: #6EE7B7; }
.student-nav-link:not(.active) .ph-graduation-cap   { color: #1E3A5F; }
.student-nav-link:not(.active) .ph-user             { color: #FCA5A5; }
.student-nav-link:not(.active) .ph-dots-three-circle{ color: #3B63A8; }
.student-nav-link:not(.active) .ph-medal            { color: #FCD34D; }
.student-nav-link:not(.active) .ph-question         { color: #93C5FD; }
.student-nav-link:not(.active) .ph-trophy           { color: #FCD34D; }
.student-nav-link:not(.active) .ph-files            { color: #3B63A8; }
.student-nav-link:not(.active) .ph-notebook         { color: #6EE7B7; }
.student-nav-link:not(.active) .ph-calendar-check   { color: #1E3A5F; }
.student-nav-link:not(.active) .ph-bookmark-simple  { color: #FCA5A5; }
.student-nav-link:not(.active) .ph-lifebuoy         { color: #5EEAD4; }
.student-nav-link:not(.active) .ph-currency-dollar  { color: #86EFAC; }
.student-nav-link:not(.active) .ph-chart-bar        { color: #93C5FD; }
.student-nav-link:not(.active) .ph-chart-line-up    { color: #93C5FD; }
.student-nav-link:not(.active) .ph-check-square-offset { color: #C4B5FD; }
.student-nav-link:not(.active) .ph-check-square     { color: #C4B5FD; }
.student-nav-link:not(.active) .ph-users-three      { color: #FDBA74; }
.student-nav-link:not(.active) .ph-stack            { color: #93C5FD; }
.student-nav-link:not(.active) .ph-warning-circle   { color: #FCA5A5; }
.student-nav-link:not(.active) .ph-video-camera     { color: #C4B5FD; }
.student-nav-link:not(.active) .ph-gauge            { color: #1E3A5F; }
.student-nav-link:not(.active) .ph-users            { color: #FCA5A5; }
.student-nav-link:not(.active) .ph-tag              { color: #FCD34D; }
.student-nav-link:not(.active) .ph-ticket           { color: #5EEAD4; }
.student-nav-link:not(.active) .ph-megaphone        { color: #FCA5A5; }
.student-nav-link:not(.active) .ph-gear             { color: #3B63A8; }
.student-nav-link:not(.active) .ph-sliders          { color: #3B63A8; }
.student-nav-link:not(.active) .ph-info             { color: #93C5FD; }
.student-nav-link:not(.active) .ph-sign-out         { color: #FCA5A5; }
.student-nav-link:not(.active) .ph-house            { color: #1E3A5F; }
.student-nav-link:not(.active) .ph-hand-coins       { color: #86EFAC; }
.student-nav-link:not(.active) .ph-folder-open      { color: #FCD34D; }
.student-nav-link:not(.active) .ph-certificate      { color: #FCD34D; }
.student-nav-link:not(.active) .ph-list-magnifying-glass { color: #93C5FD; }
/* Theme toggle */
.student-nav-link .ph-sun  { color: #FCD34D !important; }
.student-nav-link .ph-moon { color: #C4B5FD !important; }
/* Active state: icon turns white */
.student-nav-link.active i { color: #fff !important; }

/* ─── Sidebar footer ──────────────────────────────────────── */
.student-sidebar-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid rgba(37, 99, 235, 0.12);
    padding-top: 8px;
    gap: 4px;
}

/* ─── "More" collapsible group ────────────────────────────── */
.sidebar-more-panel {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    background: rgba(37, 99, 235, 0.04);
    border-radius: 12px;
    padding: 4px 0;
}
.sidebar-more-panel.open { display: flex; }
[data-theme="dark"] .sidebar-more-panel,
body.dark-mode .sidebar-more-panel { background: rgba(37, 99, 235, 0.03); }

/* ─── Full-Width Top Bar ────────────────────────────────── */
/* Replaces the old floating pill: spans from sidebar to right edge */
.tbi-topbar {
    position: fixed;
    top: 0;
    left: 220px;
    right: 0;
    height: 58px;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(255, 252, 248, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(194, 120, 67, 0.12);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.07);
}
.tbi-topbar-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1C1917;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tbi-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
/* Legacy pill class kept for backward compat on pages not yet updated */
.nav-top-right-actions {
    position: fixed;
    top: 10px;
    right: 24px;
    z-index: 1010;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 252, 248, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 6px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(194, 120, 67, 0.15);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.10);
}
@media (max-width: 768px) {
    .tbi-topbar { left: 0; }
    .nav-top-right-actions { top: 8px; right: 12px; }
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4b5563;
    font-size: 1.4rem;
    transition: all 0.2s;
    border: none;
    background: transparent;
    position: relative;
    padding: 0;
}
.nav-icon-btn:hover { background: rgba(0,0,0,0.05); color: #1f2937; }
[data-theme="dark"] .nav-icon-btn { color: #9ca3af; }
[data-theme="dark"] .nav-icon-btn:hover { background: rgba(255,255,255,0.05); color: #f3f4f6; }

.notif-badge-count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
[data-theme="dark"] .notif-badge-count { border-color: #0f172a; }

.nav-profile-trigger {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    padding: 2px;
    background: transparent;
}
.nav-profile-trigger:hover { border-color: #3b82f6; }
.nav-profile-trigger img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.nav-profile-initials {
    width: 100%; height: 100%; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* ─── Rich Dropdown ────────────────────────────────────────── */
.tp-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 280px;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    overflow: hidden;
    animation: tp-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}
.tp-dropdown.open { display: block; }

@keyframes tp-fade-in {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

[data-theme="dark"] .tp-dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.tp-dropdown-list { list-style: none; padding: 12px 0; margin: 0; }
.tp-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: #1f2937;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    transition: all 0.2s;
}
.tp-dropdown-item:hover { background: #f9fafb; color: #2563eb; }
[data-theme="dark"] .tp-dropdown-item { color: #e5e7eb; }
[data-theme="dark"] .tp-dropdown-item:hover { background: rgba(255,255,255,0.05); color: #60a5fa; }

.tp-dropdown-divider { height: 1px; background: #e5e7eb; margin: 8px 0; }
[data-theme="dark"] .tp-dropdown-divider { background: #334155; }

.tp-plus-cta {
    background: #f8fafc;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}
[data-theme="dark"] .tp-plus-cta { background: rgba(0,0,0,0.2); border-color: #334155; }

.btn-plus-promo {
    color: #2563eb;
    text-decoration: none;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}
.btn-plus-promo .badge-plus {
    background: #2563eb; color: white; border-radius: 4px; padding: 2px 6px; font-size: 10px; vertical-align: middle; margin-left: 4px;
}
.tp-plus-cta p { font-size: 12px; color: #6b7280; margin: 0; }

/* ─── Sidebar Modals ──────────────────────────────────────── */
.sb-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.sb-modal-overlay.open { display: flex; }
.sb-modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
}
[data-theme="dark"] .sb-modal-box { background: #1e293b; color: #e2e8f0; }
.sb-modal-close {
    position: absolute;
    top: 16px; right: 20px;
    background: none; border: none;
    font-size: 1.4rem; cursor: pointer;
    color: #94a3b8;
}
.sb-modal-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 1rem; color: inherit; }
.sb-modal-textarea {
    width: 100%; min-height: 120px;
    border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 0.75rem;
    font-family: inherit; font-size: 0.95rem;
    resize: vertical; box-sizing: border-box;
    background: #f8fafc; color: #1e293b;
}
[data-theme="dark"] .sb-modal-textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.sb-modal-btn {
    display: inline-block; padding: 0.6rem 1.4rem;
    border-radius: 10px; border: none; cursor: pointer;
    font-weight: 700; font-size: 0.9rem; transition: 0.2s;
}
.sb-modal-btn-primary { background: #4f46e5; color: white; }
.sb-modal-btn-primary:hover { background: #4338ca; }
.sb-modal-btn-secondary { background: #f1f5f9; color: #475569; margin-left: 8px; }
.sb-modal-btn-secondary:hover { background: #e2e8f0; }
.sb-modal-status { font-size: 0.85rem; margin-top: 0.5rem; text-align: center; }

/* ─── Rating Stars ────────────────────────────────────────── */
.star-rating { display: flex; gap: 6px; margin: 0.75rem 0; }
.star-rating button {
    background: none; border: none; font-size: 1.6rem;
    cursor: pointer; transition: transform 0.1s; padding: 0;
    color: #cbd5e1;
}
.star-rating button.active, .star-rating button:hover { color: #f59e0b; transform: scale(1.15); }

/* ─── Mobile (bottom tab bar) ─────────────────────────────── */
@media (max-width: 768px) {
    .student-sidebar {
        width: 100% !important; max-width: 100% !important;
        height: 64px !important; flex-direction: row !important;
        top: auto !important; bottom: 0 !important; left: 0 !important;
        border-right: none !important; border-top: 1px solid rgba(37,99,235,0.12) !important;
        overflow-y: hidden !important; overflow-x: auto !important;
        justify-content: space-around !important; padding: 0 !important;
        align-items: center !important;
    }
    .student-sidebar-header, .student-sidebar-footer { display: none !important; }
    .student-sidebar-nav {
        flex-direction: row !important; width: auto !important;
        padding: 0 !important; gap: 0 !important; flex: 1 !important;
        justify-content: space-around !important; align-items: stretch !important;
    }
    .student-nav-link {
        width: auto !important; min-width: 50px !important;
        padding: 6px 8px !important; border-radius: 0 !important; flex: 1 !important;
        flex-direction: column !important; align-items: center !important;
        justify-content: center !important; gap: 3px !important;
    }
    .student-nav-link .s-label {
        font-size: 0.55rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.02em !important;
    }
    .student-main-content {
        margin-left: 0 !important;
        padding-bottom: 70px !important;
    }
    .nav-top-right-actions { top: 10px; right: 12px; position: fixed; z-index: 1050; background: transparent; }
    .nav-user-name { display: none; }
    .sidebar-more-panel { display: flex; flex-direction: row; width: auto; padding: 0; background: none; border-radius: 0; }
}
