/* ===== CSS VARIABLES & RESET ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-tertiary: #1a1a25;
  --bg-card: #13131f;
  --cyan: #00f0ff;
  --cyan-dim: #00a8b3;
  --magenta: #ff00aa;
  --magenta-dim: #aa0077;
  --purple: #8b5cf6;
  --purple-dim: #6d28d9;
  --green: #00ff88;
  --green-dim: #00b35e;
  --yellow: #ffd700;
  --orange: #ff6b35;
  --red: #ff3355;
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-dim: #6a6a80;
  --border-color: rgba(0, 240, 255, 0.15);
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.3);
  --glow-magenta: 0 0 20px rgba(255, 0, 170, 0.3);
  --glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Rajdhani', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ===== ANIMATED BACKGROUND ===== */
.bg-grid {
  position: fixed; top:0; left:0; width:100%; height:100%;
  background-image:
    linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 0;
  pointer-events: none;
}
.bg-glow {
  position: fixed; width: 600px; height: 600px; border-radius: 50%;
  filter: blur(150px); opacity: 0.08; pointer-events: none; z-index: 0;
}
.bg-glow-1 { top: -200px; right: -200px; background: var(--cyan); }
.bg-glow-2 { bottom: -200px; left: -200px; background: var(--magenta); }
.bg-glow-3 { top: 50%; left: 50%; transform: translate(-50%,-50%); background: var(--purple); opacity: 0.04; }

/* ===== HEADER ===== */
.header {
  position: sticky; top:0; z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 30px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.brand-text h1 {
  font-family: 'Orbitron', monospace;
  font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}
.brand-text p {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 3px; text-transform: uppercase;
}

.barry-avatar {
  height: 62px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.25));
  transition: all 0.3s;
}
.barry-avatar:hover {
  filter: drop-shadow(0 0 18px rgba(0, 240, 255, 0.5));
  transform: scale(1.05);
}
.header-nav { display: flex; gap: 6px; }
.nav-btn {
  font-family: 'Rajdhani', sans-serif;
  padding: 8px 14px; border: 1px solid var(--border-color);
  background: transparent; color: var(--text-secondary);
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  cursor: pointer; transition: all 0.3s; border-radius: 4px;
  text-transform: uppercase;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.15;
}
.nav-btn:hover, .nav-btn.active {
  border-color: var(--cyan); color: var(--cyan);
  box-shadow: var(--glow-cyan); background: rgba(0,240,255,0.05);
}

