:root {
  --accent-color: #5ac5a5;
}

/* ─── Global ───────────────────────────────────────────────────────────── */
body {
  margin: 0;
  font-family: 'Lato', Arial, sans-serif;
  background: #f9f9f9;
  color: #333;
}
a {
  text-decoration: none;
  color: #333;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-color);
}

/* ─── Header ───────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: #3c3c3c;
}
.header-search input {
  width: 250px;
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.07);
  font-size: 1rem;
}

/* ─── Navigation ───────────────────────────────────────────────────────── */
.menu-bar {
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 0;
}
.menu-bar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.menu-bar li {
  margin: 0 10px;
}
.menu-bar a {
  color: #333;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.menu-bar a:hover,
.menu-bar a.active {
  background: #e6f4ef;
  color: var(--accent-color);
}

/* ─── Hero Section ─────────────────────────────────────────────────────── */
.hero-section {
  text-align: center;
  padding: 8rem 2rem 4rem 2rem;
  background: linear-gradient(135deg, #d1eae1, #f9f9f9);
}
.hero-section h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: #2e2e2e;
  margin-bottom: 1rem;
}
.hero-section p {
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 2rem;
}
.hero-buttons .btn {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0.5rem;
  transition: background 0.2s;
}
.hero-buttons .btn:hover {
  background: #479c87;
}

/* ─── Hero Search Form ────────────────────────────────────────────────── */
.hero-search {
  margin: 2rem 0;
}
.hero-search form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-search input[type="text"] {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 200px;
}
.hero-search button.btn {
  padding: 0.5rem 1rem;
}

/* ─── Card Grid ────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.card h3 {
  font-family: 'Playfair Display', serif;
  margin-bottom: 0.5rem;
  color: #2e2e2e;
}
.card p {
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
}

/* ─── Info Section ─────────────────────────────────────────────────────── */
.info-section {
  padding: 4rem 2rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}
.info-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 1rem;
}
.info-section p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.info-section ul {
  list-style: disc inside;
  font-size: 1.1rem;
}

/* ─── Section ──────────────────────────────────────────────────────────── */
section {
  padding: 50px 20px;
  text-align: center;
}

/* ─── Footer ───────────────────────────────────────────────────────────── */
footer {
  background: #fff;
  color: #333;
  text-align: center;
  padding: 0;
  border-top: 1px solid #eee;
  position: relative;
}
.footer-definition {
  text-align: left;
  font-style: italic;
  font-size: 0.9rem;
  padding: 1rem 2rem 0 2rem;
  color: #555;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 2rem 0 0.5rem 0;
  background-color: #f1f1f1;
}
.footer-column {
  flex: 1;
  min-width: 160px;
}
.footer-column h4 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #222;
}
.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-column li {
  margin-bottom: 8px;
}
.footer-column a {
  color: var(--accent-color);
  font-weight: 600;
  background: none;
  padding: 0;
  display: inline;
}
.footer-column a:hover {
  text-decoration: underline;
  color: #333;
}
.footer-copyright {
  font-size: 0.95rem;
  color: #888;
  padding: 1rem 0 1.5rem 0;
  margin: 0;
  background: #fff;
}

