/* =====================================================
   DESIGN TOKENS
===================================================== */

/* 🌤️ LIGHT THEME */
:root {
  --bg: #8e9caa;
  --bg-soft: #9da9b4;
  --card: #ffffff;

  --text: #000000;
  --text-soft: #334155;
  --muted: #64748b;

  --primary: #2563eb;
  --primary-soft: #909196;

  --border: #304368;

  --shadow-sm: 0 4px 12px rgba(15,23,42,0.08);
  --shadow-md: 0 20px 40px rgba(15,23,42,0.12);
}

/* 🌙 DARK THEME */
[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0f172a;
  --card: #111827;

  --text: #e5e7eb;
  --text-soft: #cbd5f5;
  --muted: #9ca3af;

  --primary: #60a5fa;
  --primary-soft: #1e293b;

  --border: #1f2937;

  --shadow-sm: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 30px 60px rgba(0,0,0,0.6);
}

/* =====================================================
   GLOBAL
===================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--bg), var(--bg-soft));
  color: var(--text);
  transition: background 0.4s ease, color 0.3s ease;
}

.container {
  max-width: 960px;
  margin: auto;
  padding: 20px;
}

/* =====================================================
   NAVBAR (FROSTED)
===================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.35);
}

[data-theme="dark"] .navbar {
  background: rgba(2,6,23,0.75);
}

.nav-inner {
  max-width: 1100px;
  margin: auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  color: var(--text);
}

.nav-links a {
  margin-left: 18px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--primary);
}

.avatar {
  background: linear-gradient(135deg, var(--primary), #38bdf8);
  color: white !important;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* =====================================================
   LIQUID GLASS CARD
===================================================== */

.card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(18px);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 22px;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
}

[data-theme="dark"] .card {
  background: rgba(17,24,39,0.75);
  border-color: rgba(255,255,255,0.08);
}

/* =====================================================
   TYPOGRAPHY
===================================================== */

.big {
  font-size: 22px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

/* =====================================================
   BUTTONS
===================================================== */

.btn {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn.small {
  padding: 8px 14px;
  font-size: 14px;
}

.ghost {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.ghost:hover {
  text-decoration: underline;
}

/* =====================================================
   STATS
===================================================== */

.stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.stat {
  flex: 1;
  background: linear-gradient(
    135deg,
    var(--primary-soft),
    rgba(255,255,255,0.45)
  );
  padding: 18px;
  border-radius: 18px;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

/* =====================================================
   PROGRESS BAR
===================================================== */

.progress {
  background: rgba(148,163,184,0.25);
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: inherit;
  animation: growBar 1s ease-out;
}

@keyframes growBar {
  from { width: 0 }
}

/* =====================================================
   ACTION GRID
===================================================== */

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
 font-weight: bold; 
  font-style: italic;
}

.action-card {
  background: rgba(17, 14, 14, 0.65);
  backdrop-filter: blur(1px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 18px;
  transition: transform 0.20s ease, box-shadow 0.20s ease;
  color: whitesmoke;
}

.action-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: var(--shadow-md);
}

.action-card span {
  font-size: 28px;
}

.action-card strong {
  display: block;
  margin-top: 6px;
}

/* =====================================================
   BADGES & PILLS
===================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
  font-weight: 700;
  font-size: 13px;
  margin: 4px;
}

.pill {
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}

/* =====================================================
   TOOL LINKS
===================================================== */

.tool-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.tool-link:hover {
  background: var(--primary-soft);
}

/* =====================================================
   AUDIO
===================================================== */

.audio-rounded {
  width: 100%;
  max-width: 360px;
  border-radius: 14px;
  margin-top: 8px;
}

/* =====================================================
   DONE / SUCCESS
===================================================== */

.done {
  color: #16a34a;
  font-weight: 700;
}

/* =====================================================
   FOOTER
===================================================== */

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 30px 0;
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 640px) {
  .stats {
    flex-direction: column;
  }

  .nav-links a:not(.avatar) {
    display: none;
  }
}



/* =========================
   DICTIONARY / SEARCH
========================= */

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-box .input {
  flex: 1;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: 14px;
}

.dictionary-result {
  margin-top: 10px;
}

.dictionary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dictionary-word {
  font-size: 26px;
  font-weight: 800;
}

.dictionary-phonetic {
  font-size: 15px;
  color: var(--muted);
}

.pronunciation button,
.pronunciation .pill {
  font-weight: 700;
}

.definition-card {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  border-left: 4px solid var(--primary);
}

[data-theme="dark"] .definition-card {
  background: rgba(17,24,39,0.7);
}

.definition-card p {
  margin: 6px 0;
}


/* =========================
   DAILY SENTENCES
========================= */

.sentence {
  padding: 20px;
  border-radius: 20px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  position: relative;
}

[data-theme="dark"] .sentence {
  background: rgba(17,24,39,0.75);
}

.sentence h3 {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.en.big {
  font-size: 24px;
  font-weight: 800;
  margin-top: 8px;
}

.ar {
  font-size: 18px;
  margin-top: 6px;
}

.sentence audio {
  margin-top: 12px;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
}

.sentence .tool-links {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.word-pill {
  display: inline-block;
  padding: 6px 12px;
  margin: 4px 6px 0 0;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.word-pill:hover {
  background: var(--primary);
  color: white;
}


/* =========================
   MICRO UX POLISH
========================= */

hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border),
    transparent
  );
  margin: 18px 0;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}



.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s ease;
}

[data-theme="dark"] .tool-link {
  background: rgba(17,24,39,0.6);
}

.tool-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateY(-2px);
}