/* ===== CYBERPUNK HEADER ENHANCEMENTS ===== */
.header {
  position: sticky; top:0; z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  border-bottom: none;
  padding: 12px 30px;
  display: flex; align-items: center; justify-content: space-between;
  overflow: visible;
}
.header::before {
  content: '';
  position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), var(--cyan), transparent);
  animation: headerBorderFlow 4s linear infinite;
}
.header::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 240, 255, 0.015) 2px,
    rgba(0, 240, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: -1;
}
@keyframes headerBorderFlow {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Glitch effect on brand title */
.brand-text h1 {
  position: relative;
  font-family: 'Orbitron', monospace;
  font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
  animation: brandGlitch 8s infinite;
}
.brand-text h1::before,
.brand-text h1::after {
  content: 'BARRY ECONOMICS';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  font-family: 'Orbitron', monospace;
  font-size: 18px; font-weight: 700;
  letter-spacing: 2px;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  pointer-events: none;
}
.brand-text h1::before {
  background: linear-gradient(135deg, var(--cyan), #00ccff);
  -webkit-background-clip: text;
  left: 2px;
  clip-path: inset(0 0 0 0);
  animation: glitchLeft 6s infinite linear alternate-reverse;
}
.brand-text h1::after {
  background: linear-gradient(135deg, var(--magenta), #ff44cc);
  -webkit-background-clip: text;
  left: -2px;
  clip-path: inset(0 0 0 0);
  animation: glitchRight 6s infinite linear alternate-reverse;
}
@keyframes glitchLeft {
  0%, 92% { clip-path: inset(0 100% 0 0); }
  93% { clip-path: inset(20% 0 60% 0); left: 2px; }
  94% { clip-path: inset(50% 0 10% 0); left: -1px; }
  95% { clip-path: inset(0 0 80% 0); left: 1px; }
  96%, 100% { clip-path: inset(0 100% 0 0); }
}
@keyframes glitchRight {
  0%, 90% { clip-path: inset(0 100% 0 0); }
  91% { clip-path: inset(60% 0 10% 0); left: -2px; }
  92% { clip-path: inset(10% 0 50% 0); left: 1px; }
  93% { clip-path: inset(70% 0 0 0); left: -1px; }
  94%, 100% { clip-path: inset(0 100% 0 0); }
}
@keyframes brandGlitch {
  0%, 90% { opacity: 1; }
  91% { opacity: 0.85; transform: skewX(-0.5deg); }
  92% { opacity: 1; transform: skewX(0); }
  93% { opacity: 0.9; transform: skewX(0.3deg); }
  94%, 100% { opacity: 1; transform: skewX(0); }
}

/* Cyberpunk corner decorations */
.header-cyber-corner {
  position: absolute;
  width: 16px; height: 16px;
  z-index: 2;
  pointer-events: none;
}
.header-cyber-corner--tl { top: 0; left: 0; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.header-cyber-corner--tr { top: 0; right: 0; border-top: 2px solid var(--magenta); border-right: 2px solid var(--magenta); }
.header-cyber-corner--bl { bottom: 0; left: 0; border-bottom: 2px solid var(--magenta); border-left: 2px solid var(--magenta); }
.header-cyber-corner--br { bottom: 0; right: 0; border-bottom: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }

/* Cyberpunk data stream decoration */
.header-data-stream {
  position: absolute; top: 0; right: 160px;
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  color: var(--cyan);
  opacity: 0.2;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
  animation: dataStreamFade 3s ease-in-out infinite;
}
.header-data-stream-2 {
  position: absolute; top: 0; left: 310px;
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  color: var(--magenta);
  opacity: 0.15;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
  animation: dataStreamFade 4s ease-in-out infinite 1s;
}
@keyframes dataStreamFade {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.3; }
}

/* Hexagon pattern overlay */
.header-hex-pattern {
  position: absolute;
  top: 50%; right: 200px;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.12;
}
.header-hex-pattern svg { width: 100%; height: 100%; }

/* Pulse dot indicators - hidden */
.header-pulse-dot {
  display: none;
}

/* Header layout: left nav + right auth */
.header-left {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;
}
.header-main-nav {
  display: flex; gap: 8px; align-items: center;
  margin-left: 10px;
  z-index: 10;
  position: relative;
  min-width: 0;
  flex: 1;
}
.header-auth-nav {
  display: flex; gap: 8px; align-items: center;
  z-index: 10;
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

/* ===== DROPDOWN MENU ===== */
@keyframes cyberBorderShift {
  0%   { border-color: #00f0ff; box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.15), 0 0 8px rgba(0, 240, 255, 0.25); }
  33%  { border-color: #8b5cf6; box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.15), 0 0 8px rgba(139, 92, 246, 0.25); }
  66%  { border-color: #ff00aa; box-shadow: inset 0 0 10px rgba(255, 0, 170, 0.15), 0 0 8px rgba(255, 0, 170, 0.25); }
  100% { border-color: #00f0ff; box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.15), 0 0 8px rgba(0, 240, 255, 0.25); }
}
.nav-dropdown {
  position: relative;
}
.nav-dropdown > .nav-btn {
  z-index: 10;
  padding-inline: 16px;
}

.nav-btn--membership {
  min-width: 138px;
  padding: 7px 12px 8px;
  flex-direction: column;
  gap: 2px;
  border-color: rgba(255, 0, 170, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 0, 170, 0.08), rgba(139, 92, 246, 0.08)),
    rgba(19, 19, 31, 0.88);
  box-shadow:
    inset 0 0 18px rgba(255, 0, 170, 0.06),
    0 0 0 1px rgba(255, 0, 170, 0.05);
}
.nav-btn--membership .nav-btn__cn {
  font-size: 10px;
  letter-spacing: 2px;
  color: #ffd5ef;
}
.nav-btn--membership .nav-btn__en {
  font-size: 11px;
  letter-spacing: 2.3px;
  color: #ff7ccc;
}
.nav-btn--membership:hover,
.nav-btn--membership.active {
  border-color: rgba(255, 0, 170, 0.72);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 0, 170, 0.12), rgba(139, 92, 246, 0.14)),
    rgba(19, 19, 31, 0.96);
  box-shadow:
    0 0 24px rgba(255, 0, 170, 0.18),
    0 0 36px rgba(139, 92, 246, 0.12);
}
.nav-btn--membership:hover .nav-btn__cn,
.nav-btn--membership:hover .nav-btn__en,
.nav-btn--membership.active .nav-btn__cn,
.nav-btn--membership.active .nav-btn__en {
  color: #fff;
}

.header-user-display {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cyan);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  align-self: center;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 300px;
  background: rgba(10, 10, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px;
  margin-top: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  backdrop-filter: blur(24px);
}
.nav-dropdown:hover > .dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dropdown-item {
  display: block;
  padding: 10px 16px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}
.dropdown-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
  border-color: #00f0ff;
  animation: cyberBorderShift 2.5s linear infinite;
}
.dropdown-item.coming-soon {
  cursor: default;
  opacity: 0.4;
}
.dropdown-item.coming-soon:hover {
  background: none;
  color: rgba(255, 255, 255, 0.55);
  border-color: transparent;
  animation: none;
  box-shadow: none;
}
.soon-tag {
  display: inline-block;
  font-size: 8px;
  background: rgba(139, 92, 246, 0.15);
  color: rgba(139, 92, 246, 0.7);
  padding: 2px 6px;
  border-radius: 2px;
  margin-left: 8px;
  letter-spacing: 1px;
  vertical-align: middle;
  text-transform: uppercase;
}
.has-submenu {
  position: relative;
}
.submenu-arrow {
  float: right;
  color: rgba(255, 255, 255, 0.15);
  font-size: 14px;
  line-height: 1;
  transition: color 0.2s;
}
.has-submenu:hover > .submenu-arrow {
  color: rgba(255, 255, 255, 0.5);
}
.dropdown-submenu {
  display: none;
  position: absolute;
  right: calc(100% + 6px);
  top: -8px;
  min-width: 130px;
  background: rgba(10, 10, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(24px);
  z-index: 1001;
}
.has-submenu:hover > .dropdown-submenu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Nav button cyber enhancement */
.nav-btn {
  position: relative;
  overflow: hidden;
}
.nav-btn::before {
  content: '';
  position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.08), transparent);
  transition: left 0.5s;
}
.nav-btn:hover::before {
  left: 100%;
}

/* Status indicator bar */
.header-status-bar {
  display: none;
}
.header-status-bar span {
  width: 20px; height: 2px;
  background: var(--cyan);
  opacity: 0.3;
  animation: statusPulse 2s ease-in-out infinite;
}
.header-status-bar span:nth-child(2) { animation-delay: 0.2s; background: var(--magenta); }
.header-status-bar span:nth-child(3) { animation-delay: 0.4s; }
.header-status-bar span:nth-child(4) { animation-delay: 0.6s; background: var(--magenta); }
.header-status-bar span:nth-child(5) { animation-delay: 0.8s; }
@keyframes statusPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

/* ===== SCORE DETAIL TABLE ===== */
.score-detail-table {
  width: 100%; max-width: 500px; margin: 18px auto 0;
  border-collapse: collapse;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
}
.score-detail-table th {
  padding: 6px 12px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
.score-detail-table td {
  padding: 5px 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0,240,255,0.06);
}
.score-detail-table tr:last-child td {
  border-bottom: none;
}
.score-detail-table .row-kaa td:first-child { color: var(--purple); }
.score-detail-table .row-eval td:first-child { color: var(--magenta); }
.score-detail-table .row-other td:first-child { color: var(--cyan); }
.score-detail-table .row-total td {
  border-top: 1px solid var(--border-color);
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 8px;
}
.para-excellent-note {
  font-size: 13px; color: var(--green); opacity: 0.9;
  line-height: 1.7; padding: 12px;
  background: rgba(0,255,136,0.04); border-radius: 6px;
  border-left: 3px solid var(--green-dim);
}

/* ===== MAIN LAYOUT ===== */
.main-container {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  min-height: calc(100vh - 77px);
  gap: 0;
}

/* ===== LEFT PANEL - EXAM TIPS ===== */
.left-panel {
  background: rgba(13,13,22,0.95);
  border-right: 1px solid var(--border-color);
  overflow-y: auto; padding: 20px 16px;
  max-height: calc(100vh - 77px);
}
.panel-title {
  font-family: 'Orbitron', monospace;
  font-size: 12px; font-weight: 600;
  color: var(--cyan); letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px; padding: 14px;
  margin-bottom: 12px;
  transition: all 0.3s;
}
.tip-card:hover {
  border-color: var(--cyan-dim);
  box-shadow: inset 0 0 30px rgba(0,240,255,0.03);
}
.tip-card h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--cyan); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.tip-card h3 .icon { font-size: 16px; }
.tip-card p, .tip-card li {
  font-size: 12.5px; color: var(--text-secondary);
  line-height: 1.65;
}
.tip-card ul { list-style: none; padding: 0; }
.tip-card li { padding: 3px 0; padding-left: 14px; position: relative; }
.tip-card li::before {
  content: '▸'; position: absolute; left: 0;
  color: var(--cyan-dim); font-size: 10px;
}
.level-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 3px; font-size: 11px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700; margin-right: 4px;
}
.level-1 { background: rgba(255,51,85,0.15); color: var(--red); border: 1px solid rgba(255,51,85,0.3); }
.level-2 { background: rgba(255,107,53,0.15); color: var(--orange); border: 1px solid rgba(255,107,53,0.3); }
.level-3 { background: rgba(139,92,246,0.15); color: var(--purple); border: 1px solid rgba(139,92,246,0.3); }
.level-4 { background: rgba(0,255,136,0.15); color: var(--green); border: 1px solid rgba(0,255,136,0.3); }

/* ===== CENTER PANEL - ESSAY SCORER ===== */
.center-panel {
  padding: 24px 30px;
  overflow-y: auto;
  max-height: calc(100vh - 77px);
}
.scorer-header {
  text-align: center; margin-bottom: 28px;
}
.scorer-header h2 {
  font-family: 'Orbitron', monospace;
  font-size: 24px; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--magenta));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.scorer-header p {
  color: var(--text-dim); font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 1px;
}
/* Essay Type Selector */
.type-selector {
  display: flex; gap: 12px; justify-content: center; margin-bottom: 24px;
}
.type-btn {
  font-family: 'Rajdhani', sans-serif;
  padding: 10px 28px; border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.3s; border-radius: 6px; letter-spacing: 1px;
}
.type-btn:hover { border-color: var(--purple); color: var(--purple); }
.type-btn.active {
  border-color: var(--cyan); color: var(--cyan);
  background: rgba(0,240,255,0.08);
  box-shadow: var(--glow-cyan);
}
/* Question Display */
.question-display {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px; padding: 16px 20px;
  margin-bottom: 20px; min-height: 60px;
  display: none;
}
.question-display.show { display: block; }
.question-display label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px; color: var(--cyan-dim);
  text-transform: uppercase; letter-spacing: 2px;
}
.question-display p {
  font-size: 14px; color: var(--text-primary);
  line-height: 1.7; margin-top: 6px;
}
/* Text Area */
.essay-input-area {
  position: relative; margin-bottom: 20px;
}
.essay-textarea {
  width: 100%; min-height: 300px; padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px; color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px; line-height: 1.8;
  resize: vertical; outline: none;
  transition: border-color 0.3s;
}
.essay-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(0,240,255,0.08);
}
.essay-textarea::placeholder { color: var(--text-dim); }
.char-count {
  position: absolute; bottom: 12px; right: 16px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px; color: var(--text-dim);
}
/* Submit Button */
.submit-btn {
  display: block; width: 100%;
  padding: 14px; border: none;
  background: linear-gradient(135deg, var(--cyan-dim), var(--purple));
  color: #fff; font-family: 'Orbitron', monospace;
  font-size: 14px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  cursor: pointer; border-radius: 6px;
  transition: all 0.3s;
  position: relative; overflow: hidden;
}
.submit-btn:hover {
  box-shadow: 0 0 40px rgba(0,240,255,0.3);
  transform: translateY(-1px);
}
.submit-btn:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
}
.submit-btn .btn-loader {
  display: none; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESULTS SECTION ===== */
.results-section { display: none; margin-top: 30px; }
.results-section.show { display: block; }

.score-overview {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px; padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}
.total-score {
  font-family: 'Orbitron', monospace;
  font-size: 56px; font-weight: 900;
  margin: 10px 0;
}
.total-score .current { color: var(--cyan); }
.total-score .separator { color: var(--text-dim); font-size: 36px; }
.total-score .max { color: var(--text-dim); font-size: 36px; }
.score-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase;
}
.score-breakdown {
  display: flex; justify-content: center; gap: 40px;
  margin-top: 16px;
}
.score-item {
  text-align: center;
}
.score-item .val {
  font-family: 'Orbitron', monospace;
  font-size: 28px; font-weight: 700;
}
.score-item .lbl {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px; color: var(--text-dim);
  letter-spacing: 1px; text-transform: uppercase;
}
.kaa-score { color: var(--purple); }
.eval-score { color: var(--magenta); }

