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

:root {
  --green-900: #1a3a2a;
  --green-800: #1e4d35;
  --green-700: #276749;
  --green-600: #2f855a;
  --green-500: #38a169;
  --green-100: #e6f4ed;
  --green-50: #f0faf5;
  --cream: #faf8f5;
  --warm-white: #fffdf9;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --serif: 'Georgia', 'Cambria', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--text-primary);
  background: var(--cream);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green-700); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--green-500); }

/* === Header === */
header {
  background: var(--green-900);
  border-bottom: 3px solid var(--green-600);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.logo span { color: var(--green-500); }
.logo:hover { color: #fff; }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  border-bottom-color: var(--green-500);
}

/* === Main === */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--green-900);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 540px;
  margin: 0 auto;
}

/* === Word Card === */
.word-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}
.word-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.word-card.hero-card {
  background: linear-gradient(135deg, var(--warm-white), var(--green-50));
  border: 2px solid var(--green-600);
  padding: 2rem;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

.wotd-badge {
  display: inline-block;
  background: var(--green-700);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.word-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin-bottom: 0.15rem;
}
.word-title a { color: var(--green-900); }
.word-title a:hover { color: var(--green-600); }

.hero-card .word-title { font-size: 2.2rem; }

.pronunciation {
  font-family: var(--sans);
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.hindi-translation {
  color: var(--green-700);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.word-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.difficulty {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.star { color: #cbd5e0; font-size: 0.85rem; }
.star.filled { color: #d69e2e; }

.category-tag {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meaning-preview {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.example-preview {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 3px solid var(--green-500);
}

.read-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-600);
}

/* === CTA Section === */
.cta-section { margin-top: 2.5rem; }
.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.cta-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  display: block;
}
.cta-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--green-500);
  transform: translateY(-2px);
}
.cta-card h3 {
  font-family: var(--serif);
  color: var(--green-900);
  margin-bottom: 0.4rem;
}
.cta-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* === Word Detail === */
.word-detail { max-width: 700px; margin: 0 auto; }
.word-header {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--green-100);
  margin-bottom: 2rem;
}
.word-title-large {
  font-family: var(--serif);
  font-size: 3rem;
  color: var(--green-900);
  margin-bottom: 0.25rem;
  line-height: 1.1;
}
.pronunciation-large {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.hindi-large {
  color: var(--green-700);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.word-meta-large {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.word-section {
  margin-bottom: 2rem;
}
.word-section h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--green-800);
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--green-100);
}

.meanings-list {
  padding-left: 1.5rem;
  color: var(--text-primary);
}
.meanings-list li {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.examples-list {
  list-style: none;
  padding: 0;
}
.examples-list li {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--green-500);
  background: var(--green-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.etymology-text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  background: var(--warm-white);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.related-words { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.related-tag {
  background: var(--green-100);
  color: var(--green-800);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.back-link {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.back-link a { font-weight: 600; }

/* === Daily Page === */
.daily-hero {
  text-align: center;
  padding: 2rem 1rem 1rem;
}
.daily-hero h1 {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--green-900);
}
.date-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

/* === Browse === */
.browse-header {
  margin-bottom: 1.5rem;
}
.browse-header h1 {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--green-900);
  margin-bottom: 0.25rem;
}
.browse-header p { color: var(--text-secondary); }

.filters { margin-bottom: 2rem; }
.filter-group { margin-bottom: 1rem; }
.filter-group h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.filter-pills a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: #fff;
  transition: all 0.15s;
}
.filter-pills a:hover {
  border-color: var(--green-500);
  color: var(--green-700);
  background: var(--green-50);
}
.filter-pills a.active {
  background: var(--green-700);
  color: #fff;
  border-color: var(--green-700);
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
  grid-column: 1 / -1;
}

/* === Quiz === */
.quiz-section {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.quiz-section h1 {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--green-900);
  margin-bottom: 0.25rem;
}
.quiz-instruction {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.quiz-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.quiz-definition {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.quiz-meaning {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.quiz-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
  font-family: var(--sans);
  color: var(--text-primary);
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--green-500);
  background: var(--green-50);
}
.quiz-option:disabled { cursor: default; opacity: 0.85; }

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.option-word {
  font-family: var(--serif);
  font-size: 1.1rem;
}

.quiz-option.correct {
  border-color: #38a169;
  background: #e6f4ed;
}
.quiz-option.correct .option-letter {
  background: #38a169;
  color: #fff;
}
.quiz-option.incorrect {
  border-color: #e53e3e;
  background: #fed7d7;
}
.quiz-option.incorrect .option-letter {
  background: #e53e3e;
  color: #fff;
}

.quiz-result {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.result-correct { color: #276749; font-weight: 700; font-size: 1.1rem; }
.result-incorrect { color: #c53030; font-weight: 700; font-size: 1.1rem; }
.correct-answer {
  color: var(--text-secondary);
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
}
.btn-next, .btn-learn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.25rem;
}
.btn-next {
  background: var(--green-700);
  color: #fff;
}
.btn-next:hover { background: var(--green-600); color: #fff; }
.btn-learn {
  background: var(--green-100);
  color: var(--green-800);
}
.btn-learn:hover { background: var(--green-50); }

/* === Footer === */
footer {
  background: var(--green-900);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  margin-top: 3rem;
}
footer .footer-sub { margin-top: 0.25rem; font-size: 0.8rem; }
footer code {
  background: rgba(255,255,255,0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* === Mobile === */
@media (max-width: 600px) {
  nav { padding: 0.6rem 1rem; }
  .logo { font-size: 1.25rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }
  main { padding: 1.25rem 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .tagline { font-size: 0.95rem; }
  .hero-card .word-title { font-size: 1.6rem; }
  .word-title-large { font-size: 2rem; }
  .word-grid { grid-template-columns: 1fr; }
  .cta-grid { grid-template-columns: 1fr; }
  .quiz-meaning { font-size: 1.1rem; }
}
