/* ============================================================
   CIVICEDGE FLASHCARDS — CLEAN, CONSOLIDATED, FINAL VERSION
   ============================================================ */

/* Layout */
#flashcardsApp {
  display: grid;
  gap: 24px;
  align-items: center;
  justify-items: center;
  text-align: center;
  margin-top: 20px;
}

/* -------------------------------
   TOPIC SELECTOR
-------------------------------- */

.fc-topics-wrapper {
  max-width: 720px;
  width: 100%;
}

.fc-topic-toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 20px;
}

.topic-chip {
  font-family: "Space Grotesk", sans-serif !important;
  padding: 10px 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 15px;
  user-select: none;
  transition: 0.15s ease;
}

.topic-chip:hover,
.topic-chip.selected {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* FIX: Remove Chrome active/focus flash */
.topic-chip:focus,
.topic-chip:active {
  outline: none !important;
  box-shadow: none !important;
  transition: none !important;
}

.topic-chip.selected:focus,
.topic-chip.selected:active {
  background: var(--brand) !important;
  color: #fff !important;
  border-color: var(--brand) !important;
}

/* -------------------------------
   COMMENCER BUTTON — FIXED
-------------------------------- */

#startBtn.fc-btn-primary {
  font-family: "Space Grotesk", sans-serif !important;
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  margin-top: 10px;
  transition: background .2s, transform .15s ease;
}

#startBtn.fc-btn-primary:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

/* -------------------------------
   CARD + FLIP
-------------------------------- */

.flashcard {
  width: 100%;
  max-width: 460px;
  height: 260px;
  perspective: 1000px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .6s;
  transform-style: preserve-3d;
  cursor: pointer;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Flip */
.flashcard.flipped .card-inner {
  transform: rotateY(180deg);
}

/* Faces */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 20px;
  border-radius: var(--radius);
}

.card-front {
  color: var(--ink);
}

.card-back {
  transform: rotateY(180deg);
  background: var(--brand);
  color: #fff;
}

/* Placeholder before start */
.flashcard.placeholder {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background-color: var(--card);
  background-image: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: .35;
  transition: opacity .3s ease;
}

.flashcard.placeholder .card-inner {
  display: none !important;
}

/* -------------------------------
   CONTROLS
-------------------------------- */

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.controls button {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: all .2s ease;
}

.controls button:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.controls button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.controls button.primary:hover {
  filter: brightness(1.05);
}

/* Navigation */
.controls-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}

.fc-nav svg {
  display: block;
}

/* Status line */
.fc-status {
  margin-top: 10px;
  font-size: 15px;
  color: #555;
}

/* Layout alignment */
.flashcards-layout.left {
  max-width: 760px;
  margin-left: 0;
  margin-right: auto;
  padding-left: 20px;
}

/* Disable micro-flash during transitions */
.no-transition .card-inner {
  transition: none !important;
}
