/* ==========================================================================
   SIKKHALAY DIGITAL SCHOOL OS — NEXT-GEN LIVE CLASSROOM STUDIO CSS
   Ultra-Modern Teacher Broadcast Engine & Interactive Workspace
   Default Theme: Premium Clean Light Studio (with Dark Support)
   ========================================================================== */

:root, [data-theme="light"] {
    --bg-main: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #F8FAFC;
    --bg-surface-hover: #EEF2F6;
    --bg-surface-secondary: #F8FAFC;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-glass-dock: rgba(15, 23, 42, 0.94);
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-inverse: #FFFFFF;
    
    --brand-primary: #059669;
    --brand-primary-hover: #047857;
    --brand-primary-light: #ECFDF5;
    --brand-primary-border: #A7F3D0;
    --brand-accent: #10B981;
    --brand-glow: rgba(16, 185, 129, 0.25);
    
    --brand-teal: #0D9488;
    --brand-teal-light: #F0FDFA;
    
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --danger-border: #FECACA;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --info: #0284C7;
    --info-light: #E0F2FE;
    
    --border-color: #E2E8F0;
    --border-subtle: #F1F5F9;
    --border-focus: #10B981;
    
    --stage-bg: #090D16;
    --wb-canvas-bg: #FFFFFF;
    --wb-canvas-grid: rgba(15, 23, 42, 0.08);
    
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 16px rgba(16, 185, 129, 0.25);
    
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0B0F19;
    --bg-surface: #131B2E;
    --bg-surface-elevated: #1E293B;
    --bg-surface-hover: #293548;
    --bg-surface-secondary: #0F172A;
    --bg-glass: rgba(19, 27, 46, 0.85);
    --bg-glass-dock: rgba(15, 23, 42, 0.9);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #0F172A;
    
    --brand-primary: #059669;
    --brand-primary-hover: #047857;
    --brand-primary-light: rgba(5, 150, 105, 0.15);
    --brand-primary-border: rgba(16, 185, 129, 0.35);
    --brand-accent: #10B981;
    --brand-glow: rgba(16, 185, 129, 0.4);
    
    --brand-teal: #0D9488;
    --brand-teal-light: rgba(13, 148, 136, 0.15);
    
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.18);
    --danger-border: rgba(239, 68, 68, 0.4);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.18);
    --info: #38BDF8;
    --info-light: rgba(56, 189, 248, 0.15);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-focus: #10B981;
    
    --stage-bg: #050811;
    --wb-canvas-bg: #0F172A;
    --wb-canvas-grid: rgba(255, 255, 255, 0.12);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Buttons and Form elements reset */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
    color: var(--text-primary);
}

/* ==========================================================================
   1. STICKY HEADER (Light & Clean)
   ========================================================================== */
.classroom-header {
    height: 60px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.back-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.back-btn:hover {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary-border);
    transform: translateX(-2px);
}

.header-class-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition-fast);
}
.icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: #CBD5E1;
}

/* ==========================================================================
   2. MAIN STUDIO GRID LAYOUT
   ========================================================================== */
.classroom-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    padding: 16px;
    max-width: 1840px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* Theater Mode Viewport Override */
body.theatre-mode .classroom-container {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 8px 12px;
}
body.theatre-mode .classroom-sidebar {
    display: none;
}

.classroom-viewport {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* ==========================================================================
   3. MULTIMODAL BROADCAST STAGE
   ========================================================================== */
.broadcast-stage-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

/* Mode Switcher Nav Tabs at Stage Top */
.stage-mode-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
}

.stage-mode-pills {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 4px;
}

.mode-pill-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--text-secondary);
    gap: 6px;
    transition: var(--transition-fast);
}
.mode-pill-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}
.mode-pill-btn.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.stage-telemetry-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.telemetry-badge {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.live-pulse-indicator {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #EF4444;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #EF4444;
    border-radius: 50%;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Stage Canvas Viewport (16:9 Aspect Ratio) */
.stage-canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--stage-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mode 1: Video Element */
#liveVideoCanvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mode 2: Whiteboard Canvas */
#whiteboardCanvasContainer {
    position: absolute;
    inset: 0;
    background: var(--wb-canvas-bg);
    display: none;
    flex-direction: column;
    z-index: 10;
}
#whiteboardCanvasContainer.active {
    display: flex;
}

