/* src/pages/InstructorPage.css - INSTRUCTOR PORTAL STYLES */

/* ─── Layout ──────────────────────────────────────────── */
.instructor-container {
    display: flex;
    min-height: 100vh;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #ffffff;
}

/* Grain texture (matches admin) */
.instructor-container::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    width: 200%; height: 200%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    animation: grain 8s steps(10) infinite;
    z-index: 1;
}

@keyframes grain {
    0%,100% { transform: translate(0,0); }
    10% { transform: translate(-5%,-10%); }
    30% { transform: translate(3%,-15%); }
    50% { transform: translate(12%,9%); }
    70% { transform: translate(9%,4%); }
    90% { transform: translate(-1%,7%); }
}

/* CSS Variables — Dark Mode (default) */
.instructor-container,
.instructor-container[data-theme='dark'] {
    --role-primary: #f59e0b;
    --role-glow: rgba(245,158,11,0.4);
    --sidebar-bg: linear-gradient(180deg,#1a1a1a 0%,#0f0f0f 100%);
    --sidebar-border: rgba(255,255,255,0.05);
    --nav-active-bg: linear-gradient(135deg,rgba(245,158,11,0.25) 0%,rgba(180,115,0,0.15) 100%);
    --nav-active-bar: linear-gradient(180deg,#f59e0b 0%,#d97706 100%);
    --nav-hover-bg: rgba(255,255,255,0.05);
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: rgba(255,255,255,0.55);
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1e1e1e;
    --bg-glass: rgba(255,255,255,0.03);
    --border-color: rgba(255,255,255,0.06);
    --border-glass: rgba(255,255,255,0.06);
    --theme-gradient: var(--role-primary);
    color: #ffffff;
    background: #0a0a0a;
}

/* Light mode overrides */
.instructor-container[data-theme='light'] {
    background: #f4f6f8;
    color: #111827;
    --role-primary: #d97706;
    --role-glow: rgba(217,119,6,0.3);
    --sidebar-bg: linear-gradient(180deg,#ffffff 0%,#f8f9fa 100%);
    --sidebar-border: rgba(0,0,0,0.08);
    --nav-active-bg: rgba(245,158,11,0.12);
    --nav-active-bar: linear-gradient(180deg,#f59e0b 0%,#d97706 100%);
    --nav-hover-bg: rgba(0,0,0,0.04);
    --text-primary: #111827;
    --text-muted: #6b7280;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f5;
    --border-color: rgba(0,0,0,0.06);
    --border-glass: rgba(0,0,0,0.06);
    --theme-gradient: var(--role-primary);
}

/* ─── Sidebar ─────────────────────────────────────────── */
.instructor-sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: 80px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 100;
    overflow-x: hidden;
    overflow-y: auto;
}

.instructor-sidebar:not(.collapsed) {
    width: 260px;
}

.instructor-sidebar::-webkit-scrollbar { width: 4px; }
.instructor-sidebar::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.instructor-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Sidebar Header */
.sidebar-header-inner {
    position: relative;
    padding: 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-primary);
    min-height: 72px;
    transition: padding 0.3s;
}

.instructor-sidebar:not(.collapsed) .sidebar-header-inner {
    justify-content: flex-start;
}

.sidebar-logo-icon {
    font-size: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 16px var(--role-glow));
}

.sidebar-logo-text {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
    display: none;
    color: var(--text-primary);
}

.instructor-sidebar:not(.collapsed) .sidebar-logo-text { display: block; }

.sidebar-role-badge {
    display: none;
    padding: 3px 10px;
    background: var(--role-primary);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.instructor-sidebar:not(.collapsed) .sidebar-role-badge { display: inline-block; }

/* ─── Nav ─────────────────────────────────────────────── */
.nav-container-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-nav-scroll {
    flex: 1;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-nav-scroll button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    /* NO overflow:hidden — needed for ::before left-bar accent */
}

.instructor-sidebar:not(.collapsed) .sidebar-nav-scroll button {
    justify-content: flex-start;
}

.sidebar-nav-scroll button:hover {
    background: var(--nav-hover-bg);
    color: var(--text-primary);
}

.sidebar-nav-scroll button.nav-active {
    background: var(--nav-active-bg);
    color: #ffffff;
    box-shadow: 0 4px 20px var(--role-glow);
}

.sidebar-nav-scroll button.nav-active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    height: 40px; width: 4px;
    background: var(--nav-active-bar);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px var(--role-glow);
}

.nav-icon-box {
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    font-size: 22px;
}

.sidebar-nav-scroll button.nav-active .nav-icon-box {
    background: rgba(245,158,11,0.28);
    border-color: rgba(245,158,11,0.35);
    box-shadow: 0 0 14px rgba(245,158,11,0.25), inset 0 0 10px rgba(245,158,11,0.12);
}


.nav-item-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.instructor-sidebar:not(.collapsed) .nav-item-label { display: block; }

.nav-active-dot {
    width: 6px; height: 6px;
    background: var(--role-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--role-glow);
    display: none;
    flex-shrink: 0;
}

.instructor-sidebar:not(.collapsed) .sidebar-nav-scroll button.nav-active .nav-active-dot {
    display: block;
}

/* ─── Footer ──────────────────────────────────────────── */
.sidebar-footer {
    padding: 16px 8px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-icons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.instructor-sidebar:not(.collapsed) .sidebar-icons-row {
    justify-content: flex-start;
    padding-left: 4px;
}

.sidebar-user-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--sidebar-border);
    border-radius: 14px;
    overflow: hidden;
}

