﻿/* Estilos base para pantalla completa */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: auto;
  font-size: 16px;
}

/* Header compacto */
.imagen1 {
  max-height: 40px !important;
  width: auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-wrap {
  position: relative;
}

.menu-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #ffffff;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.menu-line {
  width: 1rem;
  height: 2px;
  background: #495057;
  border-radius: 2px;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 1200;
}

.menu-item {
  width: 100%;
  border: none;
  border-radius: 6px;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  font-size: 0.95rem;
  color: #212529;
  cursor: pointer;
}

.menu-item:hover {
  background: #f1f3f5;
}

#navigation {
  display: flex;
  align-items: center;
}

#navigation button {
  padding: 6px 12px;
  font-size: 1.1rem;
  border: 1px solid #ccc;
  background: white;
  border-radius: 4px;
}

/* Botones de ejercicios mÃ¡s compactos */
#opciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: #f5f5f5;
  border-radius: 4px;
  margin: 4px auto;
  max-width: 95%;
}

#opciones button {
  height: 2.0rem;
  min-width: 2.4rem;
  border: none;
  border-radius: 6px;
  background: #e9ecef;
  margin: 0;
  box-shadow: inset 0 -0.1rem 0 rgba(0, 0, 0, 0.1);
  cursor: pointer;
  color: #495057;
  font-weight: bold;
  font-size: 1rem;
  padding: 0 8px;
  transition: all 0.2s;
}

#opciones button:hover {
  background: #dee2e6;
}

.boton-actual {
  background-color: rgb(242, 56, 5) !important;
  color: white !important;
}

/* Contenedor principal del ejercicio */
#lessonView {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#pra1 {
  flex: 1;
  width: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

/* Estilos para el modo carrusel (mobile_mode) */
#mobile-card {
  flex: 1;
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 5px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  overflow: auto;
  height: 100%;
}

/* Barra de progreso mejorada */
.progress-section {
  width: 95%;
  margin: 8px auto;
  flex-shrink: 0;
}

.progress-bar-container {
  width: 100%;
  background-color: #e9ecef;
  border-radius: 10px;
  height: 12px;
  overflow: auto;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #28a745, #20c997);
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* Botones de navegaciÃ³n */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  width: 95%;
  margin: 4px auto;
  flex-shrink: 0;
}

.touch-btn {
  font-size: 1.3rem;
  padding: 6px 10px;
  border-radius: 4px;
  background: #007bff;
  color: white;
  border: none;
  min-width: 220px;
  cursor: pointer;
}

.touch-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.touch-btn:active:not(:disabled) {
  background: #0056b3;
}

/* Footer compacto */
/* Ajustes para escritorio */
@media (min-width: 769px) {
  #opciones button {
    min-width: 3rem;
    height: 2.5rem;
    font-size: 1.1rem;
  }

  .touch-btn {
    font-size: 1.4rem;
    padding: 14px 25px;
  }
}

/* Ajustes para mÃ³viles pequeÃ±os */
@media (max-width: 480px) {
  .header {
    padding: 2px 5px;
  }

  .imagen1 {
    max-height: 35px !important;
  }

  #opciones {
    gap: 2px;
  }

  #opciones button {
    min-width: 2.5rem;
    height: 2rem;
    font-size: 0.9rem;
  }

  .ex7-input {
    font-size: 1.1rem !important;
    width: min(72%, 300px) !important;
  }

  .ex7-send-btn {
    min-width: 5rem;
    height: 2.4rem;
    font-size: 0.9rem;
    padding: 0 10px;
  }

  .ex7-result {
    font-size: 1.15rem;
  }

  .ex8-input-row {
    flex-direction: column;
    align-items: center;
  }

  .ex8-input {
    width: min(94%, 360px) !important;
    min-height: 110px;
    font-size: 1rem !important;
  }

  .ex8-send-btn {
    margin-top: 4px;
    min-width: 5.5rem;
    height: 2.4rem;
    font-size: 0.9rem;
  }

  .ex8-result {
    font-size: 1.05rem;
  }
}

/* Mantener los estilos existentes para colores y utilidades */
.x {
  color: #aeb4b9;
}

.r {
  color: #dc3545;
}

.a {
  color: #950aecea;
}