.wb-toolbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 15;
    box-shadow: var(--shadow-sm);
}

.wb-tool-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface-elevated);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.wb-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}
.wb-tool-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.wb-tool-btn.active {
    background: var(--brand-primary);
    color: #FFFFFF;
}

.wb-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease;
}
.wb-color-dot:hover, .wb-color-dot.active {
    transform: scale(1.25);
    border-color: #0F172A;
}

#paintCanvas {
    flex: 1;
    width: 100%;
    cursor: crosshair;
    background-color: var(--wb-canvas-bg);
}

#paintCanvas.grid-bg {
    background-image: radial-gradient(var(--wb-canvas-grid) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Mode 3: Slide Presentation Viewer */
#slidePresentationContainer {
    position: absolute;
    inset: 0;
    background: #090D16;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
#slidePresentationContainer.active {
    display: flex;
}

.slide-render-frame {
    width: 88%;
    height: 82%;
    background: #FFFFFF;
    color: #0F172A;
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
}

.slide-controls-bar {
    position: absolute;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.9);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Floating Emoji Reactions Stream */
.reactions-overlay-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 25;
    overflow: hidden;
}

.floating-reaction-item {
    position: absolute;
    bottom: 20px;
    font-size: 2.2rem;
    animation: floatReactionUp 2.8s ease-out forwards;
    opacity: 0.95;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes floatReactionUp {
    0% { transform: translateY(0) scale(0.5) rotate(0deg); opacity: 1; }
    50% { transform: translateY(-160px) scale(1.3) rotate(-12deg); opacity: 0.9; }
    100% { transform: translateY(-340px) scale(0.8) rotate(15deg); opacity: 0; }
}

/* On-Screen Focus Timer Overlay */
.focus-timer-overlay {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--brand-primary-border);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--brand-accent);
    z-index: 25;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.focus-timer-overlay.active {
    display: flex;
}

/* ==========================================================================
   4. FLOATING TEACHER COMMAND DOCK
   ========================================================================== */
.teacher-floating-dock {
    background: var(--bg-glass-dock);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 30;
}

.dock-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dock-btn {
    height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #F8FAFC;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 8px;
    transition: var(--transition-fast);
}
.dock-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.3);
}
.dock-btn.is-active {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-accent);
    box-shadow: 0 0 12px var(--brand-glow);
}
.dock-btn.is-danger {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #FECACA;
}
.dock-btn.is-danger:hover {
    background: var(--danger);
    color: #FFFFFF;
}

/* ==========================================================================
   5. INTERACTIVE RIGHT SIDEBAR (Light & Crisp)
   ========================================================================== */
.classroom-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 92px);
    position: sticky;
    top: 76px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-tab-nav {
    display: flex;
    align-items: center;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 4px;
    gap: 2px;
}

.s-nav-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    gap: 5px;
    position: relative;
    transition: var(--transition-fast);
}
.s-nav-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}
.s-nav-btn.active {
    background: var(--bg-surface);
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.tab-badge {
    background: var(--brand-primary);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: var(--radius-full);
}

.sidebar-pane-body {
    flex: 1;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}
.sidebar-pane-body.active {
    display: flex;
}

/* TAB 1: LIVE CHAT */
.pinned-announcement-bar {
    background: var(--brand-primary-light);
    border-bottom: 1px solid var(--brand-primary-border);
    padding: 8px 12px;
    font-size: 0.775rem;
    color: #065F46;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-stream-list {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}
.chat-avatar.is-teacher {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-accent);
}

.chat-msg-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-author {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-role-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}
.chat-role-pill.teacher {
    background: var(--brand-primary);
    color: #FFFFFF;
}
.chat-role-pill.student {
    background: #E2E8F0;
    color: var(--text-secondary);
}

.chat-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.chat-bubble {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    line-height: 1.4;
    color: var(--text-primary);
    word-break: break-word;
}
.chat-bubble.teacher-styled {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary-border);
    color: #064E3B;
}

