:root {
  --color-primario:  #10838b; /*Para ewncabezados y pies de página*/
  --color-secundario: #baa669bd;
  --color-secundario-solido: #3e898b;/*Para el navbar y otros elementos*/
  --color-claro: #f4f4f4; /*Para elementos de la página*/
  --color-fondo: #e4d7c7; /*Para el fondo de pantalla*/
  --color-texto: #333333;

  --espaciado: 1rem; /* Margen o separación estándar */
  --radio: 10px; /* Bordes redondeados */
  --sombra: 0 0 10px rgba(0, 0, 0, 0.1); /* Sombra suave alrededor de elementos */
  --fuente-base: "Segoe UI", sans-serif;
}
/* ----------------- Reset y Base ----------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: var(--fuente-base);
  background-color: var(--color-fondo);
  color: var(--color-texto);

  background-color: #e4d7c7;
  /**/
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 28' width='56' height='28'%3E%3Cpath fill='%239C92AC' fill-opacity='0.4' d='M56 26v2h-7.75c2.3-1.27 4.94-2 7.75-2zm-26 2a2 2 0 1 0-4 0h-4.09A25.98 25.98 0 0 0 0 16v-2c.67 0 1.34.02 2 .07V14a2 2 0 0 0-2-2v-2a4 4 0 0 1 3.98 3.6 28.09 28.09 0 0 1 2.8-3.86A8 8 0 0 0 0 6V4a9.99 9.99 0 0 1 8.17 4.23c.94-.95 1.96-1.83 3.03-2.63A13.98 13.98 0 0 0 0 0h7.75c2 1.1 3.73 2.63 5.1 4.45 1.12-.72 2.3-1.37 3.53-1.93A20.1 20.1 0 0 0 14.28 0h2.7c.45.56.88 1.14 1.29 1.74 1.3-.48 2.63-.87 4-1.15-.11-.2-.23-.4-.36-.59H26v.07a28.4 28.4 0 0 1 4 0V0h4.09l-.37.59c1.38.28 2.72.67 4.01 1.15.4-.6.84-1.18 1.3-1.74h2.69a20.1 20.1 0 0 0-2.1 2.52c1.23.56 2.41 1.2 3.54 1.93A16.08 16.08 0 0 1 48.25 0H56c-4.58 0-8.65 2.2-11.2 5.6 1.07.8 2.09 1.68 3.03 2.63A9.99 9.99 0 0 1 56 4v2a8 8 0 0 0-6.77 3.74c1.03 1.2 1.97 2.5 2.79 3.86A4 4 0 0 1 56 10v2a2 2 0 0 0-2 2.07 28.4 28.4 0 0 1 2-.07v2c-9.2 0-17.3 4.78-21.91 12H30zM7.75 28H0v-2c2.81 0 5.46.73 7.75 2zM56 20v2c-5.6 0-10.65 2.3-14.28 6h-2.7c4.04-4.89 10.15-8 16.98-8zm-39.03 8h-2.69C10.65 24.3 5.6 22 0 22v-2c6.83 0 12.94 3.11 16.97 8zm15.01-.4a28.09 28.09 0 0 1 2.8-3.86 8 8 0 0 0-13.55 0c1.03 1.2 1.97 2.5 2.79 3.86a4 4 0 0 1 7.96 0zm14.29-11.86c1.3-.48 2.63-.87 4-1.15a25.99 25.99 0 0 0-44.55 0c1.38.28 2.72.67 4.01 1.15a21.98 21.98 0 0 1 36.54 0zm-5.43 2.71c1.13-.72 2.3-1.37 3.54-1.93a19.98 19.98 0 0 0-32.76 0c1.23.56 2.41 1.2 3.54 1.93a15.98 15.98 0 0 1 25.68 0zm-4.67 3.78c.94-.95 1.96-1.83 3.03-2.63a13.98 13.98 0 0 0-22.4 0c1.07.8 2.09 1.68 3.03 2.63a9.99 9.99 0 0 1 16.34 0z'%3E%3C/path%3E%3C/svg%3E");
}

a {
  text-decoration: none;
  color: var(--color-primario);
}

