
/* =========================================================
   ESTILOS GENERALES
   COLEGIO AGRIPINA MONTES
   ========================================================= */

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", sans-serif;
  background: #f4f7fa;
  margin: 0;
  padding: 20px;
  color: #2c3e50;
}

h2 {
  color: #2c3e50;
  margin-top: 20px;
}

section {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}


/* =========================================================
   CAMPOS Y BOTONES
   ========================================================= */

input,
select,
button {
  padding: 10px;
  margin: 5px;
  border-radius: 6px;
  border: 1px solid #ccc;
  max-width: 100%;
  font: inherit;
}

input,
select {
  background: #ffffff;
  color: #222222;
}

button {
  background-color: #3498db;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #2980b9;
}

button:active {
  transform: scale(0.98);
}


/* =========================================================
   TABLAS
   ========================================================= */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  padding: 10px;
  border: 1px solid #ccc;
  text-align: center;
}

th {
  background-color: #ecf0f1;
  color: #2c3e50;
}

tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}


/* =========================================================
   COLORES POR NIVEL ESCOLAR
   ========================================================= */

.nivel-MAT {
  background-color: #fddede;
}

.nivel-PRE {
  background-color: #d0f0c0;
}

.nivel-PRI {
  background-color: #d0e0f0;
}

.nivel-SEC {
  background-color: #f0d0f0;
}


/* =========================================================
   ZONA DE LA CÁMARA QR
   Oculta hasta pulsar el botón Escanear
   ========================================================= */

#cameraZona {
  position: relative;
  display: none;
  width: 100%;
  max-width: 500px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 12px;
  background: #111111;
}

/* Contenedor del lector QR */

#lectorQR {
  position: relative;
  width: 100%;
  z-index: 1;
}

/* Evitar que la imagen de la cámara exceda el contenedor */

#lectorQR video {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}


/* =========================================================
   AVISO FLOTANTE DE ENTRADA O SALIDA
   Funciona con avisoEscaneo fuera de cameraZona
   ========================================================= */

#avisoEscaneo,
.aviso-escaneo {
  display: none;

  /* Posición respecto a la pantalla del dispositivo */
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;

  /* Mantenerlo por encima de la página y del lector QR */
  z-index: 2147483647 !important;

  /* Tamaño adaptable */
  width: 88vw;
  max-width: 360px;
  min-width: 0;
  max-height: 80vh;
  overflow-wrap: anywhere;
  overflow-y: auto;

  /* Apariencia */
  padding: 20px 16px;
  background: #ffffff;
  color: #222222;
  border: 4px solid #27ae60;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);

  text-align: center;
  pointer-events: none;

  /* Evitar efectos de transparencia heredados */
  visibility: visible;
  opacity: 1;
}

/* Nombre del alumno */

#avisoEscaneo .aviso-nombre,
.aviso-escaneo .aviso-nombre {
  color: #17202a;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  margin-bottom: 12px;
  line-height: 1.25;
}

/* Tipo de registro */

#avisoEscaneo .aviso-tipo,
.aviso-escaneo .aviso-tipo {
  color: #219653;
  font-size: clamp(18px, 4.5vw, 24px);
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1.3;
}

/* Fecha y hora */

#avisoEscaneo .aviso-dato,
.aviso-escaneo .aviso-dato {
  color: #333333;
  font-size: 17px;
  font-weight: 700;
  margin-top: 7px;
  line-height: 1.4;
}

/* Color distinto para las salidas */

#avisoEscaneo.salida,
.aviso-escaneo.salida {
  border-color: #e67e22;
}

#avisoEscaneo.salida .aviso-tipo,
.aviso-escaneo.salida .aviso-tipo {
  color: #e67e22;
}


/* =========================================================
   PIE DE PÁGINA
   ========================================================= */

footer {
  text-align: center;
  margin-top: 50px;
  font-size: 16px;
  color: #555555;
}


/* =========================================================
   AJUSTES PARA CELULARES
   ========================================================= */

@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  section {
    padding: 12px;
    margin-bottom: 20px;
  }

  h2 {
    font-size: 21px;
  }

  input,
  select,
  button {
    max-width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  #cameraZona {
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
  }

  #lectorQR {
    width: 100%;
  }

  #avisoEscaneo,
  .aviso-escaneo {
    width: 88vw;
    max-width: 360px;
    padding: 16px 12px;
    border-width: 3px;
    border-radius: 14px;
  }

  #avisoEscaneo .aviso-nombre,
  .aviso-escaneo .aviso-nombre {
    font-size: 22px;
  }

  #avisoEscaneo .aviso-tipo,
  .aviso-escaneo .aviso-tipo {
    font-size: 19px;
  }

  #avisoEscaneo .aviso-dato,
  .aviso-escaneo .aviso-dato {
    font-size: 16px;
  }

  footer {
    margin-top: 30px;
    font-size: 14px;
  }
}


/* =========================================================
   AJUSTES PARA PANTALLAS MUY PEQUEÑAS
   ========================================================= */

@media (max-width: 360px) {
  #avisoEscaneo,
  .aviso-escaneo {
    width: 90vw;
    padding: 13px 10px;
  }

  #avisoEscaneo .aviso-nombre,
  .aviso-escaneo .aviso-nombre {
    font-size: 19px;
  }

  #avisoEscaneo .aviso-tipo,
  .aviso-escaneo .aviso-tipo {
    font-size: 17px;
  }

  #avisoEscaneo .aviso-dato,
  .aviso-escaneo .aviso-dato {
    font-size: 14px;
  }
}
