@import url('https://fonts.googleapis.com/css2?family=Saira:wght@300;400;700&display=swap');

/* =========================================================
   1. RESET GLOBAL
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

h1 {
    text-align: center;
    font-family: "Saira", sans-serif;
    color: #01131D;
    font-weight: 700;
}
h3 {
    font-family: "Saira", sans-serif;
    text-align: center;
    color: #fff;
    font-weight: 700;
}
p {
    font-family: "Saira", sans-serif;
    color: #01131D;
}

/* =========================================================
   FARABOARD pverdatos
   ========================================================= */
.container-row {
    display: flex;
    flex-direction: row; /* Alineación horizontal */
    flex-wrap: nowrap;   /* PROHIBIDO que bajen a la siguiente línea */
    gap: 10px;           /* Espacio entre las dos cards */
    width: 100%;         /* O el ancho que desees */
    align-items: stretch; /* Para que tengan la misma altura si quieres */
}


/* =========================================================
   FARABOARD DATOS
   ========================================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

body.modal-open {
    overflow: hidden;
}

/* Clase para las celdas de la tabla de información */
.col-info {
    width: 15%;
    padding: 0 15px; /* Espacio a izquierda y derecha */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle; /* Asegura que el contenido esté centrado verticalmente */
}

/* Opcional: Si quieres que la primera columna sea más ancha que las otras */
.col-info-principal {
    width: auto; /* Que ocupe el espacio sobrante */
    padding-right: 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* Card contenedora */
.faracardboard {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 750px;
  width: 100%;
  text-align: center;
}


.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    margin: 24px 0;
}

.stat {
    background: #fef5e6;
    border-radius: 16px;
    padding: 16px 24px;
    text-align: center;
    min-width: 120px;
}

.stat .label {
    display: block;
    font-weight: 600;
    font-family: "Saira", sans-serif;
    color: #063335;
    margin-bottom: 4px;
}

.stat .value {
    font-weight: 700;
    font-family: "Saira", sans-serif;
    color: #E79A24;
    font-size: 3em;
}

.tarjeta {
    background: #E79A24;
    border-radius: 16px;
    padding: 8px 8px 8px 8px;
    font-family: "Saira", sans-serif;
    text-align: center;
    min-width: 90px;
}

.tarjeta .label {
    display: block;
    font-size: 0.7em;
    font-family: "Saira", sans-serif;
    font-weight: 600;
    color: #063335;
    margin-bottom: 4px;
}

.tarjeta .value {
    font-weight: 600;
    font-family: "Saira", sans-serif;
    color: #fff;
    font-size: 2.3em;
}
/* Esto solo se aplicará a la tarjeta que tenga AMBAS clases */
.tarjeta-turno {
    background: #C76502;
    border-radius: 16px;
    padding: 8px 8px 8px 8px;
    font-family: "Saira", sans-serif;
    text-align: center;
    min-width: 90px;
}
.tarjeta-turno .label {
    display: block;
    font-size: 0.7em;
    font-weight: 600;
    font-family: "Saira", sans-serif;
    color: #063335;
    margin-bottom: 4px;
}
.tarjeta-turno .value {
    font-weight: 600;
    font-family: "Saira", sans-serif;
    color: #fef5e6;
    font-size: 2.3em;
}
.tarjetadata {
    background: #fef5e6;
    border-radius: 16px;
    padding: 16px 24px;
    text-align: center;
    font-family: "Saira", sans-serif;
    min-width: 60px;
}

.tarjetadata .label {
    display: block;
    font-family: "Saira", sans-serif;
    font-weight: 400;
    color: #063335;
    margin-bottom: 4px;
}

.tarjetadata .value {
    font-weight: 300;
    font-family: "Saira", sans-serif;
    color: #E79A24;
    font-size: 2em;
}


.card.board {
    width: 100%;
    max-width: 600px;
}

.card.board {
    width: 100%;
    max-width: 600px;
}
#entidadtxt {
    color: #E79A24; /* naranja */
    font-family: "Saira", sans-serif;
}
#nombretxt {
    color: #E79A24; /* naranja */
    font-family: "Saira", sans-serif;
}

/* =========================================================
   2. BASE LAYOUT
   ========================================================= */

body {
  font-family: "Saira", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #01131D 0%, #063335 100%);
  padding: 20px;
}

.page-content {
  margin-top: 4px;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-family: "Saira", sans-serif;
}

/* =========================================================
   3. HEADER
   ========================================================= */

