/* CSS Variables */
:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --secondary: #8b5cf6;
  --accent: #f472b6;
  --background: #0a0e1a;
  --background-gradient: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 50%, #0f1629 100%);
  --card-bg: rgba(30, 41, 59, 0.8);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --hebrew-color: #22d3ee;
  --arabic-color: #c4b5fd;
  --transliteration-color: #fbbf24;
  --success: #10b981;
  --error: #f43f5e;
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px var(--primary-glow);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background-gradient);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Header */
header {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-title {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-list {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
}

.nav-list a {
  color: var(--text);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius-sm);
  transition: all 0.3s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-list a:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(30, 41, 59, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
  padding: 0.5rem;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  list-style: none;
  box-shadow: var(--shadow);
}
.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu a { padding: 0.75rem 1rem; border-radius: var(--border-radius-sm); }

/* Main Container */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: calc(100vh - 200px);
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.card h2 {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.card p { color: var(--text-muted); }

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  text-decoration: none;
  display: block;
}

.feature-card .card {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
}

.feature-card .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* Buttons */
button, .btn {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--card-border);
}

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

/* Filter Buttons */
.filter-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

th {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

th:first-child { border-radius: var(--border-radius-sm) 0 0 0; }
th:last-child { border-radius: 0 var(--border-radius-sm) 0 0; }

tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Tense Badge */
.tense-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tense-badge.past { background: rgba(244, 114, 182, 0.2); color: var(--accent); }
.tense-badge.present { background: rgba(16, 185, 129, 0.2); color: var(--success); }

/* Language Classes */
.hebrew {
  direction: rtl;
  font-size: 1.4em;
  color: var(--hebrew-color);
  font-family: 'Noto Sans Hebrew', 'David', sans-serif;
}

.arabic {
  direction: rtl;
  font-size: 1.4em;
  color: var(--arabic-color);
  font-family: 'Noto Sans Arabic', 'Arial', sans-serif;
}

.transliteration {
  color: var(--transliteration-color);
  font-style: italic;
  font-weight: 500;
}

.rtl { direction: rtl; text-align: right; }

/* Game UI */
.game-container {
  text-align: center;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.question-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.question-card h3 {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.option {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.option:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.02);
}

.option.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.2);
  animation: pulse-success 0.5s ease;
}

.option.incorrect {
  border-color: var(--error);
  background: rgba(244, 63, 94, 0.2);
  animation: shake 0.5s ease;
}

@keyframes pulse-success {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.feedback {
  padding: 1.25rem;
  border-radius: var(--border-radius-sm);
  margin: 1.5rem 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.feedback.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.feedback.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid var(--error);
  color: var(--error);
}

.score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Flashcard */
.flashcard-container {
  perspective: 1000px;
  margin: 2rem auto;
  max-width: 450px;
}

.flashcard-container {
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

.flashcard {
  width: 100%;
  height: 300px;
  position: relative;
  cursor: pointer;
}

.flashcard-front, .flashcard-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.flashcard-front {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
  opacity: 1;
}

.flashcard-back {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(34, 211, 238, 0.15) 100%);
  opacity: 0;
}

.flashcard.flipped .flashcard-front {
  opacity: 0;
}

.flashcard.flipped .flashcard-back {
  opacity: 1;
}

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

.progress-indicator {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* Footer */
footer {
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid var(--card-border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* Utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Page Title */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tip Box - for conjugation hints */
.tip-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--border-radius-sm);
  color: var(--primary);
  font-size: 0.9rem;
  text-align: left;
}

.tip-box i {
  color: #fbbf24;
  margin-right: 0.5rem;
}

/* Speaker Button for Audio */
.speaker-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  margin-left: 0.5rem;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
  opacity: 0.7;
  font-size: 0.9rem;
}

.speaker-btn:hover {
  opacity: 1;
  background: rgba(99, 102, 241, 0.2);
  transform: scale(1.1);
  box-shadow: none;
}

.speaker-btn:active {
  transform: scale(0.95);
}

.speaker-btn i {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  header { padding: 1rem; }
  .header-container { flex-direction: column; gap: 1rem; }
  .nav-list { flex-wrap: wrap; justify-content: center; }
  main { padding: 1.5rem 1rem; }
  .options { grid-template-columns: 1fr; }
  .hebrew, .arabic { font-size: 1.2em; }
  .feature-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 1.5rem; }
}

