/* ===== TEACHER DASHBOARD — Premium UI ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand:       #4f46e5;
    --brand-light: #6366f1;
    --brand-dark:  #3730a3;
    --success:     #10b981;
    --warning:     #f59e0b;
    --danger:      #ef4444;
    --bg:          #0f0f1a;
    --bg2:         #16162a;
    --bg3:         #1e1e38;
    --border:      rgba(255,255,255,0.07);
    --text:        #f1f5f9;
    --text2:       #94a3b8;
    --text3:       #64748b;
    --radius:      14px;
    --shadow:      0 4px 24px rgba(0,0,0,0.4);
}

/* ===== PENDING SCREEN ===== */
#pending-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f1a 0%, #1e1b4b 100%);
    padding: 20px;
}

.pending-card {
    background: #16162a;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    text-align: center;
}

.pending-spinner {
    font-size: 3.5rem;
    margin: 16px 0;
    display: inline-block;
    animation: pendingSpin 2s linear infinite;
}

@keyframes pendingSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pending-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 10px;
}

.pending-sub {
    font-size: 0.9rem;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 24px;
}

.pending-steps {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.pstep {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.04);
    color: var(--text3);
    border: 1px solid var(--border);
}

.pstep.done { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.pstep.active { background: rgba(99,102,241,0.2); color: #a5b4fc; border-color: rgba(99,102,241,0.4); animation: stepPulse 2s ease-in-out infinite; }

@keyframes stepPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 12px rgba(99,102,241,0.5); }
}

.pending-tip {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.82rem;
    color: #fcd34d;
    line-height: 1.5;
    text-align: left;
    margin-bottom: 4px;
}

.pending-tip code {
    background: rgba(245,158,11,0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
}


body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* ===== AUTH SCREEN ===== */
#auth-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f1a 0%, #1e1b4b 100%);
    padding: 20px;
}

.auth-card {
    background: #16162a;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.auth-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
}

.auth-logo span { color: var(--brand-light); }

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text2);
    font-weight: 600;
    margin-bottom: 28px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text2);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--brand);
    color: #fff;
}

.auth-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #fca5a5;
    margin-top: 12px;
    font-weight: 600;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.t-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}

.t-input:focus { border-color: var(--brand-light); }
.t-input::placeholder { color: var(--text3); }

.t-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.t-select:focus { border-color: var(--brand-light); }

