/* ESTILOS GENERALES */
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    background-color: #020818;
}

/* NUEVA REGLA: Todos los títulos H2 del documento */
h2 {
    font-size: 18px;
    color: #00cfff;
    text-shadow: 0 0 8px #00cfff, 0 0 18px #00aaff;
}

/* ENCABEZADO */
.encabezado {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    background-color: #030d2e;
    padding: 15px 30px;
    border-bottom: 2px solid #00cfff;
    box-shadow: 0 0 18px rgba(0, 207, 255, 0.3);
}

.logo img {
    width: 200px;
    height: 96px;
    object-fit: cover;
    border-radius: 14px;
}

.menu {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 30px;
}

.menu a {
    text-decoration: none;
    color: #00cfff;
    background-color: #ffd700;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 0 10px #ffd700, 0 0 22px #ffaa00, 0 0 40px #ff8800;
    text-shadow: 0 0 8px #00cfff, 0 0 16px #0099ff;
}

.menu a:hover {
    background-color: #ffaa00;
    box-shadow: 0 0 16px #ffaa00, 0 0 32px #ff8800, 0 0 55px #ff6600;
    color: #00cfff;
    text-shadow: 0 0 10px #00cfff, 0 0 22px #0077ff;
}

/* GALERÍA DE IMÁGENES */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

h1 {
  font-family: Arial, sans-serif;
  font-size: 12px;
  background-color: #030d2e;
  color: #00cfff;
  text-align: center;
  padding: 22px 16px 18px;
}

p h1 {
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #00cfff;
  text-shadow:
    0 0 6px #00cfff,
    0 0 14px #00cfff,
    0 0 28px #00aaff,
    0 0 50px #0077ff;
}

.header-sub {
  margin-top: 18px;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #00cfff;
  text-align: center;
  text-shadow:
    0 0 8px #00cfff,
    0 0 18px #00aaff,
    0 0 32px #0077ff,
    0 0 55px #0055ff;
}

.date-input {
  background: transparent;
  border: 1px solid rgba(0, 207, 255, 0.45);
  border-radius: 6px;
  color: #00cfff;
  font: inherit;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 2px 6px;
  text-shadow: 0 0 8px #00cfff;
  min-width: 160px;
}

.date-input:focus {
  outline: none;
  border-color: #00cfff;
  box-shadow: 0 0 0 2px rgba(0, 207, 255, 0.3);
}

/* CONDICIÓN 3: Regla CSS para el elemento con ID "mi-id" */
#mi-id {
  font-size: 20px;
  color: #00cfff;
  text-align: center;
  padding: 8px 16px;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow:
    0 0 8px #00cfff,
    0 0 20px #00aaff,
    0 0 40px #0077ff;
}

/* CONDICIÓN 4: CSS Grid para el contenido principal */
main {
  display: grid;
  grid-template-columns: 1fr;
  padding: 20px;
  overflow-x: auto;
  background-color: #020c1e;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

thead th {
  background-color: #ffd700;
  color: #00cfff;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  padding: 9px 8px;
  border: 1px solid #ffaa00;
  text-align: center;
  text-shadow: 0 0 8px #00cfff, 0 0 18px #0077ff;
  box-shadow: inset 0 0 12px rgba(255, 170, 0, 0.4), 0 0 10px #ffd700;
  letter-spacing: 1px;
}

tbody td {
  border: 1px solid #0a2040;
  padding: 6px 7px;
  vertical-align: top;
  background-color: #021228;
}

tbody tr:nth-child(even) td {
  background-color: #031530;
}

tbody tr:hover td {
  background-color: #041c3e;
}

.hora-cell {
  background-color: #ffd700;
  color: #00cfff;
  text-shadow: 0 0 8px #00cfff, 0 0 18px #0077ff;
  box-shadow: inset 0 0 10px rgba(255, 170, 0, 0.3);
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  width: 110px;
  vertical-align: middle;
}

.dia-cell {
  text-align: center;
  padding: 5px 4px;
}

.asignatura-input {
  width: 100%;
  min-width: 0;
  background: rgba(2, 18, 40, 0.95);
  border: 1px solid rgba(0, 207, 255, 0.45);
  border-radius: 6px;
  color: #00cfff;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  padding: 4px 6px;
  margin-bottom: 5px;
  box-shadow: inset 0 0 8px rgba(0, 207, 255, 0.08);
  text-shadow: 0 0 6px #00cfff;
}

.asignatura-input::placeholder {
  color: rgba(0, 207, 255, 0.5);
  font-weight: normal;
}

.asignatura-input:focus {
  outline: none;
  border-color: #00cfff;
  box-shadow: 0 0 0 2px rgba(0, 207, 255, 0.25), inset 0 0 8px rgba(0, 207, 255, 0.12);
}

.foto-btn {
  background: #021228;
  border: 1px solid #00cfff;
  color: #00cfff;
  font-size: 11px;
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  display: inline-block;
  margin-bottom: 4px;
  font-family: Arial, sans-serif;
  text-shadow: 0 0 6px #00cfff;
  box-shadow: 0 0 6px rgba(0, 207, 255, 0.2);
}

.foto-btn:hover {
  background: rgba(0, 207, 255, 0.15);
  box-shadow: 0 0 10px rgba(0, 207, 255, 0.4);
}

.foto-btn-delete {
  margin-left: 4px;
}

.foto-expand {
  display: none;
  margin-top: 4px;
}

.foto-expand.open {
  display: block;
}

.foto-placeholder {
  background: #021228;
  border: 1px dashed rgba(0, 207, 255, 0.35);
  border-radius: 6px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  overflow: hidden;
  transition: width 0.25s, height 0.25s;
  color: rgba(0, 207, 255, 0.5);
  font-size: 18px;
}

.foto-placeholder.expanded {
  width: 110px;
  height: 110px;
}

.foto-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.foto-placeholder.has-photo {
  cursor: zoom-in;
}

.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 5, 20, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.photo-modal.open {
  display: flex;
}

.photo-modal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 207, 255, 0.4);
}

