/* ============================================================
   ICDL Word Practice — JARVIS Holographic Theme
   style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;900&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #020b16;
  --bg2:        #040f1e;
  --primary:    #00eaff;
  --secondary:  #14ffec;
  --accent:     #ff005d;
  --warn:       #ffcc00;
  --text:       #d6f1ff;
  --text-dim:   rgba(214, 241, 255, 0.45);
  --glass-bg:   rgba(0, 234, 255, 0.04);
  --glass-bdr:  rgba(0, 234, 255, 0.28);
  --glow-sm:    0 0 12px rgba(0, 234, 255, 0.4);
  --glow-md:    0 0 25px rgba(0, 234, 255, 0.55);
  --glow-lg:    0 0 50px rgba(0, 234, 255, 0.35);
  --font:       'Orbitron', 'Courier New', monospace;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Holographic Grid Background ───────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,234,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,234,255,0.055) 1px, transparent 1px);
  background-size: 52px 52px;
  animation: gridDrift 25s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Diagonal accent lines */
body::after {
  content: '';
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 120px,
    rgba(0,234,255,0.018) 120px,
    rgba(0,234,255,0.018) 121px
  );
  animation: diagDrift 18s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Central ambient glow */
.bg-glow {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse at center,
    rgba(0,234,255,0.06) 0%,
    rgba(0,234,255,0.02) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
}

@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 52px 52px; }
}
@keyframes diagDrift {
  from { transform: translate(0,0); }
  to   { transform: translate(60px,60px); }
}

/* ── Scan-line ──────────────────────────────────────────────── */
.scan-line {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  opacity: 0.45;
  animation: scan 6s linear infinite;
  pointer-events: none;
  z-index: 500;
}
@keyframes scan {
  0%   { top: -5px; }
  100% { top: 100vh; }
}

/* ── Top Navigation ─────────────────────────────────────────── */
#top-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(2, 11, 22, 0.88);
  border-bottom: 1px solid rgba(0,234,255,0.15);
  backdrop-filter: blur(12px);
  z-index: 400;
}
.nav-brand {
  font-size: 0.6rem;
  letter-spacing: 0.45em;
  color: rgba(0,234,255,0.6);
  text-transform: uppercase;
  margin-left: auto;
}
.btn-back {
  background: transparent;
  border: 1px solid rgba(0,234,255,0.35);
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  transition: all 0.25s;
}
.btn-back:hover {
  background: rgba(0,234,255,0.08);
  box-shadow: var(--glow-sm);
  border-color: var(--primary);
}

/* ── Screens ─────────────────────────────────────────────────── */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  animation: screenIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.screen.has-nav { padding-top: 72px; }
.screen.hidden  { display: none; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Glass Panel ─────────────────────────────────────────────── */
.glass-panel {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-bdr);
  border-radius: 6px;
  backdrop-filter: blur(14px);
  box-shadow: var(--glow-md), inset 0 0 40px rgba(0,234,255,0.025);
  padding: 38px 36px;
  max-width: 820px;
  width: 100%;
}

/* Corner bracket decorators */
.glass-panel::before,
.glass-panel::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
}
.glass-panel::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--primary);
  border-left: 2px solid var(--primary);
}
.glass-panel::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--primary);
  border-right: 2px solid var(--primary);
}

/* ── HUD Corner Element ──────────────────────────────────────── */
.hud-corner {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 78px; height: 78px;
  pointer-events: none;
  z-index: 300;
}
.hud-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border-style: solid;
}
.hud-ring:nth-child(1) {
  width: 78px; height: 78px;
  border-width: 1.5px;
  border-color: var(--primary) transparent transparent var(--primary);
  animation: spin 3.2s linear infinite;
  box-shadow: 0 0 8px var(--primary);
}
.hud-ring:nth-child(2) {
  width: 56px; height: 56px;
  border-width: 1px;
  border-color: transparent var(--secondary) var(--secondary) transparent;
  animation: spin 2s linear infinite reverse;
  box-shadow: 0 0 6px var(--secondary);
}
.hud-ring:nth-child(3) {
  width: 36px; height: 36px;
  border-width: 1px;
  border-style: dashed;
  border-color: var(--accent);
  animation: spin 1.4s linear infinite;
  box-shadow: 0 0 5px var(--accent);
}
.hud-dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 7px; height: 7px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--primary);
  animation: dotPulse 1.8s ease-in-out infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes dotPulse {
  0%,100% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  50%      { opacity: 0.25; transform: translate(-50%,-50%) scale(0.4); }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-hud {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 12px auto;
  padding: 17px 38px;
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: all 0.28s ease;
  box-shadow: 0 0 14px rgba(0,234,255,0.25), inset 0 0 14px rgba(0,234,255,0.04);
  text-align: center;
}
.btn-hud::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,234,255,0.18), transparent);
  transition: 0.55s;
}
.btn-hud:hover {
  background: rgba(0,234,255,0.09);
  box-shadow: 0 0 28px rgba(0,234,255,0.55), inset 0 0 22px rgba(0,234,255,0.08);
  transform: scale(1.025);
  color: #fff;
}
.btn-hud:hover::after { left: 120%; }
.btn-hud:active { transform: scale(0.975); }