.tool-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}


.profile-header {
  text-align: center;
  padding-bottom: 10px;
}

.profile-name {
  font-size: 26px;
  font-weight: 800;
}

.profile-sub {
  color: var(--muted);
  font-size: 15px;
}

.stat {
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top,
    rgba(255,255,255,0.4),
    transparent 60%
  );
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #111;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(250,204,21,0.4);
}


.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;

  background:
    radial-gradient(
      1200px 600px at 10% -10%,
      rgba(37,99,235,0.18),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 90% 10%,
      rgba(96,165,250,0.18),
      transparent 60%
    ),
    linear-gradient(
      180deg,
      var(--bg),
      var(--bg-soft)
    );
}

[data-theme="dark"] .hero {
  background:
    radial-gradient(
      1200px 600px at 10% -10%,
      rgba(96,165,250,0.25),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 90% 10%,
      rgba(56,189,248,0.22),
      transparent 60%
    ),
    linear-gradient(
      180deg,
      #020617,
      #0b1220
    );
}


.hero-inner.card {
  max-width: 760px;
  padding: 56px 44px;
  text-align: center;

  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.92),
    rgba(255,255,255,0.85)
  );
  backdrop-filter: blur(12px);
  border-radius: 28px;

  box-shadow:
    0 30px 80px rgba(15,23,42,0.18),
    inset 0 1px 0 rgba(255,255,255,0.7);

  animation: heroFade 0.9s ease forwards;
}

[data-theme="dark"] .hero-inner.card {
  background: linear-gradient(
    180deg,
    rgba(15,23,42,0.9),
    rgba(2,6,23,0.85)
  );
  box-shadow:
    0 40px 90px rgba(0,0,0,0.65);
}

@keyframes heroFade {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.cta {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  margin-bottom: 42px;
  flex-wrap: wrap;
}

.cta .btn {
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: 16px;
  box-shadow:
    0 14px 30px rgba(37,99,235,0.35);
}

.cta .ghost {
  font-size: 0.95rem;
  padding: 12px 18px;
}

.quote {
  margin-top: 10px;
}

.quote-en {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-soft);
  max-width: 560px;
  margin: auto;
  line-height: 1.8;

  opacity: 0;
  animation: quoteFade 0.8s ease forwards;
  animation-delay: 0.2s;
}

@keyframes quoteFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .hero-inner.card {
    padding: 40px 24px;
    border-radius: 22px;
  }

  .subtitle {
    font-size: 1rem;
  }

  .quote-en {
    font-size: 1.05rem;
  }
}


