* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #0A0F1E; color: #fff; font-family: monospace; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* Header */
header { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: #111827; border-bottom: 1px solid #1e2d45; flex-shrink: 0; }
.logo { color: #FF9500; font-weight: bold; font-size: 16px; }
.session-id { color: #94a3b8; font-size: 12px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.dot.live { background: #22c55e; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.timer { background: #1e2d45; padding: 4px 12px; border-radius: 20px; font-size: 13px; color: #FF9500; font-weight: bold; }
.timer.warning { color: #ef4444; background: #ef444420; }

/* Layout */
.workspace { display: flex; flex: 1; overflow: hidden; }
.left-panel { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

/* Videos */
.videos { display: flex; flex: 1; gap: 8px; padding: 10px 10px 5px 10px; overflow: hidden; }
.video-box { flex: 1; background: #111827; border-radius: 10px; border: 1px solid #1e2d45; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.video-box video { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.video-label { position: absolute; bottom: 8px; left: 10px; background: rgba(0,0,0,0.65); padding: 3px 10px; border-radius: 6px; font-size: 11px; color: #94a3b8; }
.switch-btn { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); border: 1px solid #1e2d45; color: #94a3b8; border-radius: 6px; padding: 4px 8px; font-size: 10px; cursor: pointer; font-family: monospace; }
.switch-btn:hover { border-color: #FF9500; color: #FF9500; }

/* Coaching terminal */
.coaching-terminal { height: 160px; flex-shrink: 0; background: #050a10; border-top: 2px solid #FF950040; display: flex; flex-direction: column; }
.terminal-header { padding: 6px 14px; font-size: 11px; color: #FF9500; background: #0d1424; border-bottom: 1px solid #1e2d45; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.terminal-body { flex: 1; overflow-y: auto; padding: 10px 14px; font-size: 12px; line-height: 1.7; color: #94a3b8; }
.terminal-body::-webkit-scrollbar { width: 4px; }
.terminal-body::-webkit-scrollbar-thumb { background: #1e2d45; border-radius: 2px; }
.t-entry { margin-bottom: 6px; border-bottom: 1px solid #0d1424; padding-bottom: 6px; }
.t-entry .t-time { color: #475569; font-size: 10px; }
.t-entry .t-content { color: #e2e8f0; }
.t-entry .t-section { color: #FF9500; font-size: 10px; text-transform: uppercase; margin-top: 3px; }

/* Right panel */
.right-panel { width: 300px; display: flex; flex-direction: column; border-left: 1px solid #1e2d45; background: #0d1424; flex-shrink: 0; }
.ai-section { display: flex; flex-direction: column; overflow: hidden; border-bottom: 1px solid #1e2d45; }
.transcript-section { flex: 0 0 45%; }
.cards-section { flex: 1; }
.ai-header { padding: 8px 14px; font-size: 11px; color: #FF9500; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #1e2d45; background: #111827; flex-shrink: 0; }
.transcript-box { overflow-y: auto; padding: 8px 12px; font-size: 12px; line-height: 1.6; height: 100%; }
.t-line { margin-bottom: 6px; }
.t-line .spk { color: #FF9500; font-size: 10px; }
.t-line .txt { color: #e2e8f0; }
.cards-box { overflow-y: auto; padding: 8px 10px; flex: 1; }
.topic-card { background: #111827; border: 1px solid #1e2d45; border-radius: 8px; padding: 10px 12px; margin-bottom: 7px; font-size: 12px; line-height: 1.5; position: relative; }
.topic-card .card-label { color: #FF9500; font-size: 10px; text-transform: uppercase; margin-bottom: 4px; }
.topic-card .card-text { color: #e2e8f0; }
.topic-card .dismiss { position: absolute; top: 6px; right: 8px; background: none; border: none; color: #475569; cursor: pointer; font-size: 14px; padding: 0; line-height: 1; }
.topic-card .dismiss:hover { color: #ef4444; }

/* Controls */
.controls { padding: 10px; background: #111827; border-top: 1px solid #1e2d45; display: flex; gap: 6px; flex-shrink: 0; }
.btn { flex: 1; padding: 9px 4px; border-radius: 8px; border: none; cursor: pointer; font-family: monospace; font-size: 11px; font-weight: bold; }
.btn-red { background: #ef4444; color: #fff; }
.btn-orange { background: #FF9500; color: #000; }
.btn-gray { background: #1e2d45; color: #94a3b8; }

/* Join screen */
.join-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 20px; }
.join-card { background: #111827; border: 1px solid #1e2d45; border-radius: 16px; padding: 40px; max-width: 400px; width: 90%; text-align: center; }
.join-card h2 { color: #FF9500; margin-bottom: 8px; font-size: 22px; }
.join-card p { color: #94a3b8; font-size: 13px; margin-bottom: 24px; line-height: 1.6; }
input.code-input { width: 100%; background: #0A0F1E; border: 1px solid #1e2d45; border-radius: 8px; padding: 14px; color: #fff; font-family: monospace; font-size: 22px; text-align: center; letter-spacing: 6px; outline: none; margin-bottom: 16px; text-transform: uppercase; }
input.code-input:focus { border-color: #FF9500; }
.hidden { display: none !important; }

/* Student mode */
.student-mode .controls { display: none; }
.student-mode .switch-btn { display: none; }
.student-mode .coaching-terminal { display: none; }
.student-mode #timer { display: none; }

/* Go live button (student only) */
.go-live-btn { display: block; background: #22c55e; color: #000; border: none; border-radius: 20px; padding: 6px 16px; font-size: 12px; font-weight: bold; font-family: monospace; cursor: pointer; }
.student-mode .go-live-btn { display: block; }

/* Mobile */
@media (max-width: 768px) {
  .workspace { flex-direction: column; }
  .left-panel { flex: none; height: 45vh; }
  .videos { flex-direction: row; }
  .coaching-terminal { height: 70px; }
  .teacher-controls, .controls { position: static !important; background: transparent; border: none; padding: 4px 6px; gap: 4px; flex-shrink: 0; width: 100%; }
  .teacher-controls .btn, .controls .btn { padding: 5px 4px; font-size: 10px; border-radius: 6px; }
  .right-panel { width: 100%; border-left: none; border-top: 1px solid #1e2d45; display: flex; flex-direction: row; flex: 1; overflow: hidden; }
  .ai-section.transcript-section { display: flex; flex: 0 0 45%; border-bottom: none; border-right: 1px solid #1e2d45; }
  .transcript-box { font-size: 11px; padding: 6px 8px; }
  .ai-section.cards-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .ai-section.cards-section .ai-header { display: none; }
  .cards-box { padding: 4px 6px; overflow-y: auto; flex: 1; }
  .topic-card { margin-bottom: 4px; padding: 5px 8px; }
  .topic-card .card-label { font-size: 9px; margin-bottom: 2px; }
  .topic-card .card-text { display: block; font-size: 11px; white-space: normal; line-height: 1.5; overflow: visible; }
  .topic-card .dismiss { top: 3px; right: 5px; font-size: 12px; }
}
