/* PhraseCards Stylesheet */
.phrasecards-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.phrasecards-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.phrasecards-header h1 {
  color: #004d99;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.phrasecards-header p {
  color: #666;
  font-size: 1.05rem;
}

.phrasecards-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.phrasecards-stat-card {
  background: #ffffff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-align: center;
  border-left: 4px solid #004d99;
}

.phrasecards-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #004d99;
}

.phrasecards-stat-label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 0.2rem;
}

.phrasecards-controls {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

.tts-config-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tts-engine-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tts-engine-selector label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

.tts-engine-selector select {
  padding: 0.35rem 0.65rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.speech-rate-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.speech-rate-control label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

/* Card Box Container */
#phraseCardBox {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Card Metadata Badge */
.card-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: #64748b;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f1f5f9;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: 500;
}

.card-meta-item.unit-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

/* Flashcard Component Override */
.phrasecard-wrapper {
  perspective: 1000px;
  margin-bottom: 1rem;
  cursor: pointer;
}

.phrasecard-inner {
  position: relative;
  width: 100%;
  min-height: 220px;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: 12px;
}

.phrasecard-wrapper.is-flipped .phrasecard-inner {
  transform: rotateY(180deg);
}

.phrasecard-front, .phrasecard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  min-height: 220px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.phrasecard-front {
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  color: #1e293b;
}

.phrasecard-back {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
  color: #0369a1;
  transform: rotateY(180deg);
}

.phrasecard-front p.english-text {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.phrasecard-back p.french-text {
  font-size: 1.45rem;
  font-weight: 700;
  color: #004d99;
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* Side Specific Action Buttons */
.card-side-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.btn-card-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-card-action * {
  pointer-events: none;
}

.btn-card-action:hover {
  background: #004d99;
  color: #ffffff;
  border-color: #004d99;
}

.btn-card-action.listening {
  background: #dc3545 !important;
  color: #ffffff !important;
  border-color: #dc3545 !important;
  animation: pulse-red 1.2s infinite;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.btn-card-action.listening i {
  color: #ffffff !important;
}

.hint-display-box {
  margin-top: 0.75rem;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

/* Pronunciation Score Result Box */
.accuracy-score-display {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.accuracy-score-display.good {
  color: #16a34a;
}

.accuracy-score-display.retry {
  color: #dc2626;
}

/* Bottom Navigation Controls */
.phrasecards-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.phrasecards-nav button {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.phrasecards-nav button:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.phrasecards-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.phrasecards-nav button.btn-primary-nav {
  background: #004d99;
  color: #ffffff;
  border-color: #004d99;
}

.phrasecards-nav button.btn-primary-nav:hover:not(:disabled) {
  background: #003366;
}

.card-counter {
  text-align: center;
  margin-top: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
