/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

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

:root {
  --bg-gradient: linear-gradient(135deg, #1a1b41 0%, #0d0e26 100%);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --primary: #6366f1;
  --secondary: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #f43f5e;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 0 auto;
}

.flashcard-container {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
  margin: 0 auto;
}

header {
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width 0.3s ease;
}

/* Flashcard Styles */
.flashcard-scene {
  perspective: 1000px;
  height: 400px;
  width: 100%;
  margin: 0 auto;
}

.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 24px;
  padding: 3rem;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.card-back {
  transform: rotateY(180deg);
  background: #ffffff;
  align-items: flex-start;
  text-align: left;
}

.badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
}

#card-english {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  word-break: break-word;
  color: #0f172a;
}

.instruction {
  color: #64748b;
  font-size: 1rem;
  opacity: 0.8;
  animation: pulse 2s infinite;
}

.translations {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin: 0 0 0.4rem 0;
  font-weight: 600;
  display: block;
}

.translation-group h3 {
  font-size: 2.2rem;
  margin: 0;
  font-weight: 600;
  color: #0f172a;
}

.arabic-word {
  font-family: Tahoma, 'Amiri', serif;
  font-size: 2.5rem !important;
  color: #b45309;
}

.plural-form {
  font-size: 1.2rem;
  color: #64748b;
  margin: 0.5rem 0 0 0;
}