.t-select option { background: #1e1e38; }

/* ===== BUTTONS ===== */
.t-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.t-btn-primary { background: var(--brand); color: #fff; }
.t-btn-primary:hover { background: var(--brand-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }

.t-btn-ghost { background: rgba(255,255,255,0.07); color: var(--text2); }
.t-btn-ghost:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.t-btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.t-btn-danger:hover { background: rgba(239,68,68,0.3); }

.t-btn-success { background: rgba(16,185,129,0.2); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.t-btn-success:hover { background: rgba(16,185,129,0.35); }

.t-btn-sm { padding: 7px 14px; font-size: 0.82rem; border-radius: 8px; }

.w-full { width: 100%; justify-content: center; }

/* ===== DASHBOARD LAYOUT ===== */
#dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
#sidebar {
    width: 220px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 1.8rem;
}

.sidebar-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    color: var(--text);
}

.sidebar-sub {
    font-size: 0.7rem;
    color: var(--text3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.snav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text2);
    font-weight: 600;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.18s;
    text-align: left;
    width: 100%;
}

.snav-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.snav-btn.active { background: rgba(99,102,241,0.2); color: #a5b4fc; font-weight: 700; }
.snav-btn span { font-size: 1rem; }

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.teacher-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
}

.teacher-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.teacher-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teacher-school {
    font-size: 0.72rem;
    color: var(--text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn { color: var(--text3) !important; font-size: 0.82rem !important; }

/* MAIN AREA */
#main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

#topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    flex-shrink: 0;
}

#topbar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* PAGE */
.page {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: none;
    flex-direction: column;
    gap: 20px;
}

.page.active { display: flex; }

/* ===== WELCOME BANNER ===== */
.welcome-banner {
    background: linear-gradient(130deg, var(--brand-dark) 0%, var(--brand) 60%, #7c3aed 100%);
    border-radius: 18px;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    right: -40px; top: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
}

.welcome-sub {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
}

/* ===== STATS STRIP ===== */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    flex-shrink: 0;
}

.stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon { font-size: 1.4rem; margin-bottom: 6px; }
.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
}
.stat-lbl {
    font-size: 0.72rem;
    color: var(--text3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

.page-sub {
    font-size: 0.82rem;
    color: var(--text3);
    margin-top: 3px;
    font-weight: 500;
}

/* ===== CLASS GRID ===== */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.class-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.class-card:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.class-card-banner {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.class-card-body {
    padding: 14px 18px;
}

.class-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text2);
    margin-bottom: 12px;
}

.class-card-code {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--brand-light);
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.class-card-code-label {
    font-size: 0.7rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.class-card-actions {
    display: flex;
    gap: 8px;
}

/* ===== STUDENTS TABLE ===== */
.students-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg2);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.students-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

.students-table td {
    padding: 12px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

.students-table tr:last-child td { border-bottom: none; }
.students-table tr:hover td { background: rgba(255,255,255,0.025); }

.student-name {
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(99,102,241,0.2);
    color: #a5b4fc;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.mini-bar-wrap {
    width: 80px;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 20px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.mini-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), #818cf8);
    border-radius: 20px;
}

.topic-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(16,185,129,0.15);
    color: #6ee7b7;
    border-radius: 20px;
    padding: 3px 10px;
}

/* ===== ASSIGNMENTS LIST ===== */
.assignment-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.assignment-card:hover { border-color: rgba(99,102,241,0.35); }

.assignment-icon {
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    background: rgba(99,102,241,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assignment-info { flex: 1; }

.assignment-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 4px;
}

.assignment-meta {
    font-size: 0.8rem;
    color: var(--text3);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.assignment-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.a-progress {
    text-align: right;
    flex-shrink: 0;
}

.a-progress-val {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--success);
}

.a-progress-lbl {
    font-size: 0.72rem;
    color: var(--text3);
}

/* ===== JOIN CODE BOX ===== */
.join-code-box {
    background: rgba(99,102,241,0.1);
    border: 2px dashed rgba(99,102,241,0.4);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.join-code-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.join-code {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--brand-light);
    letter-spacing: 8px;
    margin-bottom: 8px;
}

.join-code-hint {
    font-size: 0.8rem;
    color: var(--text3);
    line-height: 1.4;
}

/* ===== MODALS ===== */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: modalIn 0.2s ease;
}

.modal-wide { max-width: 760px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ===== TOAST ===== */
.teacher-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    z-index: 9999;
    box-shadow: var(--shadow);
    animation: toastIn 0.25s ease;
    max-width: 320px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== UTILS ===== */
.hidden { display: none !important; }
.empty-state {
    text-align: center;
    color: var(--text3);
    font-size: 0.9rem;
    padding: 40px;
    font-weight: 500;
}

/* BANNER COLORS */
.banner-indigo  { background: linear-gradient(120deg, #3730a3, #6366f1); }
.banner-emerald { background: linear-gradient(120deg, #065f46, #10b981); }
.banner-amber   { background: linear-gradient(120deg, #92400e, #f59e0b); }
.banner-rose    { background: linear-gradient(120deg, #9f1239, #f43f5e); }
.banner-cyan    { background: linear-gradient(120deg, #164e63, #06b6d4); }
.banner-violet  { background: linear-gradient(120deg, #4c1d95, #8b5cf6); }

/* ===== CONTROL PANEL TOGGLES ===== */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.control-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}
.control-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
}
.control-icon { font-size: 1.1rem; }
/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    padding: 0;
}
.toggle-switch.active {
    background: #6C5CE7;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.2s;
}
.toggle-switch.active::after {
    transform: translateX(20px);
}