.header {
  width: 100%;
  justify-content: center;
  padding: 0px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.header-inner img {
  max-width: 100%;
  height: auto;
}

.header-title {
  margin-left: 20px;
}


.header-inner img {
  width: 400px;
  height: 130px;
  object-fit: cover;
  border-radius: 16px;
  /* Eliminamos align-items de aquí, ya que pertenece al padre */
}

.header-title {
  font-size: 30px;
  text-align: center;
  color: #fff;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
  }

  .header-title {
    margin-left: 0;
    margin-top: 16px;
  }
}
.step-card {
  width: 100%;
  max-width: 950px;
  margin: 24px auto 0 auto;
  padding: 20px;
  background-color: #F5D78A;
  border-radius: 16px;
  text-align: center;
}
/* =========================================================
   4. DASHBOARD GRID
   ========================================================= */
.dashboard {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;           /* permite bajar si no cabe */
    align-items: flex-start;
    gap: 32px;
    width: 95%;
    max-width: 950px;          /* suficiente para que quepan ambos lado a lado en pantallas ≥ ~900px */
    margin: 0 auto;
    justify-content: center;  /* centra todo el bloque y, al bajar, centra el timer */
}

@media (max-width: 950px) {
    .dashboard {
        flex-direction: column;
        align-items: center;
    }
    .card-timer {
        width: 260px;
        margin-top: 24px;
    }
}
/* =========================================================
   TEXTOS
   ========================================================= */
    .etiqueta-text {
      color: #fff; /* negro para los títulos */
      font-weight: 600;
      font-family: "Saira", sans-serif;
    }

    .valor-text {
      color: #E79A24; /* mismo naranja que el botón */
      font-weight: 500;
      font-family: "Saira", sans-serif;
      margin-left: 4px; /* opcional para separar del título */
    }


/* =========================================================
   5. CARDS
   ========================================================= */
.card {
  background: #fff;
  border-radius: 24px;
  padding: 6px;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
}

/* Card contenedora transparente */
.card-main {
  width: 100%;
  background: transparent;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex: 1 1 550px;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-family: "Saira", sans-serif;
}

/* Sub-cards reales */
.sub-card {
  background: #fff;
  border-radius: 20px;
  padding: 6px;
  box-shadow: 0 12px 24px rgba(0,0,0,.12);
  margin-top: 8px;
}

/* =========================================================
   Card de información más compacta
   ========================================================= */
.sub-card-info {
  padding: 16px 24px;       /* reducido de 24px a 16px vertical */
  font-size: 14px;          /* más pequeño para menos altura */
  text-align: center;
  font-family: "Saira", sans-serif;
}

#infoBar {
  gap: 20px;                /* ligeramente menos espacio entre items */
  font-size: 14px;
  margin-bottom: 0;
}

.sub-card-actions {
  text-align: center;
  font-family: "Saira", sans-serif;
}

/* Card del temporizador */
.card-timer {
  width: 260px;
  display: none;
  flex-direction: column;
  flex: 0 0 260px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}
@media (max-width: 900px) {
    .dashboard {
        flex-direction: column;
        align-items: center;
        grid-template-columns: 1fr; /* solo una columna */
        justify-items: center;       /* centra automáticamente todas las cards */
        gap: 24px;
    }

    .card-timer {
        width: 240px; /* mantiene tamaño fijo para no ocupar demasiado */
    }
}



/* =========================================================
   6. INFO BAR Y LEYENDA
   ========================================================= */
#infoBar {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 0px;
  flex-wrap: wrap;
  font-size: 16px;
  font-weight: 500;
  font-family: "Saira", sans-serif;
  color: #063335;
}

#leyenda {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #063335;
}

#leyenda span {
  margin-right: 20px;
}

/* =========================================================
   7. ACCIONES Y BOTONES
   ========================================================= */
.actions-top {
  margin: 20px 0;
}

.button-container {
  width: 100%;
  display: flex;
  justify-content: center;
}



/* Botones reutilizables */
.btn-prim,
.btn-sec,
.btn-avanzar,
.btn-ter {
  font-family: "Saira", sans-serif;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  background: #063335;
  color: white;
}

.btn-prim {
  background: #E79A24;
  color: black;
}

.btn-sec {
  background: #F5D78A;
  color: black;
}

.btn-ter {
  background: #063335;
  color: white;
}

.btn-prim:hover,
.btn-sec:hover,
.btn-avanzar:hover,
.btn-ter:hover {
  transform: translateY(-2px);
}
.btn-avanzar {
  background: #BAFC4F;
  color: black;
}


/* =========================================================
   BOTON: SALIR
   ========================================================= */
