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

:root {
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --purple-dark: #5b21b6;
  --blue: #3b82f6;
  --blue-light: #93c5fd;
  --green: #10b981;
  --green-light: #6ee7b7;
  --orange: #f59e0b;
  --orange-light: #fcd34d;
  --pink: #ec4899;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Nunito', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === Navbar === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--purple);
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-600);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--purple);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: var(--transition);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 3px;
}

.lang-btn {
  background: none;
  border: none;
  padding: 5px 12px;
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
}

.lang-btn:hover {
  color: var(--purple);
}

.lang-btn.active {
  background: var(--purple);
  color: var(--white);
}

/* === Hero === */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, #ede9fe 0%, #dbeafe 50%, #d1fae5 100%);
  text-align: center;
  overflow: hidden;
  position: relative;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  color: var(--purple-dark);
  margin-bottom: 16px;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-decoration {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 2.5rem;
  opacity: 0.7;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-accent {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.btn-accent:hover {
  background: #059669;
  border-color: #059669;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--purple);
  border-color: var(--purple);
}

.btn-outline:hover {
  background: var(--purple);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.1rem;
}

/* === Sections === */
.section {
  padding: 80px 0;
}

.section:nth-child(even) {
  background: var(--gray-50);
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  text-align: center;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  color: var(--gray-600);
  font-size: 1.05rem;
  margin-bottom: 48px;
}

/* === Card Grid === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--orange);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.card-desc {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.7;
}

.card-meta {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 20px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Game card variants */
.game-card--featured {
  border: 2px solid var(--purple-light);
}

.game-card--coming {
  border: 2px dashed var(--gray-200);
  background: var(--gray-50);
}

/* Book card */
.book-card {
  display: flex;
  flex-direction: column;
}

.book-card .card-cover {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--purple-light), var(--blue-light));
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.book-card .card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag--grade {
  background: #ede9fe;
  color: var(--purple);
}

.tag--subject {
  background: #d1fae5;
  color: #059669;
}

.tag--lang {
  background: #dbeafe;
  color: var(--blue);
}

.book-card .card-author {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 8px;
}

/* === Filters === */
.filters {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  padding: 10px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition);
  min-width: 160px;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--purple);
}

.no-results {
  text-align: center;
  color: var(--gray-400);
  font-size: 1.05rem;
  padding: 40px 0;
}

/* === About === */
.about-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-icon {
  font-size: 4rem;
  margin-bottom: 24px;
}

.about-content p {
  color: var(--gray-600);
  font-size: 1.05rem;
  margin-bottom: 16px;
  line-height: 1.8;
}

/* === Footer === */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 60px 0 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand .logo-icon,
.footer-brand .logo-text {
  color: var(--white);
}

.footer-brand .logo-text {
  font-weight: 800;
  font-size: 1.2rem;
}

.footer-tagline {
  margin-top: 12px;
  font-size: 0.95rem;
}

.footer h4 {
  color: var(--white);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 8px;
}

.footer ul a {
  color: var(--gray-400);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer ul a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 24px 20px;
    gap: 20px;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero-decoration {
    font-size: 1.8rem;
    gap: 16px;
  }

  .section {
    padding: 60px 0;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group select {
    min-width: 100%;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .container {
    padding: 0 16px;
  }

  .lang-switcher {
    align-self: center;
  }
}