.level-indicator {
  display: inline-block; margin-top: 12px;
  padding: 4px 16px; border-radius: 4px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px; font-weight: 700;
  letter-spacing: 1px;
}

/* Paragraph Results */
.para-result {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px; padding: 20px;
  margin-bottom: 16px;
}
.para-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.para-header h4 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--cyan);
}
.para-scores {
  display: flex; gap: 12px;
}
.para-score-badge {
  padding: 3px 10px; border-radius: 4px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px; font-weight: 700;
}
.para-content {
  margin-bottom: 14px;
}
.para-content h5 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 6px;
}
.original-text {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.7; padding: 12px;
  background: rgba(0,0,0,0.3); border-radius: 6px;
  border-left: 3px solid var(--text-dim);
}
.feedback-text {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.7; padding: 12px;
  background: rgba(139,92,246,0.05); border-radius: 6px;
  border-left: 3px solid var(--purple);
}
.improved-text {
  font-size: 13px; color: var(--green); opacity: 0.9;
  line-height: 1.7; padding: 12px;
  background: rgba(0,255,136,0.04); border-radius: 6px;
  border-left: 3px solid var(--green-dim);
}

/* ===== RIGHT PANEL - QUESTION BANK ===== */
.right-panel {
  background: rgba(13,13,22,0.95);
  border-left: 1px solid var(--border-color);
  overflow-y: auto; padding: 16px;
  max-height: calc(100vh - 77px);
}
.unit-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; margin-bottom: 16px;
}
.unit-tab {
  font-family: 'Rajdhani', sans-serif;
  padding: 10px 8px; border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.3s; border-radius: 6px;
  text-align: center; letter-spacing: 1px;
  text-transform: uppercase;
}
.unit-tab:hover { border-color: var(--purple); color: var(--purple); }
.unit-tab.active {
  border-color: var(--magenta); color: var(--magenta);
  background: rgba(255,0,170,0.08);
  box-shadow: var(--glow-magenta);
}
.topic-section { display: none; }
.topic-section.show { display: block; }
.topic-group {
  margin-bottom: 14px;
}
.topic-header {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 700;
  color: var(--purple); padding: 8px 12px;
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 6px; cursor: pointer;
  transition: all 0.3s;
  display: flex; align-items: center; justify-content: space-between;
}
.topic-header:hover { background: rgba(139,92,246,0.15); }
.topic-header .arrow { transition: transform 0.3s; font-size: 10px; }
.topic-header.open .arrow { transform: rotate(90deg); }
.topic-questions {
  display: none; padding: 8px 4px;
}
.topic-questions.show { display: block; }
.q-item {
  padding: 8px 10px; margin: 4px 0;
  font-size: 11.5px; color: var(--text-secondary);
  line-height: 1.55; cursor: pointer;
  border-radius: 4px; transition: all 0.2s;
  border-left: 2px solid transparent;
}
.q-item:hover {
  background: rgba(0,240,255,0.05);
  border-left-color: var(--cyan);
  color: var(--text-primary);
}
.q-item .q-meta {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px; color: var(--cyan-dim);
  font-weight: 600; letter-spacing: 1px;
}
.q-item .q-marks {
  font-size: 10px; color: var(--magenta);
  font-weight: 600;
}

