:root {
  --background-color: #121212;
  --surface-color: #1E1E1E;
  --text-color: #E0E0E0;
  --text-muted-color: #A0A0A0;
  --accent-blue: #3a76e0;
  --accent-yellow: #f1c40f;
  --accent-green: #66BB6A;
  --accent-red: #EF5350;
  --border-color: #333333;
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Poppins', sans-serif;
  --radius: 12px;
}

.error-message {
  color: var(--accent-red);
  font-weight: 600;
  padding: 0.5rem 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-main);
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
}

/* Layout */

main {
  max-width: 800px;
  margin: auto;
  padding: 2rem 1rem 1rem;
  text-align: center;
}

.container {
  max-width: 1000px;
  margin: auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Header */

.site-header {
  background: linear-gradient(to bottom, #1E1E1E, #181818);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 4px 10px rgba(0, 0, 0, 0.3),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05);
}

.logo-icon {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--accent-blue);
}

/* Grid Cards */

.class-grid,
.subject-grid,
.chapter-grid {
  display: grid;
  gap: 1rem;
  padding: 2rem 1rem;
  margin: auto;
}

.class-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  max-width: 800px;
}

.subject-grid,
.chapter-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-width: 900px;
}

.class-card,
.subject-card,
.chapter-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom right, #222, #1a1a1a);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
  padding: 1.2rem;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.class-card {
  font-size: 1.25rem;
  padding: 1.5rem;
}

.class-card:hover {
  background: linear-gradient(to bottom right, var(--accent-blue), #1c1c1c);
  color: white;
  transform: translateY(-4px);
  box-shadow:
    0 6px 10px rgba(0, 0, 0, 0.5),
    0 12px 25px rgba(0, 0, 0, 0.4);
}

.subject-card:hover,
.chapter-card:hover {
  background: linear-gradient(to bottom right, var(--accent-green), #1c1c1c);
  color: white;
  transform: translateY(-4px);
  box-shadow:
    0 6px 10px rgba(0, 0, 0, 0.5),
    0 12px 25px rgba(0, 0, 0, 0.4),
    0 0 10px var(--accent-green);
}

/* Question Answers Page */

.chapter-content {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
  text-align: left;
}

.chapter-section {
  margin-bottom: 2rem;
}

.chapter-section h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--accent-blue);
}

.question {
  color: var(--accent-yellow);
  font-weight: 600;
  margin: 1rem 0 0.3rem;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}

.question:not(:first-child) {
  margin-top: 1.5rem;
}

.answer {
  color: var(--text-color);
  margin-bottom: 0.5rem;
  text-align: left;
}

.badge {
  background-color: var(--accent-blue);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

/* Breadcrumbs */

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--text-muted-color);
  margin-bottom: 1rem;
  padding: 0 0.5rem;
  text-align: left;
}

.breadcrumbs a {
  color: var(--accent-blue);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span {
  color: var(--text-color);
}

/* Responsive */

@media (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }

  main {
    padding: 0.5rem;
    padding-top: 2rem;
  }

  main h2 {
    font-size: 1.5rem;
  }
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-blue);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.9s linear infinite;
  margin: 2rem auto;
  display: none;
}

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