/* BW Lernplattform - Karteikarten-Styles */

.flashcard-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--nav-height));
}

/* Sidebar */
.fc-sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-md);
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}

.fc-topic-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  margin-bottom: 4px;
  transition: all var(--transition);
}

.fc-topic-btn:hover { background: var(--color-surface-2); color: var(--color-text); }

.fc-topic-btn.is-active {
  background: rgba(201,168,76,0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}

/* Hauptbereich */
.fc-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl);
}

.fc-header {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.fc-progress-info {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Karteikarte */
.fc-card-wrapper {
  width: 100%;
  max-width: 600px;
  perspective: 1000px;
  margin-bottom: var(--space-xl);
}

.fc-card {
  width: 100%;
  /* Grid: beide Faces liegen in derselben Zelle → Höhe passt sich dem Inhalt an */
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.fc-card.is-flipped { transform: rotateY(180deg); }

.fc-card__face {
  /* Beide Faces in derselbe Grid-Zelle stapeln */
  grid-area: 1 / 1;
  min-height: 260px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-2xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.fc-card__front {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
  border: 1px solid var(--color-border);
}

.fc-card__back {
  background: linear-gradient(135deg, var(--color-surface-2) 0%, var(--color-primary-dark) 100%);
  border: 1px solid var(--color-primary);
  transform: rotateY(180deg);
}

.fc-card__label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-text-dim);
  margin-bottom: var(--space-lg);
}

.fc-card__front .fc-card__label { color: var(--color-accent); }
.fc-card__back .fc-card__label  { color: var(--color-primary-light); }

.fc-card__content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre-wrap;
  text-align: left;
  max-width: 100%;
}

.fc-card__front .fc-card__content {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
}

.fc-card__flip-hint {
  margin-top: var(--space-lg);
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

/* Bewertungs-Buttons */
.fc-rating {
  display: flex;
  gap: var(--space-md);
  width: 100%;
  max-width: 600px;
  margin-bottom: var(--space-xl);
}

.fc-rating-btn {
  flex: 1;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.fc-rating-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.fc-rating-btn--wrong:hover:not(:disabled) {
  border-color: var(--color-error);
  color: var(--color-error);
  background: rgba(192,57,43,0.05);
}

.fc-rating-btn--unsure:hover:not(:disabled) {
  border-color: var(--color-warning);
  color: var(--color-warning);
  background: rgba(230,126,34,0.05);
}

.fc-rating-btn--correct:hover:not(:disabled) {
  border-color: var(--color-success);
  color: var(--color-success);
  background: rgba(74,156,110,0.05);
}

.fc-rating-btn:disabled { opacity: 0.4; cursor: default; }
.fc-rating-icon { font-size: 1.25rem; }

/* Session-Ende */
.fc-session-end {
  width: 100%;
  max-width: 600px;
  text-align: center;
  padding: var(--space-2xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.fc-session-end__icon { font-size: 3rem; margin-bottom: var(--space-md); }
.fc-session-end__title { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: var(--space-md); }
.fc-session-stats { display: flex; justify-content: center; gap: var(--space-xl); margin: var(--space-lg) 0; }

/* Placeholder */
.fc-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  color: var(--color-text-muted);
  gap: var(--space-md);
}

/* Responsive */
@media (max-width: 768px) {
  .flashcard-layout { grid-template-columns: 1fr; }
  .fc-sidebar { position: static; height: auto; max-height: 160px; display: flex; flex-wrap: wrap; gap: 4px; }
  .fc-topic-btn { margin-bottom: 0; flex: 0 0 auto; font-size: 0.8rem; }
  .fc-card__face { padding: var(--space-lg); min-height: 200px; }
  .fc-rating { gap: var(--space-sm); }
  .fc-rating-btn { font-size: 0.75rem; padding: var(--space-sm); }
}