/* ===== API KEY MODAL ===== */
.modal-overlay {
  display: none; position: fixed;
  top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,0.8);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px; padding: 30px;
  max-width: 500px; width: 90%;
}
.modal h3 {
  font-family: 'Orbitron', monospace;
  font-size: 16px; color: var(--cyan);
  margin-bottom: 12px;
}
.modal p {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 16px;
}
.modal input {
  width: 100%; padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px; color: var(--text-primary);
  font-size: 14px; outline: none;
  margin-bottom: 16px;
}
.modal input:focus { border-color: var(--cyan); }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.modal-btn {
  padding: 8px 20px; border: 1px solid var(--border-color);
  background: transparent; color: var(--text-secondary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer; border-radius: 4px; transition: all 0.3s;
}
.modal-btn.primary {
  background: linear-gradient(135deg, var(--cyan-dim), var(--purple));
  border: none; color: #fff;
}

/* ===== VIEW MODE SWITCHING ===== */
/* Default: all three panels visible */
.main-container.view-scorer .right-panel {
  display: none;
}
.main-container.view-scorer {
  grid-template-columns: 300px 1fr;
}
.main-container.view-bank .center-panel {
  display: none;
}
.main-container.view-bank {
  grid-template-columns: 300px 1fr;
}
.main-container.view-bank .right-panel {
  max-height: calc(100vh - 77px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .main-container { grid-template-columns: 260px 1fr 280px; }
  .main-container.view-scorer { grid-template-columns: 260px 1fr; }
  .main-container.view-bank { grid-template-columns: 260px 1fr; }
}
@media (max-width: 900px) {
  .main-container { grid-template-columns: 1fr; }
  .main-container.view-scorer, .main-container.view-bank { grid-template-columns: 1fr; }
  .left-panel, .right-panel {
    max-height: none; border: none;
    border-bottom: 1px solid var(--border-color);
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(0,240,255,0.2); }
  50% { box-shadow: 0 0 20px rgba(0,240,255,0.4); }
}

/* Loading animation */
.scoring-loader {
  display: none; text-align: center; padding: 40px;
}
.scoring-loader.show { display: block; }
.scoring-loader .loader-ring {
  width: 60px; height: 60px; margin: 0 auto 16px;
  border: 3px solid var(--border-color);
  border-top-color: var(--cyan);
  border-right-color: var(--magenta);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.scoring-loader p {
  font-family: 'Rajdhani', sans-serif;
  color: var(--text-dim); font-size: 14px;
  letter-spacing: 2px;
}

/* Scan line effect */
.scan-line {
  position: fixed; top:0; left:0; width:100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.15; z-index: 999;
  animation: scanDown 8s linear infinite;
  pointer-events: none;
}
@keyframes scanDown {
  0% { top: 0; }
  100% { top: 100%; }
}