.e {
  color: #28a745;
}

.i {
  color: #ff00ff;
}

.o {
  color: #007bff;
}

.u {
  color: #f6da08f0;
}

.italic {
  font-style: italic;
}

.underline {
  text-decoration: underline;
}

.bold {
  font-weight: bold;
}

.strike {
  text-decoration: line-through;
}

/* Animaciones de medalla (mantener) */
@keyframes spinMedal {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.2) rotate(-180deg);
    opacity: 0;
  }

  60% {
    transform: scale(1.2) rotate(20deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes shineEffect {
  0% {
    box-shadow: 0 0 0px gold;
  }

  50% {
    box-shadow: 0 0 40px gold, 0 0 80px orange;
  }

  100% {
    box-shadow: 0 0 0px gold;
  }
}

.medal-animate {
  animation: popIn 1.2s ease-out, spinMedal 8s linear infinite, shineEffect 2s ease-in-out infinite;
}

.victory-background {
  background: linear-gradient(45deg, #ffcc00, #ffffff, #ff9900);
  background-size: 400% 400%;
  animation: victoryGradient 8s ease infinite;
}

@keyframes victoryGradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}


/* Contenedor horizontal para botones de control */
.button-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.button-row button,
.button-row span {
  margin: 0 !important;
  padding: 8px 12px;
  font-size: 1.2rem !important;
  border: none;
  border-radius: 6px;
  background: #007bff;
  color: white;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-row span {
  background: #28a745 !important;
}

.button-row button:hover,
.button-row span:hover {
  opacity: 0.9;
}

/* Ajustar iconos dentro de los botones */
.button-row .icon-mic,
.button-row .icon-eye {
  font-size: 1.9rem !important;
  margin: 0 !important;
  padding: 8px !important;
}

/* Uniformar los 4 controles: mic, US, GB y ojo */
.button-row .ctl-btn,
.controls-row .ctl-btn {
  width: 3rem;
  min-width: 3rem;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 !important;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.button-row .ctl-btn--audio,
.controls-row .ctl-btn--audio {
  font-size: 1.1rem !important;
  line-height: 1;
}

.button-row .ctl-btn--icon,
.controls-row .ctl-btn--icon {
  font-size: 1.5rem !important;
}

.button-row .ctl-btn--nav,
.controls-row .ctl-btn--nav {
  background: #007bff !important;
}

.button-row .ctl-btn--nav:disabled,
.controls-row .ctl-btn--nav:disabled {
  background: #6c757d !important;
  cursor: not-allowed;
}

.ipa-code-word {
  display: inline-block;
  white-space: nowrap;
  vertical-align: baseline;
}

/* Botones especÃ­ficos */
.button-row button:nth-child(2) {
  /* US ðŸŽ§ */
  background: #dc3545 !important;
}

.button-row button:nth-child(3) {
  /* GB ðŸŽ§ */
  background: #6f42c1 !important;
}

/* Para mÃ³viles pequeÃ±os */
@media (max-width: 480px) {
  .button-row {
    gap: 5px;
  }

  .button-row button,
  .button-row span {
    padding: 6px 10px;
    font-size: 1rem !important;
    min-height: 35px;
  }

  .button-row .ctl-btn,
  .controls-row .ctl-btn {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2rem;
    min-height: 2rem;
  }
}


/* Ajustar el contenedor principal del ejercicio */
.exercise-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 5px 0;
  text-align: center;
}

/* Mejorar el textarea para ejercicio 8 */
.ta1 {
  width: 100% !important;
  max-width: 100% !important;
  margin: 10px auto !important;
  padding: 10px !important;
  border: 2px solid #ddd !important;
  border-radius: 4px !important;
  font-size: 1rem !important;
  resize: vertical !important;
}

/* Ajustar inputs grandes */
.big-input {
  font-size: 2.5rem !important;
  width: 95% !important;
  max-width: 600px !important;
  margin: 0 auto 15px auto !important;
  padding: 12px !important;
}

/* Ejercicio 7: input + boton Enviar */
.ex7-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.ex7-input {
  font-size: 1.25rem !important;
  width: min(80%, 520px) !important;
  max-width: 520px !important;
  margin: 0 !important;
}

.ex7-send-btn {
  height: 2.9rem;
  min-width: 6rem;
  border: none;
  border-radius: 8px;
  background: #007bff;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
}

.ex7-send-btn:active {
  background: #0056b3;
}

.ex7-result {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  line-height: 1.35;
  word-break: break-word;
}

.ex7-result .e {
  color: #28a745;
}

.ex7-result .r {
  color: #dc3545;
}

/* Ejercicio 8: textarea grande + boton Enviar + resultado */
.ex8-input-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.ex8-input {
  width: min(92%, 680px) !important;
  max-width: 680px !important;
  min-height: 120px;
  font-size: 1.05rem !important;
  line-height: 1.35;
}

.ex8-send-btn {
  height: 2.8rem;
  min-width: 6rem;
  border: none;
  border-radius: 8px;
  background: #007bff;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
  margin-top: 10px;
}

.ex8-send-btn:active {
  background: #0056b3;
}

.ex8-result {
  display: block;
  margin-top: 6px;
  margin-bottom: 8px;
  font-size: 1.2rem;
  line-height: 1.35;
  word-break: break-word;
}

.ex8-result .e {
  color: #28a745;
}

.ex8-result .r {
  color: #dc3545;
}




/* ======== SECCIÃ“N DE LECCIÃ“NES DESPLAZABLE ======== */

#lessonPicker {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 5px;
  align-content: start;
}

.cards-grid {
  width: 100%;
  height: 100%;
}

/* Tarjetas de lecciones */
.lesson-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #e9ecef;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: #007bff;
}

.lesson-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.3rem;
  color: #333;
}