.btn-hud.secondary {
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow: 0 0 14px rgba(20,255,236,0.22);
}
.btn-hud.secondary:hover {
  background: rgba(20,255,236,0.09);
  box-shadow: 0 0 28px rgba(20,255,236,0.5);
  color: #fff;
}

.btn-hud.accent {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(255,0,93,0.25);
}
.btn-hud.accent:hover {
  background: rgba(255,0,93,0.09);
  box-shadow: 0 0 28px rgba(255,0,93,0.55);
  color: #fff;
}

/* ── HOME SCREEN ─────────────────────────────────────────────── */
.home-logo {
  width: 130px; height: 130px;
  margin: 0 auto 28px;
  position: relative;
}
.home-logo .hud-ring:nth-child(1) { width: 130px; height: 130px; }
.home-logo .hud-ring:nth-child(2) { width: 96px;  height: 96px;  }
.home-logo .hud-ring:nth-child(3) { width: 62px;  height: 62px;  }

.hud-header { text-align: center; margin-bottom: 36px; }

.hud-title {
  font-size: 2.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--primary);
  text-shadow: 0 0 28px var(--primary), 0 0 60px rgba(0,234,255,0.5);
  animation: titlePulse 3.5s ease-in-out infinite;
  min-height: 1.2em;
}
.hud-subtitle {
  font-size: 0.72rem;
  letter-spacing: 0.45em;
  color: var(--secondary);
  margin-top: 10px;
  opacity: 0.75;
}
@keyframes titlePulse {
  0%,100% { text-shadow: 0 0 28px var(--primary), 0 0 60px rgba(0,234,255,0.4); }
  50%      { text-shadow: 0 0 50px var(--primary), 0 0 110px rgba(0,234,255,0.7), 0 0 160px rgba(0,234,255,0.25); }
}

.mode-description {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-align: center;
  margin: -6px 0 8px;
  text-transform: uppercase;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: rgba(0,234,255,0.38);
  margin-top: 28px;
  text-transform: uppercase;
}
.status-dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--secondary);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  animation: dotPulse 2.2s ease-in-out infinite;
}

.last-score-badge {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--secondary);
  border: 1px solid rgba(20,255,236,0.28);
  padding: 6px 16px;
  border-radius: 20px;
  margin: 18px auto 4px;
  text-transform: uppercase;
}

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-bar-wrap {
  width: 100%;
  max-width: 820px;
  height: 3px;
  background: rgba(0,234,255,0.08);
  border-radius: 2px;
  margin-bottom: 24px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 0.55s ease;
  box-shadow: 0 0 10px var(--primary);
  width: 0%;
}

/* ── Practice: Score Counter ─────────────────────────────────── */
.practice-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.q-number {
  font-size: 0.62rem;
  letter-spacing: 0.38em;
  color: var(--secondary);
  text-transform: uppercase;
}
.practice-score-badge {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--primary);
  border: 1px solid rgba(0,234,255,0.22);
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
}

/* ── Question Text ───────────────────────────────────────────── */
.question-text {
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 28px;
}

/* ── Options Grid ────────────────────────────────────────────── */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .options-grid { grid-template-columns: 1fr; }
}

.option-btn {
  background: rgba(0,234,255,0.025);
  border: 1px solid rgba(0,234,255,0.22);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.76rem;
  line-height: 1.55;
  padding: 16px 18px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}
.option-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.25s ease;
  transform-origin: top;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(0,234,255,0.07);
  box-shadow: 0 0 14px rgba(0,234,255,0.28);
  transform: translateX(4px);
  color: #fff;
}
.option-btn:hover:not(:disabled)::before { transform: scaleY(1); }
.option-btn:disabled { cursor: default; }

