/* ==========================================================================
   KNOCK-OUT ENGLISH TS10 • STYLESHEET
   Kế thừa kiến trúc EdTech Hub Thầy Võ Ngọc Tùng
   ========================================================================== */

:root {
  --bg-main: #070d1e;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.5);
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-glow: 0 10px 30px -10px rgba(56, 189, 248, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 13, 30, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
}
.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-glow);
}
.brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-title span {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 6px 14px;
  border-radius: 30px;
  font-family: 'Space Grotesk', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.btn-header {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-grade {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}
.btn-grade:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}
.btn-print {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
  color: var(--text-muted);
}
.btn-print:hover {
  color: #fff;
  border-color: var(--accent-cyan);
}

/* Exam Selector Bar */
.exam-nav-bar {
  background: rgba(11, 19, 41, 0.6);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  overflow-x: auto;
  white-space: nowrap;
}
.exam-nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}
.exam-pill-btn {
  padding: 7px 18px;
  border-radius: 30px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}
.exam-pill-btn:hover {
  color: #fff;
  border-color: var(--accent-cyan);
}
.exam-pill-btn.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

/* Main Workspace Layout */
.main-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  flex: 1;
  width: 100%;
}

/* Exam Meta Banner */
.exam-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
}
.exam-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.banner-tag {
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
}
.exam-banner-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.exam-banner-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Section Header */
.section-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* Question Cards */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
  transition: all 0.25s;
}
.question-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
}
.q-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.q-number-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.q-section-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}
.q-content {
  font-size: 1.02rem;
  line-height: 1.6;
  margin-bottom: 16px;
  color: #ffffff;
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.opt-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}
.opt-label:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-cyan);
}
.opt-label.selected {
  background: rgba(37, 99, 235, 0.25);
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}
.opt-radio {
  display: none;
}
.opt-key {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.opt-label.selected .opt-key {
  background: var(--accent-cyan);
  color: #070d1e;
}
.opt-text {
  font-size: 0.95rem;
}

/* Split Reading Studio */
.split-reading-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: rgba(11, 19, 41, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}
.reading-passage-panel {
  max-height: 480px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #e2e8f0;
}
.reading-questions-panel {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

/* 5-Step Pedagogical Accordion */
.pedagogy-box {
  margin-top: 18px;
  background: rgba(11, 19, 41, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: none;
}
.pedagogy-box.show {
  display: block;
  animation: fadeIn 0.3s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ped-step {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
  line-height: 1.55;
}
.ped-step:last-child {
  border-bottom: none;
}
.ped-step-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ped-step.step1 .ped-step-title { color: #34d399; }
.ped-step.step2 .ped-step-title { color: #38bdf8; }
.ped-step.step3 .ped-step-title { color: #818cf8; }
.ped-step.step4 .ped-step-title { color: #f87171; }
.ped-step.step5 .ped-step-title { color: #fbbf24; }

/* Question Palette (Sticky Sidebar) */
.palette-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.palette-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.palette-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.palette-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}
.palette-progress-text {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 700;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}
.palette-btn {
  aspect-ratio: 1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}
.palette-btn:hover {
  border-color: var(--accent-cyan);
  color: #fff;
}
.palette-btn.done {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--accent-emerald);
  color: #34d399;
}
.palette-btn.current {
  box-shadow: 0 0 0 2px var(--accent-cyan);
}

/* Grader Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.modal-score-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}
.score-number {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.score-scale {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .palette-sidebar {
    position: static;
    height: auto;
  }
  .split-reading-container {
    grid-template-columns: 1fr;
  }
}

@media print {
  .app-header, .exam-nav-bar, .palette-sidebar, .btn-header, .btn-reveal {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .question-card, .reading-passage-panel {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
  }
  .pedagogy-box {
    display: block !important;
    border: 1px solid #ccc !important;
  }
}


/* Grammar Formula Box - Chuẩn GV Chuyên Anh */
.formula-box {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin: 6px 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #38bdf8;
  display: inline-block;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}


/* Underline Highlight Cho Phần Ngữ Âm */
u, .pron-underline {
  text-decoration: underline 2.5px var(--accent-cyan) !important;
  text-underline-offset: 4px !important;
  font-weight: 800 !important;
  color: var(--accent-cyan) !important;
}
.opt-label.selected u {
  text-decoration-color: #0b1120 !important;
  color: #0b1120 !important;
}
