/* ============================================================================
   VOCABULARY LAB - Estilos
   ========================================================================= */

.vocab-lab {
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.vocab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--neon, hsl(272, 100%, 68%));
}

.vocab-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: inherit;
}

.vocab-level-badge {
  background: linear-gradient(135deg, var(--neon, hsl(272, 100%, 68%)), var(--neon-2, hsl(187, 100%, 55%)));
  color: white;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
}

/* ─── TABS ─────────────────────────────────────────────────────────────── */

.vocab-view-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark .vocab-view-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.vocab-tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.vocab-tab:hover {
  color: inherit;
}

.vocab-tab.active {
  color: var(--neon, hsl(272, 100%, 68%));
  border-bottom-color: var(--neon, hsl(272, 100%, 68%));
}

/* ─── VISTAS ───────────────────────────────────────────────────────────── */

.vocab-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.vocab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── LISTA DE PALABRAS ────────────────────────────────────────────────── */

.vocab-list {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.vocab-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  transition: all 0.2s ease;
}

body.dark .vocab-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.vocab-item:hover {
  border-color: var(--neon, hsl(272, 100%, 68%));
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
}

.vocab-item-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.vocab-item-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.vocab-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.vocab-word {
  font-weight: 800;
  font-size: 1.1rem;
  color: inherit;
}

.vocab-pronunciation {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.vocab-toggle {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
  color: var(--muted);
}

.vocab-item-content {
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.3);
  display: grid;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

body.dark .vocab-item-content {
  background: rgba(255, 255, 255, 0.02);
  border-top-color: rgba(255, 255, 255, 0.05);
}

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

.vocab-item-content.hidden {
  display: none;
}

.vocab-definition,
.vocab-example {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: inherit;
}

.vocab-definition strong,
.vocab-example strong {
  color: var(--neon, hsl(272, 100%, 68%));
  font-weight: 700;
}

/* ─── EJERCICIOS ───────────────────────────────────────────────────────── */

.vocab-exercise,
.exercise-fill,
.exercise-multiple {
  display: grid;
  gap: 10px;
}

.vocab-exercise p,
.exercise-fill p,
.exercise-multiple p {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.fill-options,
.multiple-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fill-btn,
.multiple-btn {
  padding: 10px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: inherit;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

body.dark .fill-btn,
body.dark .multiple-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.fill-btn:hover:not(:disabled),
.multiple-btn:hover:not(:disabled) {
  border-color: var(--neon, hsl(272, 100%, 68%));
  background: var(--neon-soft, rgba(124, 58, 237, 0.1));
}

.fill-btn.correct,
.multiple-btn.correct {
  background: rgba(46, 213, 115, 0.2);
  border-color: hsl(150, 62%, 44%);
  color: hsl(150, 62%, 30%);
}

body.dark .fill-btn.correct,
body.dark .multiple-btn.correct {
  color: hsl(150, 65%, 70%);
}

.fill-btn.incorrect,
.multiple-btn.incorrect {
  background: rgba(239, 71, 111, 0.2);
  border-color: hsl(354, 78%, 58%);
  color: hsl(354, 68%, 46%);
}

body.dark .fill-btn.incorrect,
body.dark .multiple-btn.incorrect {
  color: hsl(354, 90%, 74%);
}

.fill-btn:disabled,
.multiple-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.exercise-feedback {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(46, 213, 115, 0.1);
}

.exercise-feedback.hidden {
  display: none;
}

/* ─── FLASHCARDS ───────────────────────────────────────────────────────── */

.flashcard-container {
  perspective: 1000px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  padding: 20px;
}

.flashcard {
  width: 100%;
  max-width: 500px;
  height: 300px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--neon, hsl(272, 100%, 68%)) 0%, var(--neon-2, hsl(187, 100%, 55%)) 100%);
  box-shadow: 0 20px 50px rgba(124, 58, 237, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

.flashcard:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(124, 58, 237, 0.4);
}

.flashcard-front,
.flashcard-back {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.flashcard-emoji {
  font-size: 4rem;
  line-height: 1;
}

.flashcard-word {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.flashcard-definition {
  font-size: 1rem;
  opacity: 0.9;
}

.flashcard-example {
  font-size: 0.9rem;
  opacity: 0.85;
  font-style: italic;
  max-width: 80%;
}

/* ─── CONTROLES FLASHCARD ──────────────────────────────────────────────── */

.flashcard-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.flash-btn {
  padding: 12px 24px;
  border: 1.5px solid var(--neon, hsl(272, 100%, 68%));
  background: transparent;
  color: var(--neon, hsl(272, 100%, 68%));
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
}

.flash-btn:hover {
  background: var(--neon, hsl(272, 100%, 68%));
  color: white;
}

.flash-counter {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
}

.flashcard-exercise {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
}

body.dark .flashcard-exercise {
  background: rgba(255, 255, 255, 0.05);
}

/* ─── QUIZ ─────────────────────────────────────────────────────────────── */

.vocab-quiz-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--neon, hsl(272, 100%, 68%)), var(--neon-2, hsl(187, 100%, 55%)));
  color: white;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vocab-quiz-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

/* ─── MODAL QUIZ ───────────────────────────────────────────────────────── */

.vocab-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
}

.vocab-modal.hidden {
  display: none;
}

.vocab-modal-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

body.dark .vocab-modal-content {
  background: #1a1a2e;
  color: white;
}

.vocab-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s ease;
}

.vocab-modal-close:hover {
  color: inherit;
}

.vocab-modal-content h3 {
  margin: 0 0 24px;
  font-size: 1.5rem;
  color: var(--neon, hsl(272, 100%, 68%));
}

.quiz-question {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark .quiz-question {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.quiz-question p {
  margin: 0;
  font-weight: 700;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  padding: 12px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  color: inherit;
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s ease;
}

body.dark .quiz-option {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--neon, hsl(272, 100%, 68%));
  background: var(--neon-soft, rgba(124, 58, 237, 0.1));
}

.quiz-option.correct {
  background: rgba(46, 213, 115, 0.2);
  border-color: hsl(150, 62%, 44%);
}

.quiz-option.incorrect {
  background: rgba(239, 71, 111, 0.2);
  border-color: hsl(354, 78%, 58%);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-feedback {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 0;
}

.quiz-feedback.hidden {
  display: none;
}

.quiz-submit {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--neon, hsl(272, 100%, 68%)), var(--neon-2, hsl(187, 100%, 55%)));
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .vocab-lab {
    padding: 16px;
  }

  .vocab-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .vocab-header h2 {
    font-size: 1.4rem;
  }

  .flashcard-container {
    min-height: 300px;
  }

  .flashcard {
    height: 250px;
  }

  .flashcard-emoji {
    font-size: 3rem;
  }

  .flashcard-word {
    font-size: 1.5rem;
  }

  .flashcard-controls {
    flex-direction: column;
    gap: 12px;
  }

  .flash-btn {
    width: 100%;
  }

  .vocab-modal-content {
    padding: 20px;
    margin: 20px;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }
}