.photo-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: #00cfff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  text-shadow: 0 0 10px #00cfff;
}

.foto-input {
  display: none;
}

/* PIE DE PÁGINA */
.pie {
    margin-top: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    background-color: #ffd700;
    color: #00cfff;
    padding: 20px;
    border-top: 2px solid #ffaa00;
    box-shadow: 0 -4px 20px rgba(255, 215, 0, 0.5), 0 -8px 40px rgba(255, 170, 0, 0.3);
}

.pie p {
    color: #00cfff;
    text-shadow: 0 0 8px #00cfff, 0 0 18px #0077ff;
}

.pie h2 {
    color: #00cfff;
    text-shadow: 0 0 8px #00cfff, 0 0 18px #0077ff;
}

.pie-seccion {
    margin: 10px;
}

.pie-seccion h3 {
    margin-bottom: 10px;
    color: #00cfff;
}

.fila-iconos {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
}

.fila-iconos a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fila-iconos img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* ==========================================================================
   RESPONSIVE PARA CELULAR (max-width: 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {

  /* ENCABEZADO */
  .encabezado {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    text-align: center;
  }

  .logo img {
    width: 130px;
    height: auto;
  }

  .menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

  .menu a {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* TÍTULO Y FECHA */
  #mi-id {
    font-size: 16px;
    padding: 6px 10px;
    letter-spacing: 0.5px;
  }

  .header-sub {
    font-size: 16px;
    letter-spacing: 1px;
    padding: 0 10px;
  }

  .date-input {
    min-width: 120px;
    font-size: 14px;
  }

  /* CONTENIDO PRINCIPAL */
  main {
    padding: 10px 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* La tabla mantiene su estructura pero se hace scrolleable horizontalmente */
  table {
    min-width: 480px;
    font-size: 11px;
  }

  thead th {
    font-size: 11px;
    padding: 7px 4px;
    letter-spacing: 0;
  }

  .hora-cell {
    width: 80px;
    font-size: 10px;
    padding: 6px 3px;
  }

  .dia-cell {
    padding: 4px 3px;
  }

  .asignatura-input {
    font-size: 10px;
    padding: 3px 4px;
    margin-bottom: 3px;
  }

  .foto-btn {
    font-size: 10px;
    padding: 2px 5px;
    margin-bottom: 2px;
  }

  .foto-placeholder {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .foto-placeholder.expanded {
    width: 80px;
    height: 80px;
  }

  /* PIE DE PÁGINA */
  .pie {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 12px;
    text-align: center;
  }

  .pie-seccion {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
  }

  .pie h2 {
    font-size: 15px;
  }

  .pie p {
    font-size: 13px;
  }
}

/* ==========================================================================
   RESPONSIVE PARA PANTALLAS MUY PEQUEÑAS (max-width: 400px)
   ========================================================================== */
@media screen and (max-width: 400px) {

  .menu a {
    padding: 7px 10px;
    font-size: 12px;
  }

  #mi-id {
    font-size: 14px;
  }

  .header-sub {
    font-size: 13px;
  }

  table {
    min-width: 380px;
    font-size: 10px;
  }

  .hora-cell {
    width: 68px;
    font-size: 9px;
  }
}