.instructor-sidebar:not(.collapsed) .sidebar-user-row {
    justify-content: flex-start;
}

.sidebar-user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--role-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.instructor-sidebar:not(.collapsed) .sidebar-user-info { display: flex; }

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 12px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logout-btn:hover {
    background: rgba(239,68,68,0.18);
    border-color: rgba(239,68,68,0.4);
}

/* ─── Inline Toggle Button ──────────────────────────────── */
.sidebar-inline-toggle {
    position: absolute;
    right: 12px;
    top: 20px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    flex-shrink: 0;
    transition: all 0.2s;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sidebar-inline-toggle:hover {
    background: var(--role-primary);
    border-color: var(--role-primary);
    color: #000;
    transform: scale(1.05);
}

/* When collapsed: show toggle + logo stacked */
.instructor-sidebar.collapsed .sidebar-header-inner {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    min-height: 80px;
}

.instructor-sidebar.collapsed .sidebar-logo-text,
.instructor-sidebar.collapsed .sidebar-role-badge {
    display: none;
}

.instructor-sidebar.collapsed .sidebar-inline-toggle {
    width: 38px;
    height: 38px;
    font-size: 22px;
}

/* ─── Main Content ────────────────────────────────────── */
.instructor-main {
    flex: 1;
    margin-left: 260px;
    width: calc(100% - 260px);
    height: 100vh;
    background: linear-gradient(180deg,rgba(10,10,10,0.92) 0%,rgba(5,5,5,0.96) 100%);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1), width 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    z-index: 2;
}

.instructor-main.sidebar-collapsed {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* Utility */
.glass-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
}

.glass-input {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

/* ─── Mobile ──────────────────────────────────────────── */
.mobile-sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }
.mobile-instructor-profile { display: none; }
.mobile-logout-btn { display: none; }
.nav-scroll-btn { display: none !important; }

@media (max-width: 768px) {
    /* Hamburger button — always visible on mobile */
    .mobile-sidebar-toggle {
        display: flex !important;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1001;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: var(--bg-secondary);
        border: 1px solid var(--sidebar-border);
        color: var(--text-primary);
        font-size: 20px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    }

    /* Backdrop */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
    }

    .sidebar-backdrop.active {
        display: block;
    }
    /* Sidebar: hidden off-screen left, slides in as vertical drawer */
    .instructor-sidebar {
        width: 260px !important;
        height: 100vh !important;
        position: fixed;
        top: 0; left: 0;
        flex-direction: column !important;
        z-index: 1000;
        border-right: 1px solid var(--sidebar-border) !important;
        border-bottom: none !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        overflow-y: auto !important;
    }

    .instructor-sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Keep collapse toggle hidden on mobile — no icon-only mode needed */
    .sidebar-inline-toggle { display: none !important; }

    /* Always show labels inside the mobile drawer */
    .sidebar-logo-text { display: block !important; }
    .sidebar-role-badge { display: inline-block !important; }
    .nav-item-label { display: block !important; }
    .sidebar-footer { display: flex !important; }
    .sidebar-user-info { display: flex !important; }

    /* Nav: vertical column inside drawer */
    .nav-container-wrapper {
        flex-direction: column !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .sidebar-nav-scroll {
        flex-direction: column !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding: 16px 8px !important;
        gap: 6px !important;
    }

    .sidebar-nav-scroll button {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 10px !important;
    }

    .nav-icon-box { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; }
    .nav-active-dot { display: none !important; }

    /* Main: no offset, full width */
    .instructor-main {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 0 !important;
    }

    /* Hide horizontal scroll arrows */
    .nav-scroll-btn { display: none !important; }

    /* Hide mobile-only inline profile (was for top-bar, not needed in drawer) */
    .mobile-instructor-profile { display: none !important; }
}