/* ======================
   AUTH PAGES (LOGIN / SIGNUP / ADMIN)
====================== */

.auth-wrapper {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  max-width: 1000px;
  width: 100%;
}


.card h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  margin: 12px 0 6px;
}


.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(6px);
  font-size: 15px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}


.err {
  margin-top: 6px;
  font-size: 13px;
  color: #dc2626;
}

.wfull {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font-size: 1rem;
  border-radius: 14px;
}


[data-theme="dark"] .card {
  background: linear-gradient(180deg, #111827, #0f172a);
}


.btn {
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}


.video-center {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.video-center video {
  width: 100%;
  max-width: 520px;
  border-radius: 16px;
}


/* =========================
   LEADERBOARD
========================= */

.leaderboard {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.65),
    rgba(255,255,255,0.4)
  );
  backdrop-filter: blur(14px);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

/* Dark mode glass */
[data-theme="dark"] .leaderboard {
  background: linear-gradient(
    180deg,
    rgba(17,24,39,0.85),
    rgba(15,23,42,0.75)
  );
}

/* -------------------------
   ROW
------------------------- */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  transition: transform 0.15s ease, background 0.15s ease;
  margin: 5px;  border: 1px solid var(--border);
}

/* Hover effect */
.leaderboard-row:hover {
  background: var(--primary-soft);
  transform: translateY(-2px);
}

/* Top 3 highlight */
.leaderboard-row.top-1 {
  background: linear-gradient(135deg, #018f08, #01800c);
  color: #111;
}

.leaderboard-row.top-2 {
  background: linear-gradient(135deg, #0a368f, #083e9c);
}

.leaderboard-row.top-3 {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
}

/* -------------------------
   RANK
------------------------- */
.rank {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.top-1 .rank { background: #111; color: #facc15; }
.top-2 .rank { background: #111; color: #e5e7eb; }
.top-3 .rank { background: #111; color: #f97316; }

/* -------------------------
   USER INFO
------------------------- */
.leader-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.leader-name {
  font-weight: 600;
  font-size: 16px;
}

.leader-meta {
  font-size: 13px;
  color: var(--muted);
  color: white;
}

/* -------------------------
   SCORE
------------------------- */
.leader-score {
  text-align: right;
  font-weight: 700;
  font-size: 18px;
}

.leader-score span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* -------------------------
   STREAK 🔥
------------------------- */
.streak {
  background: rgba(255,115,0,0.15);
  color: #f97316;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* -------------------------
   MOBILE
------------------------- */
@media (max-width: 640px) {
  .leaderboard-row {
    padding: 12px;
  }

  .leader-score {
    font-size: 16px;
  }
}




/* =========================
   REVISION STATUS (Reviewed)
========================= */

.revision-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  margin-top: 14px;
  animation: fadeIn 0.4s ease;
}

.reviewed-today {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  box-shadow: 0 6px 18px rgba(34,197,94,0.3);
}

.status-icon {
  font-size: 16px;
}

.status-text {
  letter-spacing: 0.3px;
}


/* =========================
   REMEMBER BUTTON
========================= */

.revision-form {
  margin-top: 14px;
}

.remember-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  width: 100%;
  padding: 12px 16px;

  border: none;
  border-radius: 14px;

  font-weight: 600;
  font-size: 15px;

  cursor: pointer;

  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;

  transition: all 0.25s ease;
  box-shadow: 0 8px 20px rgba(37,99,235,0.25);
}

.remember-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37,99,235,0.35);
}

.remember-btn:active {
  transform: scale(0.98);
}

.btn-emoji {
  font-size: 16px;
}

.xp-badge {
  background: rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}


/* =========================
   Animation
========================= */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}



.progress {
  width: 100%;
  height: 14px;
  background: rgba(0,0,0,0.05);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.6s ease;
  position: relative;
}

/* Optional animated glow */
.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  height: 100%;
  width: 30%;
  background: rgba(255,255,255,0.3);
  transform: skewX(-20deg);
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { left: -30%; }
  100% { left: 130%; }
}
