:root {
  --green-dark: #1f4d3a;
  --green: #2e7d5b;
  --orange: #f4a261;
  --bg: #f7f9f8;
  --text: #1a1a1a;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ================= NAVIGATION ================= */
.logo a {
  all: unset;
  cursor: pointer;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: white;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 600;
  color: var(--green-dark);
}

.navbar nav a {
  text-decoration: none;
  margin-left: 1.5rem;
  color: var(--green-dark);
  font-weight: 500;
  transition: 0.2s ease;
}

.navbar nav a:hover {
  color: var(--orange);
}

/* ================= LAYOUT ================= */

.container {
  max-width: 1100px;
  margin: auto;
  padding: 3rem 1.5rem;
}

.hero {
  text-align: center;
  padding: 4rem 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  color: var(--green-dark);
  margin-bottom: 1rem;
}

/* ================= BUTTONS ================= */

.btn-primary {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--green);
  color: white;
  border-radius: 10px;
  text-decoration: none;
  transition: 0.2s ease;
}

.btn-primary:hover {
  background: var(--orange);
}

button {
  flex: 1;
  min-width: 100px;
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  background: #eef2f1;
}

#flip {
  background: var(--green);
  color: white;
  border: none;
}

#flip:hover {
  background: var(--orange);
}

/* ================= SELECT ================= */

select {
  width: 100%;
  max-width: 420px;
  padding: 12px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  margin: 1.5rem 0;
}

/* ================= FLASHCARD ================= */

.flashcards-page {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-container {
  width: 100%;
  max-width: 500px;
  perspective: 1200px;
  margin-bottom: 24px;
}

.card {
  width: 100%;
  aspect-ratio: 3 / 2;
  cursor: pointer;
}

.card-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  position: relative;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.4;
  backface-visibility: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
}

.card-front {
  background: white;
  font-weight: 500;
}

.card-back {
  background: var(--green);
  color: white;
  transform: rotateY(180deg);
}

.buttons {
  width: 100%;
  max-width: 500px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    gap: 10px;
  }

  .navbar nav a {
    margin-left: 0;
    margin-right: 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* ================= PAST PAPERS ================= */

.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 2rem;
}

.paper-card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
  transition: 0.2s ease;
}

.paper-card:hover {
  transform: translateY(-4px);
}

.paper-card h3 {
  margin-bottom: 6px;
  color: var(--green-dark);
}

.paper-card p {
  margin-bottom: 16px;
  font-size: 14px;
  color: #555;
}

.paper-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary {
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  background: var(--green);
  color: white;
  font-size: 14px;
  transition: 0.2s ease;
}

.btn-secondary:hover {
  background: var(--orange);
}

/* ================= TOPIC PRACTICE ================= */

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 2rem;
}

.topic-card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
  transition: 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.topic-card:hover {
  transform: translateY(-4px);
}

.topic-card h3 {
  margin-bottom: 10px;
  color: var(--green-dark);
}

.topic-card p {
  font-size: 14px;
  color: #555;
  margin-bottom: 20px;
  flex-grow: 1;
}
