/* Global Styles */
:root {
  --primary-color: #4338ca;
  --primary-hover: #3730a3;
  --bg-color: #f4f6fb;
  --text-color: #1f2937;
  --text-muted: #6b7280;
  --card-bg: #ffffff;
  --border-radius: 12px;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

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

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Typography */
h1, h2, h3 {
  color: var(--text-color);
}
h1.page-title {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}
p.page-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s;
  width: 100%;
  font-size: 1rem;
}
.btn:hover {
  background-color: var(--primary-hover);
}
.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}
.btn-outline:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* Cards & Layout */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  border: 1px solid var(--primary-color);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }

/* Navigation */
.navbar {
  background: var(--card-bg);
  padding: 1rem 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.navbar-brand {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--primary-color);
}
.nav-links a {
  margin-left: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-links a:hover {
  color: var(--primary-color);
}

/* Quiz Specific */
.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}
.option-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.option-btn.selected {
  background: #e0e7ff;
  border-color: var(--primary-color);
  color: var(--primary-hover);
}
.option-btn.correct {
  background: #d1fae5;
  border-color: var(--success);
  color: #065f46;
}
.option-btn.wrong {
  background: #fee2e2;
  border-color: var(--danger);
  color: #991b1b;
}

/* Flashcard */
.flashcard-container {
  perspective: 1000px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 2rem;
  height: 250px;
}
.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}
.flashcard.flipped {
  transform: rotateY(180deg);
}
.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  font-size: 1.25rem;
  font-weight: 500;
}
.flashcard-front {
  background: var(--card-bg);
  border: 2px solid var(--primary-color);
  color: var(--text-color);
}
.flashcard-back {
  background: var(--primary-color);
  color: white;
  transform: rotateY(180deg);
}

.hidden {
  display: none !important;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