.lesson-card p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

/* ======== AJUSTES PARA EL CONTENEDOR PRINCIPAL ======== */

#contenedor {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  transform: scale(0.8);
  transform-origin: top center;
  width: 111.11%;
  /* Compensa la reducción para evitar márgenes */
}

/* Header fijo */
.header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

/* Footer fijo */
footer {
  flex-shrink: 0;
  padding: 8px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

/* ======== RESPONSIVE PARA LECCIÃ“NES ======== */

@media (max-width: 768px) {
  #lessonPicker {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 5px;
    padding: 10px;
  }

  .lesson-card {
    padding: 15px;
    min-height: 100px;
  }

  .lesson-card h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  #lessonPicker {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 8px;
  }

  .lesson-card {
    padding: 12px;
    min-height: 90px;
  }

  .lesson-card h3 {
    font-size: 1rem;
  }
}

/* ======== SCROLLBAR PERSONALIZADO ======== */

#lessonPicker::-webkit-scrollbar {
  width: 8px;
}

#lessonPicker::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#lessonPicker::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

#lessonPicker::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}





/* ======== NUEVA DISPOSICIÃ“N DE CONTROLES Y NAVEGACIÃ“N ======== */

.controls-container {
  --ctl-size: 3rem;
  --ctl-gap: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 15px 0;
  width: 100%;
}

.controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--ctl-gap);
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
}

.progress-info {
  text-align: center;
}

/* Ajustar los botones de control para que quepan mejor */
.controls-row button,
.controls-row span {
  margin: 0 !important;
  padding: 8px 12px;
  font-size: 1.1rem !important;
  border: none;
  border-radius: 6px;
  background: #007bff;
  color: white;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.controls-row span {
  background: #28a745 !important;
}

.controls-row button:nth-child(2) {
  /* US ðŸŽ§ */
  background: #dc3545 !important;
}

.controls-row button:nth-child(3) {
  /* GB ðŸŽ§ */
  background: #6f42c1 !important;
}

/* Para mÃ³viles pequeÃ±os */
@media (max-width: 480px) {
  .controls-container {
    --ctl-size: 2.5rem;
  }

  .controls-row {
    gap: 5px;
  }

  .controls-row button,
  .controls-row span {
    padding: 6px 10px;
    font-size: 1rem !important;
    min-height: 35px;
  }

}


/* Ocultar navegaciÃ³n del header en vista de lecciÃ³n */
#lessonView~footer+header #navigation,
#lessonView~header #navigation {
  display: none;
}

/* Mostrar solo en vista de selecciÃ³n de lecciÃ³n */
#lessonPicker~header #navigation {
  display: flex;
}