.example-sentence {
  font-size: 1.2rem;
  font-style: italic;
  margin: 0;
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  color: #334155;
  line-height: 1.5;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:not(:disabled):hover {
  background: #4f46e5;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-secondary:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Action Buttons */
.btn-action {
  flex: 1;
  justify-content: center;
  font-size: 1rem;
  padding: 0.8rem 1rem;
}

.btn-not-yet {
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn-not-yet:not(:disabled):hover {
  background: rgba(244, 63, 94, 0.2);
}

.btn-maybe {
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.btn-maybe:not(:disabled):hover {
  background: rgba(234, 179, 8, 0.2);
}

.btn-learned {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.btn-learned:not(:disabled):hover {
  background: rgba(34, 197, 94, 0.2);
}

/* Badges */
.badge-learned {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  position: static;
  display: inline-block;
  font-size: 0.8rem;
}

.badge-maybe {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  position: static;
  display: inline-block;
  font-size: 0.8rem;
}

.badge-not-yet {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  position: static;
  display: inline-block;
  font-size: 0.8rem;
}

/* Swipe Animations */
.swipe-out-right {
  animation: swipeRight 0.3s forwards;
}

.swipe-out-left {
  animation: swipeLeft 0.3s forwards;
}

.swipe-out-down {
  animation: swipeDown 0.3s forwards;
}

@keyframes swipeRight {
  to {
    transform: translateX(150%) rotate(20deg);
    opacity: 0;
  }
}

@keyframes swipeLeft {
  to {
    transform: translateX(-150%) rotate(-20deg);
    opacity: 0;
  }
}

@keyframes swipeDown {
  to {
    transform: translateY(150%) rotate(10deg);
    opacity: 0;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

/* Stats Dashboard Styling */
.stats-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.stats-dashboard .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.stats-dashboard h1 {
  font-size: 2.5rem;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stat-total .stat-value {
  color: var(--text-main);
}

.stat-learned .stat-value {
  color: #4ade80;
}

.stat-maybe .stat-value {
  color: #facc15;
}

.stat-not-yet .stat-value {
  color: #fb7185;
}

.stat-unseen .stat-value {
  color: #818cf8;
}

.progress-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-top: 1.5rem;
}

.progress-section h3 {
  margin: 0 0 1rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stats-section-header {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-bottom: 1.2rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  font-size: 1.5rem;
}

@media (max-width: 600px) {
  #card-english {
    font-size: 2.5rem;
  }

  .translation-group h3 {
    font-size: 1.8rem;
  }

  .arabic-word {
    font-size: 2rem !important;
  }

  .flashcard-front,
  .flashcard-back {
    padding: 2rem;
  }

  .btn {
    padding: 0.8rem 1.5rem;
  }
}

/* Global Sidebar Navigation */
.main-content {
  flex: 1;
  transition: margin-left 0.3s ease;
  box-sizing: border-box;
}

/* Sidebar Container */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  /* Hidden by default on mobile */
  width: 250px;
  height: 100vh;
  background: rgba(20, 21, 44, 0.95);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-sizing: border-box;
  transition: left 0.3s ease;
  z-index: 1000;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
}

.sidebar.sidebar-open {
  left: 0;
}

/* Header & Mobile Toggle */
.header-mobile {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.menu-toggle,
.menu-close {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.menu-close {
  font-size: 1.5rem;
  line-height: 1;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.2rem;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-brand a {
  text-decoration: none;
  color: inherit;
}

/* Vertical Links */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  /* Pushes the user block to the bottom if empty space exists */
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  display: block;
}

.nav-links a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

/* User Section at Bottom */
.nav-user {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.nav-avatar-link {
  display: flex;
  align-items: center;
}

.nav-level-select {
  appearance: none;
  background-color: var(--card-bg, #1a1b41);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.6rem 2rem 0.6rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1em;
  width: 100%;
}

.nav-level-select:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.nav-level-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.nav-level-select option {
  background-color: #1a1b41;
  color: #ffffff;
}

/* Header & Toggle (Visible on all screens) */
.header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* Desktop Styles (Wide screens) */
@media (min-width: 1024px) {
  .sidebar.sidebar-open~.main-content {
    margin-left: 250px;
    /* Offset the main page so it doesn't overlap the sidebar only when open */
  }
}

/* =====================
   FILL-IN-BLANKS GAME
   ===================== */

.game-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.game-score {
  display: flex;
  gap: 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.score-correct {
  color: #4ade80;
}

.score-wrong {
  color: #fb7185;
}

.game-difficulty {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 8px;
}

/* Timer Bar */
.timer-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: #4ade80;
  border-radius: 10px;
  transition: width 1s linear, background 0.5s;
}

/* Game Card */
.game-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.game-english {
  font-size: 2.6rem;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.game-article-prompt,
.masked-word-prompt {
  color: var(--text-muted);
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Article Buttons */
.article-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 5px;
}

.article-btn {
  padding: 0.7rem 2rem;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.article-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.article-btn.selected {
  background: rgba(129, 140, 248, 0.3);
  border-color: #818cf8;
  color: #818cf8;
  transform: scale(1.05);
}

/* Letter Row */
.letter-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.letter-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 52px;
  border-radius: 10px;
  font-size: 1.6rem;
  font-weight: 700;
}

.letter-box.filled {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
}

.letter-box.blank {
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid rgba(129, 140, 248, 0.5);
}

.letter-box.space {
  width: 20px;
  background: transparent;
}

.letter-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #c084fc;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  text-transform: uppercase;
  caret-color: #818cf8;
}

.letter-input.hinted {
  color: #facc15;
}

.letter-input.wrong {
  color: #fb7185;
}

.letter-input.correct-letter {
  color: #4ade80;
}

/* Hint & Submit Buttons */
.btn-hint {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: #facc15;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.btn-hint:hover {
  background: rgba(234, 179, 8, 0.18);
}

.btn-submit {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 0.9rem 3rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint-cost {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Feedback */
.feedback {
  width: 100%;
  text-align: center;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  animation: fadeInUp 0.3s ease;
}

.feedback.correct {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.feedback.incorrect {
  background: rgba(251, 113, 133, 0.15);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: #fb7185;
}

.hidden {
  display: none !important;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Image Quiz ──────────────────────────────────────────────────────────── */
.iq-photo {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  display: block;
}

.iq-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 0;
  color: var(--text-muted);
}

.iq-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(129, 140, 248, 0.2);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.iq-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.iq-option-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.9rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-align: center;
  word-break: break-word;
}

.iq-option-btn:hover:not(:disabled) {
  background: rgba(129, 140, 248, 0.15);
  border-color: #818cf8;
  transform: translateY(-2px);
}

.iq-option-btn.iq-correct {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

.iq-option-btn.iq-wrong {
  background: rgba(251, 113, 133, 0.2);
  border-color: #fb7185;
  color: #fb7185;
}

/* ── Landing Page ────────────────────────────────────────────────────────── */
.landing-hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  max-width: 700px;
  margin: 0 auto;
}

.landing-badge {
  display: inline-block;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #818cf8;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.35rem 1.1rem;
  margin-bottom: 1.5rem;
}

.landing-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--text-main);
}

.landing-accent {
  background: linear-gradient(90deg, #818cf8, #c084fc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 auto 2.5rem;
  max-width: 480px;
  line-height: 1.6;
}

.landing-stats-row {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.landing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.landing-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-main);
}

.landing-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Mode Cards */
.landing-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
}

@media (max-width: 700px) {
  .landing-modes {
    grid-template-columns: 1fr;
  }
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.4);
  background: rgba(129, 140, 248, 0.07);
}

.mode-card-icon {
  font-size: 2.2rem;
}

.mode-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}

.mode-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.mode-card-cta {
  margin-top: auto;
  font-size: 0.88rem;
  font-weight: 700;
  color: #818cf8;
  letter-spacing: 0.02em;
}

.landing-stats-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 2px;
  transition: color 0.2s;
}

.landing-stats-link:hover {
  color: #818cf8;
}

/* ── Authentication UI ─────────────────────────────────────────────────────── */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  /* Adjust for navbar height approx */
  padding: 2rem;
}

.auth-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 3rem 4rem;
  width: 100%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.auth-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 2.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: #818cf8;
  background: rgba(129, 140, 248, 0.05);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-input {
  accent-color: #818cf8;
  width: 1.1rem;
  height: 1.1rem;
}

.checkbox-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
}

.form-actions {
  margin-top: 1rem;
}

.w-100 {
  width: 100%;
  display: flex;
  justify-content: center;
}

.password-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
  margin-bottom: 0.25rem;
}

.auth-links {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
  font-weight: 500;
}

.auth-links a:hover {
  color: #818cf8;
}

@media (max-width: 600px) {
  .auth-card {
    padding: 2.5rem 2rem;
  }
}

/* Authentication Forms */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  color: var(--text-main);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h2 {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label-with-hint {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}

.auth-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  background: rgba(0, 0, 0, 0.3);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: -0.5rem;
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-checkbox-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.auth-btn-primary {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.auth-links {
  margin-top: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.auth-links a:hover {
  color: var(--primary);
}

/* Error Explanations */
#error_explanation {
  background: rgba(244, 63, 94, 0.1);
  border-left: 4px solid var(--accent);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

#error_explanation h2 {
  font-size: 1rem;
  color: #fda4af;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

#error_explanation ul {
  margin: 0;
  padding-left: 1.5rem;
  color: #fecdd3;
  font-size: 0.9rem;
}

/* Global Flash Messages */
.flash-messages-global {
  width: 100%;
  position: absolute;
  top: 60px;
  /* Below the navbar */
  left: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  /* Enable clicking the close button */
}

.flash-message-global {
  width: 100%;
  padding: 1rem 2rem;
  color: #fff;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.flash-close-btn {
  position: absolute;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.flash-close-btn:hover {
  color: white;
}

.flash-notice {
  background: rgba(16, 185, 129, 0.9);
  border-bottom: 2px solid #059669;
}

.flash-alert {
  background: rgba(244, 63, 94, 0.9);
  border-bottom: 2px solid #e11d48;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Nav Avatar */
.nav-avatar-link {
  text-decoration: none;
  flex-shrink: 0;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: border-color 0.3s ease, transform 0.2s ease;
}

.nav-avatar:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

.nav-avatar-default {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

/* Edit Profile Avatar Preview */
.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--card-border);
  margin-bottom: 0.5rem;
}

/* Translation Quiz */
.tq-prompt {
  text-align: center;
  margin-bottom: 2rem;
}

.tq-label {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tq-english-word {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  text-shadow: 0 0 20px rgba(129, 140, 248, 0.3);
}

/* ── Artikel Quiz ───────────────────────────────────────────────────────────── */
.aq-word-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.aq-article-placeholder {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(244, 63, 94, 0.15);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 0.2rem 0.8rem;
  min-width: 80px;
  text-align: center;
}

.aq-article-placeholder.aq-article-correct {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  border: 2px solid #4ade80;
}

.aq-article-placeholder.aq-article-wrong {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.2);
  border: 2px solid #f43f5e;
}

.aq-word {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-main);
  text-shadow: 0 0 20px rgba(129, 140, 248, 0.3);
}

.aq-english {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  font-style: italic;
}

.aq-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.aq-option-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 1rem 2.5rem;
  border-radius: 16px;
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  backdrop-filter: blur(10px);
}

.aq-option-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
}

.aq-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.aq-option-btn.aq-correct {
  background: rgba(74, 222, 128, 0.2) !important;
  border-color: #4ade80 !important;
  color: #4ade80 !important;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.aq-option-btn.aq-wrong {
  background: rgba(244, 63, 94, 0.2) !important;
  border-color: #f43f5e !important;
  color: #f43f5e !important;
  animation: shake 0.4s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}