/* Answer states */
.option-btn.correct {
  background: rgba(0,255,100,0.12) !important;
  border-color: #00ff64 !important;
  color: #00ff64 !important;
  box-shadow: 0 0 22px rgba(0,255,100,0.45) !important;
  animation: correctPop 0.45s ease;
}
.option-btn.wrong {
  background: rgba(255,0,93,0.12) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  box-shadow: 0 0 22px rgba(255,0,93,0.45) !important;
  animation: wrongShake 0.45s ease;
}
.option-btn.selected-exam {
  border-color: var(--primary) !important;
  background: rgba(0,234,255,0.1) !important;
  color: var(--primary) !important;
  box-shadow: 0 0 16px rgba(0,234,255,0.35) !important;
}

@keyframes correctPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.03); box-shadow: 0 0 45px rgba(0,255,100,0.8) !important; }
  100% { transform: scale(1); }
}
@keyframes wrongShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  60%     { transform: translateX(6px); }
}

/* ── Feedback Message ────────────────────────────────────────── */
.feedback-msg {
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  padding: 10px 16px;
  margin: 18px 0 0;
  border-radius: 4px;
  display: none;
  text-transform: uppercase;
}
.feedback-msg.correct {
  display: block;
  color: #00ff64;
  background: rgba(0,255,100,0.08);
  border: 1px solid rgba(0,255,100,0.3);
}
.feedback-msg.wrong {
  display: block;
  color: var(--accent);
  background: rgba(255,0,93,0.08);
  border: 1px solid rgba(255,0,93,0.3);
}

/* ── EXAM: Header ─────────────────────────────────────────────── */
.exam-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 820px;
  margin-bottom: 22px;
  gap: 20px;
}

/* ── Timer HUD ────────────────────────────────────────────────── */
.timer-hud {
  position: relative;
  width: 96px; height: 96px;
  flex-shrink: 0;
}
.timer-svg {
  width: 96px; height: 96px;
  transform: rotate(-90deg);
}
.timer-ring-bg {
  fill: none;
  stroke: rgba(0,234,255,0.08);
  stroke-width: 4;
}
.timer-ring {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.6s ease;
  filter: drop-shadow(0 0 7px var(--primary));
}
.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  transition: color 0.6s ease;
}

.exam-meta {
  text-align: right;
  flex: 1;
}
.exam-meta-row {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.exam-meta-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}
.exam-answered {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: rgba(20,255,236,0.55);
  text-transform: uppercase;
  margin-top: 6px;
}

/* Exam nav buttons row */
.exam-nav-row {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 820px;
  margin-top: 20px;
}
.exam-nav-row .btn-hud {
  margin: 0;
  flex: 1;
}

/* ── RESULTS SCREEN ──────────────────────────────────────────── */
.result-header {
  font-size: 0.65rem;
  letter-spacing: 0.42em;
  color: var(--secondary);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 30px;
}
.score-display {
  text-align: center;
  margin: 10px 0 28px;
}
.score-value {
  font-size: 4.8rem;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 45px var(--primary);
  animation: titlePulse 2.2s ease-in-out infinite;
  line-height: 1;
}
.score-pct {
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  color: var(--secondary);
  margin-top: 6px;
}
.score-msg {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--text);
  margin-top: 14px;
  text-transform: uppercase;
}
.score-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(0,234,255,0.08);
  border-radius: 4px;
  margin: 24px 0 30px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  box-shadow: 0 0 14px var(--primary);
  width: 0%;
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hud-title   { font-size: 1.7rem; letter-spacing: 0.18em; }
  .glass-panel { padding: 24px 18px; }
  .exam-header { flex-direction: column; align-items: center; }
  .exam-meta   { text-align: center; }
  .score-value { font-size: 3.2rem; }
  .hud-corner  { bottom: 14px; right: 14px; width: 60px; height: 60px; }
  .hud-corner .hud-ring:nth-child(1) { width: 60px; height: 60px; }
  .hud-corner .hud-ring:nth-child(2) { width: 43px; height: 43px; }
  .hud-corner .hud-ring:nth-child(3) { width: 28px; height: 28px; }
}
@media (max-width: 480px) {
  .hud-title    { font-size: 1.2rem; }
  .question-text{ font-size: 0.88rem; }
  .option-btn   { font-size: 0.7rem; padding: 13px 14px; }
  .timer-hud    { width: 80px; height: 80px; }
  .timer-svg    { width: 80px; height: 80px; }
  .exam-meta-value { font-size: 1.3rem; }
}
