/* ===== Scroll general en toda la página ===== */
html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden; /* Evitar scroll horizontal innecesario */
  background: #f9f9f9;
  margin: 0;
  padding: 0;
  font-family: "Arial", Georgia, Serif;
}

/* ===== Contenedor ===== */
.container {
  width: 95%;
  max-width: 1080px;
  margin: 0 auto;
  font-size: 15px;
  box-sizing: border-box;
}

/* ===== Header ===== */
header {
  text-align: center;
  border: 1px solid #666;
  background: #cccccc;
  padding: 10px 0;
}

/* ===== Navegación ===== */
nav {
  padding: 0.5%;
  background: #f06156;
}

nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav ul li {
  margin: 2px;
}

nav ul li a {
  display: inline-block;
  padding: 6px 15px;
  font-weight: bold;
  color: #75302a;
  background: #fafafa;
  border-radius: 3px;
  text-align: center;
  transition: 0.3s;
  border: 2px solid black;
}

nav ul li a:hover {
  color: blueviolet;
  background: grey;
  font-size: 20px;
  text-decoration: underline;
}

/* ===== Footer ===== */
footer {
  width: 100%;
  padding: 10px 0;
  background-color: #333;
  text-align: center;
}

footer a {
  color: #fff;
}

/* ===== Formularios e Inputs ===== */
input, select, textarea, button {
  width: 100%;
  max-width: 400px;
  margin: 5px 0;
  padding: 10px;
  border: 2px solid green;
  box-sizing: border-box;
  display: block;
}

input:valid, select:valid, textarea:valid {
  border-color: green;
  background-color: #E5FFE5;
}

input:invalid, select:invalid, textarea:invalid {
  border-color: red;
  background-color: #FFCACA;
}

/* ===== Botones ===== */
.boton-consulta {
  background-color: #4CAF50;
  color: black;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  text-decoration: none;
  font-size: 16px;
  transition: 0.3s;
  border: 2px solid black;
}

.boton-consulta:hover {
  color: red;
  background-color: grey;
  text-decoration: underline;
}

.boton-exportar {
  display: inline-block;
  padding: 6px 14px;
  font-size: 15px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.boton-exportar:hover {
  background-color: #218838;
}

/* ===== Tabla Responsiva con Scroll Horizontal ===== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.responsive-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: auto;
}

.responsive-table th,
.responsive-table td {
  border: 1px solid black;
  padding: 5px;
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
}

/* Encabezado fijo */
.responsive-table thead th {
  position: sticky;
  top: 0;
  background-color: #f1f1f1;
  z-index: 2;
}

/* Adaptabilidad móvil para tablas */
@media screen and (max-width: 700px) {
  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    display: block;
    margin-bottom: 15px;
  }

  .responsive-table td {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border: 1px solid #ccc;
    text-align: left;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-weight: bold;
    flex-basis: 45%;
  }
}

/* ===== Imagen centrada y adaptada al dispositivo ===== */
#pdo {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #34495e;
  padding: 20px;
  min-height: 50vh; /* se ajusta al contenido */
  text-align: center;
  box-sizing: border-box;
}

#pdo a {
  display: inline-block;
}

.responsive-img {
  max-width: 100%;       /* nunca supera el ancho del contenedor */
  max-height: 80vh;      /* altura máxima según pantalla */
  height: auto;
  object-fit: contain;   /* mantiene proporciones */
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Ajustes en tablets */
@media (max-width: 1024px) {
  .responsive-img {
    max-height: 70vh;
  }
}

/* Ajustes en móviles */
@media (max-width: 768px) {
  #pdo {
    padding: 10px;
  }
  .responsive-img {
    max-height: 60vh;
  }
}

/* Ajustes en pantallas muy pequeñas */
@media (max-width: 480px) {
  .responsive-img {
    max-height: 50vh;
  }
}

/* ===== Otros elementos varios ===== */
.titulo1 {
  background-color: green;
  color: white;
  padding: 10px;
  font-weight: bold;
  text-align: center;
}

.info_clases {
  display: inline-block;
  background-color: beige;
  width: 200px;
  padding: 10px;
  margin: 5px;
  box-sizing: border-box;
  border: 2px solid black;
}

/* Botón flotante esquina superior derecha */
.boton-flotante {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1000;
  background-color: #4CAF50;
  color: white;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s, transform 0.2s;
}

.boton-flotante:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

/* ===== Filtro de Años ===== */
.filtro-anios-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

.filtro-anios-container label {
  font-weight: bold;
  font-size: 16px;
  color: #333;
}

.filtro-anios-container select {
  padding: 6px 12px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f9f9f9;
  transition: border-color 0.3s ease;
}

.filtro-anios-container select:focus {
  outline: none;
  border-color: #007BFF;
  background-color: #fff;
}

.filtro-anios-container input[type="submit"] {
  padding: 6px 14px;
  font-size: 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.filtro-anios-container input[type="submit"]:hover {
  background-color: #0056b3;
}
