/* ==========================================================================
   DanskVocab - Flashcards & Grammar Drills Styling
   ========================================================================== */

/* Flashcard Study Layout */
.study-container {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.study-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.study-progress-wrapper {
  flex: 1;
  min-width: 200px;
}

.study-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.study-progress-bar-bg {
  height: 8px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.study-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), hsl(351, 90%, 60%));
  border-radius: var(--radius-full);
  transition: width 300ms ease;
  width: 0%;
}

.study-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 3D Flip Card Container */
.flashcard-scene {
  perspective: 1200px;
  width: 100%;
  min-height: 420px;
  cursor: pointer;
  user-select: none;
}

.flashcard {
  width: 100%;
  height: 100%;
  min-height: 420px;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: var(--radius-xl);
}

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

.flashcard-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 2px solid var(--border-light);
  box-shadow: var(--shadow-card);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.flashcard-face-back {
  transform: rotateY(180deg);
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
}

/* Card Front Elements */
.card-face-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-face-center {
  margin: auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.card-word-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.card-ipa-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-muted);
}

.card-hint-text {
  font-size: 0.95rem;
  color: var(--text-subtle);
  font-style: italic;
}

.card-face-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Card Back Elements */
.card-back-translation {
  text-align: center;
  margin-bottom: 1.25rem;
}

.card-back-eng {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-back-grammar {
  margin: 1rem 0;
}

.card-back-example {
  background: var(--bg-surface-subtle);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
  margin-top: 0.75rem;
  text-align: left;
}

/* SRS Rating Action Bar */
.srs-action-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
}

@media (max-width: 640px) {
  .srs-action-bar {
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    gap: 0.4rem;
  }
}

.srs-action-bar.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.btn-srs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: var(--font-main);
  transition: all var(--transition-fast);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.btn-srs:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.srs-rating-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.srs-rating-interval {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 0.2rem;
}

.srs-key-hint {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.08);
  margin-top: 0.35rem;
}

.btn-srs-again {
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.btn-srs-again:hover {
  background: var(--color-danger-bg);
}

.btn-srs-hard {
  border-color: var(--color-warning);
  color: var(--color-warning);
}
.btn-srs-hard:hover {
  background: var(--color-warning-bg);
}

.btn-srs-good {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-srs-good:hover {
  background: var(--color-primary-subtle);
}

.btn-srs-easy {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.btn-srs-easy:hover {
  background: var(--color-accent-light);
}

.btn-srs-learnt {
  border-color: var(--color-success);
  color: var(--color-success);
}
.btn-srs-learnt:hover {
  background: var(--color-success-bg);
}

/* Empty or Finished State */
.study-empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* Grammar Drill / Quiz Mode */
.drill-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
}

.drill-prompt-box {
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin: 1.25rem 0 1.75rem 0;
  border: 1px solid var(--border-light);
}

.drill-task-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.drill-target-word {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.drill-instruction {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.drill-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 500px) {
  .drill-options-grid {
    grid-template-columns: 1fr;
  }
}

.drill-option-btn {
  padding: 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  background: var(--bg-surface-subtle);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.drill-option-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.drill-option-btn.correct {
  border-color: var(--color-success) !important;
  background: var(--color-success-bg) !important;
  color: var(--color-success) !important;
}

.drill-option-btn.incorrect {
  border-color: var(--color-danger) !important;
  background: var(--color-danger-bg) !important;
  color: var(--color-danger) !important;
}

.drill-feedback-box {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  display: none;
  animation: fadeIn 200ms ease-out forwards;
}

.drill-feedback-box.correct {
  display: block;
  background: var(--color-success-bg);
  border: 1px solid var(--color-success);
  color: var(--color-success);
}

.drill-feedback-box.incorrect {
  display: block;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
}