.btn-salir {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  background: #B03802;
  color: white;
  font-family: "Saira", sans-serif;
}


.btn-salir:hover {
  transform: translateY(-2px);
}


/* =========================================================
   8. EQUIPOS GRID
   ========================================================= */
#equiposGrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  max-width: 546px; /* 5 × 90px + 4 × 24px = 546px */
  margin: 20px auto 0;
  padding: 10px 0;
}


.equipo {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.equipoBox {
  flex: 0 0 90px;
  width: 90px;
  text-align: center;
}

.emoji {
  font-size: 30px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .equipo {
    width: 60px;
  }
}

/* =========================================================
   9. MODALES GENERALES
   ========================================================= */
/* Modal selector de equipos */
#modalBackdrop {
  position: fixed;
  inset: 0;
  display: none; /* se muestra vía JS */
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

#modalBackdrop .modal {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#modalBackdrop h2 {
  color: #063335;
  margin-bottom: 16px;
}

#modalBackdrop #modalValue {
  font-size: 36px;
  font-weight: 700;
  color: #E79A24;
  margin: 12px 0;
}

#modalBackdrop input[type="range"] {
  width: 100%;
  margin-top: 12px;
}

#modalBackdrop button {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin: 8px;
}

#modalBackdrop .confirm {
  background: #E79A24;
  color: black;
}

#modalBackdrop .cancel {
  background: #F5D78A;
  color: black;
}


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

#modalContent,
.timer-modal {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  width: 90%;
  max-width: 400px;
}

/* Slider modal */
#modalSlider {
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 4px;
}
/* Chrome, Edge, Safari */
#modalSlider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: #E79A24;  /* color del botón */
  border-radius: 50%;
  cursor: pointer;
  border: none;
  margin-top: -7px; /* centra el thumb verticalmente según el track */
}

/* Firefox */
#modalSlider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #E79A24;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Track (opcional) */
#modalSlider::-webkit-slider-runnable-track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 4px;
}

#modalSlider::-moz-range-track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 4px;
}

/* =========================================================
   10. TIMER
   ========================================================= */
.timer-circle {
  position: relative;
  width: 220px;
  height: 220px;
}

.timer-circle svg {
  transform: rotate(-90deg);
}

.timer-circle .bg {
  fill: none;
  stroke: #F5D78A;
  stroke-width: 12;
}

.timer-circle .progress {
  fill: none;
  stroke: #924214;
  stroke-width: 12;
  transition: stroke-dashoffset 1s linear;
}

#timerDisplay {
  font-family: "Saira", sans-serif;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: #EF9B33;
}
.timer-actions {
    display: flex;
    justify-content: center;
    gap: 6px; /* ajusta separación */
}

.timer-actions button {
    width: 60px;          /* Ajustado para Saira */
    height: 36px;         /* alto consistente */
    line-height: 36px;    /* centra verticalmente el texto */
    font-family: "Saira", sans-serif;
    font-size: 14px;      /* ajusta tamaño para que quepa “Nuevo” */
    text-align: center;   /* centra horizontalmente */
    white-space: nowrap;  /* evita que se rompa en varias líneas */
    overflow: hidden;     /* corta el texto que sobrepase */
    padding: 0 4px;       /* pequeño padding para separación interna */
}
/* Ajustes para el modal del timer */
.timer-modal h2 {
  margin-bottom: 24px;
  color: #063335;
}

.timer-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.timer-input-group label {
  font-weight: 600;
  color: #063335;
  font-size: 16px;
}

.timer-input-group input[type="number"] {
  width: 80px;        /* recuadro más grande */
  padding: 8px 12px;  /* relleno cómodo */
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px;
  border: 2px solid #E79A24;
  text-align: center;
  color: #063335;
  -moz-appearance: textfield; /* elimina flechas en Firefox */
}

.timer-input-group input::-webkit-outer-spin-button,
.timer-input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0; /* elimina flechas en Chrome/Safari */
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 16px; /* más espacio entre botones */
}

/* =========================================================
   11. FOOTER
   ========================================================= */
.site-footer {
  margin-top: auto;
  width: 100%;
  text-align: center;
  padding: 20px 0;
}

.site-footer img {
  max-width: 150px;
  height: auto;
}

@media (max-width: 400px) {
  .tarjeta, .tarjeta-turno, .tarjetadata {
    min-width: auto;
    width: 70px;
    font-size: 0.8em;
  }
}
@media (max-width: 400px) {
  #timerDisplay { font-size: 28px; }
  .emoji { font-size: 24px; }
}

#qrCanvas {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px auto;
}
