:root {
  --card-radius: 12px;
}

/* Base */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;

}

@media (max-width:500px) {
  .button-container {
    flex-direction: column;
  }

  .button-container button {
    width: 100%;
    margin-bottom: 10px;
  }
}



section {
  transition: opacity 0.18s ease-in-out;
}

/* Flashcard styles */
.flashcard {
  perspective: 1000px;
  min-height: 160px;
  position: relative;
}

.flashcard-inner {
  transition: transform 0.5s;
  transform-style: preserve-3d;
  position: relative;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  backface-visibility: hidden;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  text-align: center;
  font-size: 1rem;
}

.flashcard-back {
  transform: rotateY(180deg);
}

/* Small muted text helper */
.small-muted {
  font-size: 0.9rem;
  color: #6c757d;
}

/* Card adjustments for the library grid */
.card {
  border-radius: var(--card-radius);
  overflow: hidden;
}

.card-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

/* Optional: smooth fade-in when switching sections */
.d-none {
  opacity: 0;
  pointer-events: none;
}

section:not(.d-none) {
  opacity: 1;
  pointer-events: auto;
}

/* Margin helpers */
.mt-2 {
  margin-top: 0.5rem !important;
}

body.dark-mode {
  background-color: #121212;
  color: #e9ecef;
}

body.dark-mode .navbar {
  background-color: #212529 !important;
}

body.dark-mode .card {
  background-color: #1e1e1e;
  color: #f8f9fa;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

body.dark-mode textarea,
body.dark-mode input,
body.dark-mode select {
  background-color: #2a2a2a;
  color: #f8f9fa;
  border-color: #444;
}

body.dark-mode .btn-outline-secondary,
body.dark-mode .btn-outline-primary,
body.dark-mode .btn-outline-danger {
  color: #f8f9fa;
  border-color: #888;
}

body.dark-mode pre {
  color: #ccc;
}

body.dark-mode .flashcard-face {
  background-color: #1e1e1e;
  color: #f8f9fa;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.06);
}

body.dark-mode .text-muted,
body.dark-mode .small-muted {
  color: #bbb !important;
}