/* ----------------- Layout General ----------------- */
.layout {
  display: grid; /*Organiza los elementos en una cuadricula*/
  grid-template-areas:/* Define 3 zonas con nombre (header, main, footer) en una sola columna vertical.*/
    "header"
    "main"
    "footer";
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

header,
footer {
  background-color: var(--color-primario);
  color: white;
  text-align: center;
}

header {
  grid-area: header;
  padding: 1.5rem;
  font-size: 1.5rem;
}

footer {
  grid-area: footer;
  padding: 1rem;
  font-size: 0.9rem;
}

main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: var(--espaciado);
  padding: 2rem;
}

/* ----------------- Navbar ----------------- */
.navbar {
  background-color: var(--color-secundario);
  padding: 0.75rem 1rem;
  box-shadow: var(--sombra);
}

.navbar-contenido {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.navbar-logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-enlaces {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.navbar-enlaces li a {
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease;
}

.navbar-enlaces li a:hover {
  background-color: #a07d24;
}

@media (max-width: 576px) {
  .navbar-contenido {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar-enlaces {
    flex-direction: column;
    width: 100%;
  }

  .navbar-enlaces li a {
    width: 100%;
  }
}

/* ----------------- Login ----------------- */
.contenedor-login {
  display: flex;
  flex-direction: column;
  gap: var(--espaciado);
}

@media (min-width: 768px) {
  .contenedor-login {
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 2rem;
  }

  .card {
    max-width: 450px;
  }

  .card-imagen {
    min-height: 250px;
  }
}

@media (max-width: 577px) {
  .contenedor-login {
    padding: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .card-imagen {
    min-height: 150px;
  }

  .logo {
    width: 60px;
    height: 60px;
  }

  .logo-titulo h1 {
    font-size: 1.2rem;
  }

  form label,
  form input,
  .btn {
    font-size: 0.9rem;
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  .contenedor-login {
    flex-direction: row;
    gap: 1rem;
  }

  .card-imagen {
    min-height: 200px;
  }

  .logo {
    width: 70px;
    height: 70px;
  }

  .logo-titulo h1 {
    font-size: 1.3rem;
  }
}
/* ----------- Distribución del formulario según resolución ----------- */
.formulario-registro {
  display: grid;
  gap: 1rem;
}

/* Pantallas pequeñas: 1 columna */
@media (max-width: 575.98px) {
  .formulario-registro {
    grid-template-columns: 1fr;
  }
}

/* Pantallas medianas: 2 columnas */
@media (min-width: 576px) and (max-width: 768.98px) {
  .formulario-registro {
    grid-template-columns: repeat(2, 1fr);
  }

  .formulario-registro label,
  .formulario-registro input,
  .formulario-registro select,
  .formulario-registro .avatar-selector,
  .formulario-registro .btn,
  .formulario-registro p {
    grid-column: span 2;
  }
}

/* Pantallas grandes: horizontal (dos columnas sin span) */
@media (min-width: 769px) {
  .formulario-registro {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
  }

  /* Algunos elementos ocupan toda la fila */
  .formulario-registro label[for="avatar"],
  .formulario-registro .avatar-selector,
  .formulario-registro .btn,
  .formulario-registro p,
  .formulario-registro #preview-avatar {
    grid-column: span 2;
  }
}
/* ----------------- Avatares ----------------- */
.avatar-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.avatar-option {
  cursor: pointer;
  text-align: center;
  border: 2px solid transparent;
  border-radius: var(--radio);
  padding: 0.5rem;
  transition: border-color 0.3s ease;
}

.avatar-option input[type="radio"] {
  display: none;
}

.avatar-option img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.avatar-option input[type="radio"]:checked + img,
.avatar-option:hover {
  border-color: var(--color-primario);
}

/* ----------------- Dashboard ----------------- */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}
.dashboard-header,
.dashboard-footer {
  background-color: var(--color-primario);
  color: white;
  text-align: left;
}

/* Menú lateral */
.sidebar {
  width: 240px;
  background-color: var(--color-secundario-solido);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  box-shadow: var(--sombra);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
}

.logo-sidebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  margin-bottom: 0.5rem;
  transition: background-color 0.3s ease;
}
.btn-cerrar-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: white;
  align-self: flex-end;
  margin-bottom: 1rem;
  cursor: pointer;
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 900;
  display: none;
}

.overlay.activa {
  display: block;
}

@media (max-width: 768px) {
  .btn-cerrar-menu {
    display: block;
  }
}

.sidebar-nav a:hover,
.sidebar-nav .cerrar-sesion:hover {
  /* Colo base MENÚ NAVEGACION */
  background-color: #c444cd;
}

.sidebar-nav .cerrar-sesion {
  background-color: #b71c1c;
}

.sidebar-nav .cerrar-sesion:hover {
  background-color: #7f0000;
}

/* Contenido a la derecha del sidebar */
.contenido-principal {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Ajustes para header y footer dentro del contenido */
.contenido-principal header,
.contenido-principal footer {
  width: 100%;
  height: 50%;
}
/* ----------------- Botón Hamburguesa ----------------- */
.btn-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: white;
  cursor: pointer;
}

@media (max-width: 768px) {
  .btn-menu {
    display: block;
  }
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -240px;
    height: 100%;
    width: 240px;
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .sidebar.activa {
    left: 0;
  }

  .contenido-principal {
    margin-left: 0;
  }

  .dashboard-layout {
    flex-direction: column;
  }
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: none;
}
.overlay.activo {
  display: block;
}

/* ----------------- Submenu ----------------- */
/* Estilo del contenedor y submenú */
.submenu-container {
  display: flex;
  flex-direction: column;
}

.submenu-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  color: white;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}

