/**
 * Shared Flashcard Component Styles
 * Extracted from calibration.html for reuse on /try and other pages.
 * 
 * Classes: .flashcard-container, .flashcard, .flashcard-word,
 *          .rating-buttons, .rating-btn, .progress-counter
 */

/* Flashcard container */
.flashcard-container {
  width: 100%;
  max-width: 480px;
  perspective: 1000px;
  margin: 0 auto;
}

/* Card */
.flashcard {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 48px 32px;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flashcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

/* Word display */
.flashcard-word {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-text, #1f2937);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Rating buttons */
.rating-buttons {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  width: 100%;
  max-width: 480px;
}

.rating-btn {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.rating-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rating-btn.good {
  background: var(--color-success, #22c55e);
  color: white;
}

.rating-btn.good:hover:not(:disabled) {
  background: #16a34a;
  transform: translateY(-2px);
}

.rating-btn.needs-practice {
  background: var(--color-warning, #f59e0b);
  color: white;
}

.rating-btn.needs-practice:hover:not(:disabled) {
  background: #d97706;
  transform: translateY(-2px);
}

/* Progress counter */
.progress-counter {
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
  text-align: center;
}

/* Visual feedback states */
.flashcard.flip-good {
  background: #dcfce7;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15);
}

.flashcard.flip-struggle {
  background: #fef3c7;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  .flashcard {
    padding: 36px 24px;
  }
}

/* Responsive - Phone */
@media (max-width: 480px) {
  .flashcard-word {
    font-size: 2.5rem;
  }
  .flashcard {
    padding: 28px 16px;
    min-height: 160px;
  }
  .rating-buttons {
    flex-direction: column;
  }
  .rating-btn {
    width: 100%;
  }
}

/* Dark mode */
[data-theme="dark"] .flashcard {
  background: var(--color-bg-card, #1e1e1e);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .flashcard:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .flashcard-word {
  color: var(--color-text, #e5e5e5);
}

[data-theme="dark"] .flashcard.flip-good {
  background: var(--color-success-light, #1a2e28);
}

[data-theme="dark"] .flashcard.flip-struggle {
  background: var(--color-warning-light, #2e2510);
}

/* ==========================================================================
   High-Contrast Color Blind Mode — Flashcards
   ========================================================================== */

/* Rating button good: green→blue */
[data-a11y="high-contrast"] .rating-btn.good {
  background: var(--color-success, #2563eb);
}
[data-a11y="high-contrast"] .rating-btn.good:hover:not(:disabled) {
  background: #1d4ed8;
}

/* Flip-good feedback: green→blue */
[data-a11y="high-contrast"] .flashcard.flip-good {
  background: #dbeafe;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

/* --- Dark + CB combined --- */
[data-theme="dark"][data-a11y="high-contrast"] .flashcard.flip-good {
  background: #1e3a5f;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}