/* ─── Blog Components ──────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.blog-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.2s;
}
.blog-card:hover {
  transform: translateY(-2px);
}
.blog-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.blog-content {
  padding: 1.5rem;
}
.blog-category {
  color: var(--accent-color);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.blog-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin: 0.5rem 0 1rem 0;
  color: #333;
}
.blog-excerpt {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #888;
}
.featured-post {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.featured-post .blog-content {
  padding: 2rem;
}
.featured-post .blog-title {
  font-size: 2rem;
}
.search-filters {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* ─── Community Components ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 2rem auto;
}
.stat-card {
  background: white;
  padding: 2rem;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-color);
  font-family: 'Playfair Display', serif;
}
.stat-label {
  color: #666;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}
.leaderboard {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}
.leaderboard-item:last-child {
  border-bottom: none;
}
.rank {
  font-weight: 700;
  font-size: 1.2rem;
  width: 30px;
}
.rank.gold { color: #ffd700; }
.rank.silver { color: #c0c0c0; }
.rank.bronze { color: #cd7f32; }
.user-info {
  flex: 1;
  margin-left: 1rem;
}
.username {
  font-weight: 600;
  color: #333;
}
.user-title {
  font-size: 0.9rem;
  color: #666;
}
.score {
  font-weight: 700;
  color: var(--accent-color);
}
.activity-feed {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.activity-item {
  display: flex;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}
.activity-item:last-child {
  border-bottom: none;
}
.activity-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  margin-right: 1rem;
  flex-shrink: 0;
}
.activity-content {
  flex: 1;
}
.activity-text {
  color: #333;
  margin-bottom: 0.25rem;
}
.activity-time {
  font-size: 0.9rem;
  color: #888;
}
.community-feature {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}
.feature-card {
  background: linear-gradient(135deg, var(--accent-color), #479c87);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}
.feature-card h3 {
  margin-bottom: 1rem;
  font-family: 'Playfair Display', serif;
}
.feature-card .btn {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
}
.feature-card .btn:hover {
  background: rgba(255,255,255,0.3);
}

/* ─── Dictionary Components ───────────────────────────────────────────── */
.dictionary-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
.dictionary-header {
  text-align: center;
  margin-bottom: 40px;
}
.dictionary-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3em;
  color: #2c3e50;
  margin-bottom: 10px;
}
.dictionary-header p {
  font-size: 1.2em;
  color: #7f8c8d;
  margin-bottom: 30px;
}
.search-filters {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.search-bar {
  margin-bottom: 0;
  flex: 2;
  min-width: 300px;
}
.search-bar label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #2c3e50;
}
.search-bar input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
  box-sizing: border-box;
  height: 44px;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent-color);
}
.filters {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group {
  flex: 1;
  min-width: 200px;
}
.filter-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #2c3e50;
}
.filter-group select {
  width: 100%;
  padding: 12px 10px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  height: 44px;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 10px;
}
.results-count {
  font-size: 1.1em;
  color: #7f8c8d;
}
.sort-options select {
  padding: 8px 12px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
}
.word-pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}
.word-pair-card {
  background: white;
  border: 2px solid #e1e8ed;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}
.word-pair-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: var(--accent-color);
}
.word-pair {
  text-align: center;
  margin-bottom: 20px;
}
.word-forward, .word-reverse {
  font-family: 'Playfair Display', serif;
  font-size: 2.2em;
  font-weight: 700;
  margin: 5px 0;
}
.word-forward {
  color: #e74c3c;
}
.word-reverse {
  color: var(--accent-color);
}
.word-separator {
  font-size: 1.5em;
  color: #95a5a6;
  margin: 0 10px;
}
.word-details {
  border-top: 1px solid #ecf0f1;
  padding-top: 20px;
}
.word-definitions {
  margin-bottom: 15px;
}
.definition {
  margin-bottom: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid transparent;
}
.definition.forward {
  border-left-color: #e74c3c;
}
.definition.reverse {
  border-left-color: var(--accent-color);
}
.definition strong {
  color: #2c3e50;
}
.word-examples {
  margin-bottom: 15px;
}
.example {
  font-style: italic;
  color: #7f8c8d;
  margin-bottom: 5px;
  padding: 8px;
  background: #f1f3f4;
  border-radius: 4px;
}
.word-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}
.meta-tag {
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.85em;
  font-weight: 600;
}
.category-tag {
  background: #e8f6f3;
  color: #16a085;
}
.difficulty-tag {
  background: #fdf2e9;
  color: #e67e22;
}
.popularity-tag {
  background: #f4ecf7;
  color: #8e44ad;
}
.etymology {
  margin-top: 15px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #f39c12;
  font-size: 0.9em;
  color: #5d6d7e;
}
.no-results {
  text-align: center;
  padding: 40px;
  color: #7f8c8d;
}
.loading {
  text-align: center;
  padding: 40px;
  font-size: 1.2em;
  color: var(--accent-color);
}

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .footer-links {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .card-grid {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }
  .site-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .hero-search form {
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }
  .hero-search input[type="text"] {
    width: 100%;
  }
  .blog-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .featured-post {
    grid-template-columns: 1fr;
  }
  .community-feature {
    grid-template-columns: 1fr;
  }
  .dictionary-header h1 {
    font-size: 2.2em;
  }
  .filters {
    flex-direction: column;
  }
  .filter-group {
    min-width: auto;
  }
  .word-pairs-grid {
    grid-template-columns: 1fr;
  }
  .results-header {
    flex-direction: column;
    gap: 10px;
  }
}
