/* ═══════════════════════════════════════════════════════════
   EMPIRE ENGLISH — Practice Platform Design System
   Matches: assessment.empireenglish.online
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --accent: #D4AF37;
  --accent-light: #e8d48b;
  --accent-muted: #8b7355;
  --accent-dark: #9B7B2C;
  --bg-primary: #0A0A0F;
  --bg-card: #111118;
  --bg-secondary: #0D1117;
  --bg-elevated: #16161e;
  --text-primary: #F5F0E8;
  --text-secondary: #8B919A;
  --text-muted: #5a5f69;
  --border: rgba(212, 175, 55, 0.12);
  --border-hover: rgba(212, 175, 55, 0.3);
  --success: #2ECC71;
  --danger: #E74C3C;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-gold-sm: 0 0 5px rgba(212, 175, 55, 0.2);
  --shadow-gold-md: 0 0 15px rgba(212, 175, 55, 0.3);
  --shadow-gold-lg: 0 0 30px rgba(212, 175, 55, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.7;
  /* Empire background gradient */
  background:
    radial-gradient(ellipse at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(26, 26, 46, 0.5) 0%, transparent 50%),
    linear-gradient(180deg, #0A0A0F 0%, #0D1117 50%, #0A0A0F 100%);
  background-attachment: fixed;
}

/* Subtle noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.012;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

::selection {
  background-color: var(--accent);
  color: var(--bg-primary);
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.6s ease-out;
}

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

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Header ─────────────────────────────────────────────── */

.header {
  text-align: center;
  padding: 40px 0 30px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 35px;
}

.header .logo {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 50%;
  box-shadow: var(--shadow-gold-sm);
}

.header h1 {
  font-family: 'Cinzel', serif;
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  /* Gold shimmer text */
  background: linear-gradient(135deg, #D4AF37 0%, #e8d48b 25%, #D4AF37 50%, #8b7355 75%, #D4AF37 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s ease-in-out infinite;
}

.header .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 300;
}

.header .brand {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

/* ─── Navigation ─────────────────────────────────────────── */

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 25px;
}

.nav a, .nav button {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav a:hover, .nav button:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-gold-sm);
  transform: translateY(-1px);
}

.nav a.active, .nav button.active {
  background: linear-gradient(135deg, #D4AF37, #cd7f32);
  color: var(--bg-primary);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-gold-md);
}

/* ─── Cards (Metallic style) ─────────────────────────────── */

.card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), var(--shadow-gold-sm);
}

.card h2 {
  font-family: 'Cinzel', serif;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.card h3 {
  color: var(--accent-light);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 18px 0 10px;
}

/* ─── Transcript / Content Block ─────────────────────────── */

.transcript {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  margin: 16px 0;
  font-size: 1.1rem;
  line-height: 2;
  direction: ltr;
  color: var(--text-primary);
}

.transcript b, .transcript strong {
  color: var(--accent);
}

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
  background: linear-gradient(135deg, #D4AF37, #cd7f32);
  color: var(--bg-primary);
  border: none;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-gold-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-md);
}

.btn:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
  box-shadow: var(--shadow-gold-sm);
}

.btn-sm { padding: 9px 16px; font-size: 0.8rem; }
.btn-danger { background: linear-gradient(135deg, #E74C3C, #c0392b); box-shadow: 0 0 10px rgba(231,76,60,0.3); }
.btn-success { background: linear-gradient(135deg, #2ECC71, #27ae60); color: white; }

/* ─── Audio Controls ─────────────────────────────────────── */

.audio-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px 0;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.speed-control label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

.speed-control select {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.3s;
}

.speed-control select:hover { border-color: var(--accent); }

/* ─── Timer ──────────────────────────────────────────────── */

.timer {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin: 24px 0;
  font-family: 'Inter', monospace;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.timer.recording {
  color: var(--danger);
  animation: pulse 1s infinite;
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

/* ─── Flashcard ──────────────────────────────────────────── */

.flashcard {
  background: linear-gradient(145deg, var(--bg-elevated), var(--bg-card));
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  margin: 24px 0;
}

.flashcard:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: var(--shadow-gold-md);
}

.flashcard .word {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.flashcard .pronunciation {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 12px;
  font-style: italic;
}

.flashcard .arabic {
  font-family: 'Cairo', sans-serif;
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-top: 16px;
  direction: rtl;
  font-weight: 600;
}

.flashcard .pos {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.flashcard .instruction {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 24px;
}

/* ─── Questions / Quiz ───────────────────────────────────── */

.question {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 12px 0;
}

.question p {
  margin-bottom: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.options { display: flex; flex-direction: column; gap: 10px; }

.option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.option:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-gold-sm);
}

.option.correct {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.1);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.option.wrong {
  border-color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
}

/* ─── Recorder ───────────────────────────────────────────── */

.recorder {
  background: var(--bg-primary);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 35px;
  text-align: center;
  margin: 24px 0;
  transition: all 0.3s ease;
}

.recorder:hover { border-color: var(--accent-muted); }

.recorder.recording {
  border-color: var(--danger);
  background: rgba(231, 76, 60, 0.03);
  animation: pulse-glow 2s infinite;
}

.recorder p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ─── Done Section ───────────────────────────────────────── */

.done-section {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  margin-top: 35px;
}

.done-section label {
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.done-section .checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ─── Arabic Text ────────────────────────────────────────── */

.arabic-text {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 14px 0;
  padding: 14px 18px;
  background: rgba(212, 175, 55, 0.03);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--accent);
}

/* ─── Language Toggle ────────────────────────────────────── */

.lang-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.lang-toggle:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ─── Week/Day Navigation ────────────────────────────────── */

.week-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  margin-bottom: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-muted) transparent;
}

.week-nav a {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.3s;
  font-weight: 500;
}

.week-nav a:hover, .week-nav a.active {
  background: linear-gradient(135deg, #D4AF37, #cd7f32);
  color: var(--bg-primary);
  border-color: var(--accent);
  font-weight: 600;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.day-grid a {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.3s;
}

.day-grid a:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.day-grid a.active {
  background: linear-gradient(135deg, #D4AF37, #cd7f32);
  color: var(--bg-primary);
  border-color: var(--accent);
  font-weight: 600;
}

.day-grid a.done {
  background: rgba(46, 204, 113, 0.1);
  border-color: var(--success);
  color: var(--success);
}

/* ─── Footer ─────────────────────────────────────────────── */

.footer {
  text-align: center;
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
  .container { padding: 16px; }
  .card { padding: 20px; }
  .flashcard { padding: 30px 20px; min-height: 180px; }
  .flashcard .word { font-size: 1.7rem; }
  .btn { padding: 11px 20px; font-size: 0.85rem; }
  .timer { font-size: 2.2rem; }
  .day-grid { grid-template-columns: repeat(4, 1fr); }
  .header h1 { font-size: 1.3rem; }
}

@media (max-width: 380px) {
  .day-grid { grid-template-columns: repeat(3, 1fr); }
}
