/* Flashcards Section Styles */
.flashcards-view {
  display: flex !important;
  justify-content: center;
  align-items: center;
  min-height: auto;
  width: 100%;
  padding: 1rem;
  perspective: 1000px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: clamp(450px, 75vh, 850px);
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

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

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%; /* Changed from 88% to fill the 850px container */
  backface-visibility: hidden;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

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

/* Front Side */
.flashcard-front-content {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 2rem; gap: 3rem; /* Slightly more gap for the large card */
}

.ipa-text {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 500;
  color: #ff0080;
  margin-top: 1rem;
}

.flashcard-play-large svg {
  width: clamp(60px, 15vw, 100px); 
  height: clamp(60px, 15vw, 100px);
  fill: #334155;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.show-answer-bar {
  background: #37474f;
  width: 100%;
  padding: 1.5rem; /* Increased padding */
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem; /* Slightly larger text */
  text-transform: capitalize;
  margin-top: auto; /* Ensures it stays at the very bottom */
}

/* Back Side */
.flashcard-header {
  padding: 1.5rem; /* More padding */
  text-align: center;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.flashcard-word {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 800;
  color: #ff0080;
  text-transform: lowercase;
}

.flashcard-image-container {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: center;
}

.flashcard-image {
  width: 100%; 
  height: clamp(180px, 30vh, 320px);
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.flashcard-body {
  padding: 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

.flashcard-meaning {
  font-size: clamp(1rem, 4vw, 1.4rem);
  color: #00acc1;
}

.flashcard-controls {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 1.5rem;
}

.flashcard-play-btn {
  background: #f1f5f9;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #334155;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.flashcard-play-btn:hover {
  background: #e2e8f0;
  transform: scale(1.1);
}

.flashcard-play-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.flashcard-footer-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  margin-top: auto; /* CRITICAL: Pushes buttons to the absolute bottom */
}

.sr-btn {
  border: none;
  padding: 1.25rem 0.5rem;
  color: #fff;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.3rem;
}

.sr-btn.again { background: #f44336; }
.sr-btn.hard { background: #546e7a; }
.sr-btn.good { background: #4caf50; }
.sr-btn.easy { background: #03a9f4; }

@media (max-width: 480px) {
  .flashcard-footer-btns {
    grid-template-columns: repeat(2, 1fr);
  }
  .flashcard-controls {
    gap: 1rem;
    padding: 0.5rem;
  }
  .flashcard-front-content {
    gap: 1.5rem;
  }
  .flashcard-body {
    padding: 0.5rem 1rem;
    gap: 0.8rem;
  }
}