.chat-composer-box {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 8px;
}
.chat-input-wrapper:focus-within {
    border-color: var(--brand-accent);
}

.chat-text-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px;
    font-size: 0.825rem;
    color: var(--text-primary);
}

.chat-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-emoji-btn {
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    transition: transform 0.15s ease;
}
.chat-emoji-btn:hover {
    transform: scale(1.3);
}

.btn-send-chat {
    background: var(--brand-primary);
    color: #FFFFFF;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 0.775rem;
    font-weight: 700;
    gap: 6px;
}
.btn-send-chat:hover {
    background: var(--brand-primary-hover);
}

/* TAB 2: CONNECTED STUDENTS ROSTER */
.roster-header-bar {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-secondary);
}

.roster-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.roster-row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}
.roster-row-card:hover {
    border-color: var(--brand-primary-border);
    background: var(--bg-surface);
}

.roster-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.roster-roll-chip {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.roster-name {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-primary);
}

.roster-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.roster-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.roster-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}
.roster-action-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.roster-action-btn.is-active {
    color: var(--brand-primary);
    background: var(--brand-primary-light);
    border-color: var(--brand-primary-border);
}

/* TAB 3: Q&A FORUM */
.qna-filter-bar {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qna-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qna-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.qna-card.pinned {
    border-color: var(--brand-primary-border);
    background: var(--brand-primary-light);
}

.qna-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.qna-question {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.qna-answer-box {
    background: #FFFFFF;
    border-left: 3px solid var(--brand-primary);
    padding: 8px 10px;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    font-size: 0.775rem;
    color: #064E3B;
    line-height: 1.4;
    box-shadow: var(--shadow-sm);
}

/* TAB 4: AI TEACHER CO-PILOT */
.ai-copilot-header {
    background: linear-gradient(135deg, #059669 0%, #0D9488 100%);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chips-shelf {
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
}

.ai-prompt-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}
.ai-prompt-chip:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-primary-light);
}

.ai-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-bubble {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: #166534;
    line-height: 1.5;
}

/* TAB 5: FILES & RESOURCES */
.files-shelf-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* ==========================================================================
   6. SECONDARY LOWER WORKSPACE (Collapsible Deck)
   ========================================================================== */
.secondary-workspace-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.workspace-deck-tabs {
    display: flex;
    align-items: center;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 14px;
    gap: 6px;
    overflow-x: auto;
}

.w-deck-btn {
    padding: 12px 16px;
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    gap: 8px;
    white-space: nowrap;
}
.w-deck-btn:hover {
    color: var(--text-primary);
}
.w-deck-btn.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    background: var(--bg-surface);
}

.workspace-deck-body {
    padding: 18px;
    min-height: 180px;
}

.teacher-notes-pad {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-primary);
    resize: vertical;
    line-height: 1.5;
}
.teacher-notes-pad:focus {
    border-color: var(--brand-primary);
    background: var(--bg-surface);
}

/* ==========================================================================
   7. MODALS
   ========================================================================== */
.modal-backdrop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal-backdrop-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: translateY(12px);
    transition: transform 0.2s ease;
}
.modal-backdrop-overlay.active .modal-dialog-box {
    transform: translateY(0);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.mobile-workspace-expander {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
    .classroom-container {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }
    .classroom-sidebar {
        height: 520px;
        position: static;
    }
}

@media (max-width: 768px) {
    .secondary-workspace-card {
        display: none;
    }
    .secondary-workspace-card.mobile-open {
        display: flex !important;
    }
    .mobile-workspace-expander {
        display: flex;
    }
    .stage-mode-bar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .teacher-floating-dock {
        flex-wrap: wrap;
        justify-content: center;
    }
    .classroom-header {
        padding: 0 12px;
    }
}