.submenu-toggle:hover {
  background-color: #24a03d;
}

.submenu {
  max-height: 0; /* Oculto por defecto */
  overflow: hidden;
  flex-direction: column;
  /* Color base submenú */
  background-color:#226b4f; 
  margin-left: 1rem;
  border-left: 2px solid white;
  transition: max-height 0.4s ease-in-out; /* Animación suave */
}

.submenu li {
  list-style: none;
}

.submenu li a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: block;
  font-size: 0.95rem;
}
/* Sombra submenu */
.submenu li a:hover {
  background-color: #63c9a2;
}

/* Mostrar submenu con animación */
.submenu.activo {
  max-height: 500px; /* Altura suficiente para el contenido */
}

/* ----------------- Perfil ----------------- */
.perfil-contenido {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .perfil-contenido {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
}

.perfil-avatar {
  text-align: center;
  flex: 1;
}

.perfil-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--sombra);
}

.perfil-datos {
  flex: 2;
}

.perfil-datos ul {
  list-style: none;
  padding: 0;
}

.perfil-datos li {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
/* ----------------- Perfil Responsivo ----------------- */
.perfil-contenido {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.perfil-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 100%;
  object-fit: cover;
  box-shadow: var(--sombra);
}

/* Tablets: diseño en fila con avatar a la izquierda */
@media (min-width: 576px) and (max-width: 768.98px) {
  .perfil-contenido {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  .perfil-avatar img {
    width: 250px;
    height: 250px;
  }

  .perfil-datos ul {
    font-size: 0.95rem;
  }
}

/* Pantallas grandes: diseño horizontal elegante */
@media (min-width: 769px) {
  .perfil-contenido {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 3rem;
  }

  .perfil-avatar img {
    width: 300px;
    height: 300px;
  }

  .perfil-datos ul {
    font-size: 1rem;
  }
}

.perfil-contenedor h2 {
  text-align: center;
  margin-bottom: 1rem;
}

/* ----------------- Tarjetas de estudio ----------------- */

/* Base: 1 columna por defecto */
#tarjetas {
  width: 100%; /* Garantiza uso total del espacio */
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  flex: 1; /* Si el contenedor padre usa flex */
}

form input[type="text"],
form textarea {
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
  padding: 0.75rem;
  border-radius: var(--radio);
  border: 1px solid #ccc;
  margin-bottom: 1rem;
}

/* Evitar que el contenedor padre (.card) limite el ancho */
.contenedor-login .card {
  max-width: 100% !important;
}

/* Desde 768px (tablets): 2 columnas */
@media (min-width: 768px) {
  #tarjetas {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desde 1200px (escritorio grande): 3 columnas */
@media (min-width: 1200px) {
  #tarjetas {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Estilos de cada tarjeta */
.tarjeta-form {
  background-color: var(--color-claro);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background-color 0.3s ease;
}

.tarjeta-form h4 {
  font-size: 1.1rem;
  color: var(--color-primario);
}

.tarjeta-form textarea,
.tarjeta-form input[type="file"] {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: var(--radio);
  padding: 0.5rem;
}

/* Botón eliminar tarjeta */
.btn-eliminar-tarjeta {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #b71c1c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-eliminar-tarjeta:hover {
  background-color: #7f0000;
}

/* Botón agregar tarjeta */
.btn-tarjeta {
  display: inline-block;
  background-color: var(--color-primario);
  color: white;
  padding: 0.75rem 1.2rem;
  border: none;
  border-radius: var(--radio);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-agregar-tarjeta:hover {
  background-color: var(--color-secundario);
}

/* ----------------- Carrusel ----------------- */
.carrusel-swbda-horizontal {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-horizontal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem;
}
.slide-horizontal.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}
.slide-horizontal img {
  width: 500px; /* ancho fijo */
  height: 250px; /* alto fijo */
  object-fit: contain; /* rellena el espacio sin deformar */
  object-position: center;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.mensaje-horizontal {
  flex: 1;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--color-primario);
  background-color: var(--color-claro);
  padding: 1rem;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  text-align: left;
}
.prev {
  left: 10px;
}

.next {
  right: 10px;
}
/* Controles debajo del carrusel */
.controles-carrusel {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.btn-carrusel {
  background-color: var(--color-secundario);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.btn-carrusel:hover {
  background-color: var(--color-primario);
}

@media (max-width: 768px) {
  .slide-horizontal img {
    width: 100%;
    height: 200px;
  }

  .mensaje-horizontal {
    font-size: 1rem;
    padding: 0.75rem;
  }
}

/* ----------------- Cards ----------------- */
.card,
.opcion-card {
  background-color: var(--color-claro);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 2rem;
}

.card {
  flex: 1;
  max-width: 100%;
  width: 100%;
  padding: 2rem;
}

.card-portada {
  background-image: url("../img/portada_estudiantes.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

.card-imagen {
  background-image: url("../img/estudiante_optimizada.webp");
  background-size: cover;
  background-position: center;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.logo-titulo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.subtitulo {
  text-align: center;
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.descripcion-opcion {
  font-weight: normal;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

.mensaje-imagen {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 2rem;
  border-radius: var(--radio);
  text-align: center;
  max-width: 90%;
}

/* ----------------- Formularios ----------------- */
form label {
  font-weight: bold;
  margin-top: 1rem;
  display: block;
}

form input {
  padding: 0.75rem;
  margin-top: 0.25rem;
  width: 100%;
  border-radius: var(--radio);
  border: 1px solid #ccc;
  margin-bottom: 1rem;
}

/*input[type="text"] {
  text-transform: uppercase;
}*/

textarea[name="descripcion"] {
  text-transform: none;
}

/* ----------------- Botones ----------------- */
.btn {
  padding: 0.75rem;
  border: none;
  border-radius: var(--radio);
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

.btn-primario {
  background-color: var(--color-primario);
  color: white;
}

.btn-primario:hover {
  background-color: var(--color-secundario);
}

.btn-eliminar {
  background-color: #b71c1c;
  color: white;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radio);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-eliminar:hover {
  background-color: #7f0000;
}

.registro {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* ----------------- Grid de Opciones ----------------- */
.grid-opciones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.opcion-card {
  text-align: center;
  color: var(--color-primario);
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, background-color 0.3s ease;
  text-decoration: none;
}

.opcion-card i {
  font-size: 2rem;
}

.opcion-card:hover {
  background-color: var(--color-secundario);
  color: white;
  transform: translateY(-3px);
}

.opcion-salida {
  background-color: #b71c1c;
  color: white;
}

.opcion-salida:hover {
  background-color: #7f0000;
  transform: translateY(-3px);
}

/* Grid Media Queries */
@media (max-width: 577px) {
  .grid-opciones {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  .grid-opciones {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 992px) {
  .grid-opciones {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .grid-opciones {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ----------------- Tablas ----------------- */
.tabla-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  background-color: var(--color-claro);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

thead {
  background-color: var(--color-primario);
  color: white;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
  font-size: 0.95rem;
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.acciones-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.formulario-container {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.formulario-container .card {
  width: 100%;
  max-width: 900px;
}
/* ----------------- Tablas Responsivas ----------------- */
.tabla-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  background-color: var(--color-claro);
}

/* ✅ Tabla en escritorio */
table {
  width: 100%;
  border-collapse: collapse;
  min-width: unset; /* Eliminamos ancho mínimo fijo */
}

thead {
  background-color: var(--color-primario);
  color: white;
}

th,
td {
  padding: 0.75rem 1rem;

  border-bottom: 1px solid #ddd;
  font-size: 0.95rem;
  word-break: break-word; /*  Permite cortar palabras largas */
  white-space: normal; /*  Permite saltos de línea */
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* ✅ Ajuste dinámico para pantallas medianas (menores a 1650px) */
@media (max-width: 1650px) {
  td,
  th {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  /* Limita la columna Descripción */
  td:nth-child(2) {
    max-width: 400px;
  }
}

/* ✅ Vista tipo tarjeta en móviles */
@media (max-width: 650px) {
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    flex-wrap: wrap;
    width: 100%;
  }

  thead {
    display: none; /* Oculta encabezado */
  }

  tr {
    margin-bottom: 1rem;
    border: 4px solid #78460c;
    border-radius: var(--radio);
    padding: 0.75rem;
    background: rgba(234, 232, 233, 0.844);
    box-shadow: var(--sombra);
    padding: 100px;
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border: none;
    border-bottom: 1px solid #eee;
  }

  td:last-child {
    border-bottom: none;
  }

  /* ✅ Etiqueta antes del valor */
  td::before {
    content: attr(data-label);
    font-weight: bold;
    color: var(--color-primario);
    flex: 1;
    margin-right: 0.5rem;
  }
}

/* ----------------- Botones en tabla ----------------- */
.acciones-btns {
  display: flex;
  flex-direction: column; /* Botones apilados */
  gap: 0.9rem; /* Espacio entre botones */
  align-items: center; /* Ocupan todo el ancho */
}

.acciones-btns a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.6rem;
  border-radius: var(--radio);
  font-weight: bold;
  width: 100%; /* Ocupa todo el ancho */
  min-width: 100px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.btn-ver {
  background-color: rgb(10, 120, 10);
  color: white;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radio); /* Usa la misma variable que el botón rojo */
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-ver:hover {
  background-color: rgb(16, 174, 16);
}

.btn-editar {
  background-color: #2265bd;
  color: white;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radio); /* Usa la misma variable que el botón rojo */
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-editar:hover {
  background-color: #4286df;
}

.btn-eliminar {
  background-color: #bd0d0d;
  color: white;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radio); /* Usa la misma variable que el botón rojo */
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-eliminar:hover {
  background-color: #e63c3c;
}

/*  Ajuste botones en pantallas pequeñas */
@media (max-width: 650px) {
  .acciones-btns {
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .acciones-btns a {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.5rem;
    min-width: unset;
  }
}

/* ----------------- Tarjetas de estudio ----------------- */
.descripcion-set {
  background-color: #fff; /* Fondo blanco */
  padding: 1rem; /* Espacio interno */
  border-radius: var(--radio); /* Usa variable global */
  box-shadow: var(--sombra); /* Consistencia visual */
  max-width: 80%; /* Para que no ocupe toda la pantalla */
  margin: 1rem auto; /* Centrado horizontal */
  font-size: 1rem;
  color: var(--color-texto);
  text-align: justify; /* Mejor lectura */
  line-height: 1.5;
}

.flashcard-container {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1500px;
  margin: 2rem auto;
}

.flashcard {
  width: 700px; /* MÁS GRANDE */
  height: 350px; /* ALTO FIJO */
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer;
}

.flashcard.volteada {
  transform: rotateY(180deg);
}

.cara {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column; /* Para colocar imagen y texto */
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
  padding: 1rem;
  overflow-y: auto;
  text-align: center;
  overflow: hidden; /* IMPORTANTE */
  color: #333; /* Texto oscuro para la mayoría de colores claros */
  font-weight: bold;
}

.frontal {
  background-color: var(--color-claro);
}

.reverso {
  background-color: #fff;
  transform: rotateY(180deg);
}

.flashcard-img {
  max-width: 80%;
  max-height: 150px;
  object-fit: contain; /* Imagen siempre se ajusta */
  margin-top: 1rem;
  border-radius: 8px;
}

.controles-tarjeta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 768px) {
  .flashcard {
    width: 510px;
    height: 280px;
  }

  .flashcard-img {
    max-height: 100px;
  }
}
@media (max-width: 576px) {
  .flashcard {
    width: 320px;
    height: 220px;
  }

  .flashcard-img {
    max-height: 100px;
  }
}

/* ==== Modal para instrucciones ==== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* Oculto por defecto */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeInBackground 0.3s ease-in-out;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radio);
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--sombra);
  animation: zoomIn 0.4s ease-in-out;
}

.modal-content h2 {
  font-size: 1.5rem;
  color: var(--color-primario);
  margin-bottom: 0.5rem;
}

.modal-content p {
  font-size: 1rem;
  color: #333;
  margin-bottom: 1.5rem;
}

.mixtle-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem auto;
  border: 4px solid var(--color-primario);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  animation: bounce 0.8s ease-in-out;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn-ver {
  background: var(--color-primario);
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radio);
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
}

.btn-ver:hover {
  background: #5c1e36;
}

.btn-cancelar {
  background: #ccc;
  color: #333;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radio);
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.btn-cancelar:hover {
  background: #aaa;
}

/* Animaciones */
@keyframes fadeInBackground {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
/* ==== Estilos específicos para el modo prueba ==== */
.barra-progreso {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-secundario-solido);
  color: #22c727;
  padding: 1rem;
  font-weight: bold;
  border-radius: var(--radio);
  margin-bottom: 1.5rem;
}

.barra-progreso-visual {
  flex: 1;
  background: #acccd4;
  border-radius: var(--radio);
  height: 10px;
  overflow: hidden;
}

.progreso {
  height: 100%;
  width: 10%;
  background: #6ad06d;
  border-radius: var(--radio);
  transition: width 0.4s ease;
}

.barra-progreso button {
  background: #d9534f;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radio);
  cursor: pointer;
  font-weight: bold;
}

.barra-progreso button:hover {
  background: #c9302c;
}

.contenedor-pregunta {
  text-align: center;
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.opciones-contenedor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.opcion {
  background: #fff;
  border: 2px solid #ccc;
  padding: 1rem;
  text-align: left;
  border-radius: var(--radio);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.opcion:hover {
  border-color: var(--color-primario);
  background: #f9f9f9;
}

.opcion.correcta {
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.opcion.incorrecta {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.controles-prueba {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.controles-prueba button {
  background: var(--color-primario);
  color: #fff;
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  border: none;
  border-radius: var(--radio);
  cursor: pointer;
}

.controles-prueba button:disabled {
  background: #bbb;
  cursor: not-allowed;
}

.cronometro {
  font-size: 1.5rem;
  font-weight: bold;
  color: #22c727;
}
/* ------------Estilos para los resultados -------------*/
.resultado-container {
  max-width: 650px;
  margin: -0.5rem auto;
  padding: 0.5rem;
  background: #fff;
  border-radius: var(--radio);
  text-align: center;
  box-shadow: var(--sombra);
  animation: fadeIn 0.8s ease-in-out;
}

.resultado-container h2 {
  font-size: 2rem;
  color: var(--color-primario);
  margin-bottom: 1rem;
}

.puntaje-final {
  font-size: 2rem;
  font-weight: bold;
  color: #28a745;
  margin: 1rem 0;
}

.detalle {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 1rem;
}

.barra-progreso {
  width: 100%;
  background: #e9ecef;
  border-radius: var(--radio);
  overflow: hidden;
  margin-bottom: 1rem;
}

.barra-progreso-fill {
  height: 20px;
  background: var(--color-primario);
  width: 0;
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
  line-height: 20px;
  transition: width 1s ease-in-out;
}

.acciones {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.acciones a {
  background: var(--color-primario);
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radio);
  font-size: 1rem;
  font-weight: bold;
  text-decoration: none;
}

.acciones a:hover {
  background: #0b4c55;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* estado base: cerrado */
.sidebar .submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  will-change: max-height;
}

/* abierto */
.sidebar .submenu.activo {
  max-height: 800px; /* lo bastante grande para tu contenido */
}

/* opcional: rotar chevron cuando está abierto */
.sidebar .submenu-toggle[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
  transition: transform .2s ease;
}
