/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: url('bg.png') center/cover no-repeat fixed;
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centra el contenido verticalmente */
  align-items: center; /* Centra el contenido horizontalmente */
  min-height: 100vh;
  padding: 20px;
  text-align: center;
}

/* ========== SECCIONES GENERALES ========== */
section,
.noticias,
.enlaces-interes {
  padding: 15px;
  margin: 10px 0;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: clamp(1rem, 3vw, 1.5rem);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  width: 95vw;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Sección de Noticias - Propiedades Corregidas y Optimizadas */
.noticias {
  justify-content: center;
  align-items: center;
  max-width: 700px;
  width: 80vw;
  border: 5px solid #007BFF;
  border-radius: 10px;
}

/* Estilos para el texto dentro de la sección de noticias */
.noticias h2 {
  font-size: clamp(1.8rem, 7.2vw, 3rem);
  margin-bottom: 5px;
  color: #ab1501;
}

.noticias ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.noticias ul li {
  display: flex;
  align-items: center;
  justify-content: center;
}

.noticias ul li a {
  text-decoration: none;
  color: #007BFF;
  font-size: clamp(1rem, 4.5vw, 2rem);
  display: block;
  padding: 5px;
  text-align: center;
}

.noticias ul li a:hover {
  text-decoration: underline;
}

/* ========== FORMULARIO DE LOGIN ========== */
.form-login {
  width: 90vw;
  max-width: 500px;
  background: #4e4d4d;
  box-shadow: 7px 13px 37px #000;
  padding: 30px 40px;
  border-top: 8px solid #ab1501;
  color: #f7f8a5;
  margin: auto;
}

.form-login h5 {
  margin-bottom: 30px;
  text-align: center;
  border-bottom: 1px solid;
  font-size: clamp(1.7rem, 7vw, 3rem);
}

.controls {
  width: 100%;
  border: 1px solid #017bab;
  margin-bottom: 15px;
  padding: 11px 10px;
  background: #adac65;
  font-size: 1.4em;
  font-weight: bold;
}

.buttons {
  width: 100%;
  height: 40px;
  background: #017bab;
  border: none;
  color: #fd9090;
  margin-bottom: 16px;
  cursor: pointer;
}

.form-login p {
  text-align: center;
  border-bottom: 1px solid;
  padding: 10px 0;
}

.form-login a {
  color: #ff7777;
  text-decoration: none;
  font-size: 1.4em;
}

.form-login a:hover {
  text-decoration: underline;
}

/* Estilos para el checkbox de 'Recordar usuario' */
.recordar-usuario {
  font-size: 1.4em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.recordar-usuario input[type="checkbox"] {
  width: 30px;
  height: 30px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 2px solid #007BFF;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.recordar-usuario input[type="checkbox"]:checked::before {
  content: '✔';
  font-size: 16px;
  color: #007BFF;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.recordar-usuario label {
  cursor: pointer;
  font-size: 30px;
  word-break: break-word;
}

/* ========== ADMINISTRACIÓN ========== */
.admin-section {
  padding: 20px;
  background-color: #f5f5f5;
  border-radius: 10px;
  width: 95vw;
  max-width: 900px;
  margin: 10px auto;
}

.admin-columns {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-columns ul {
  flex: 1;
  list-style: none;
  padding: 0;
}

.admin-columns li {
  margin-bottom: 10px;
}

.admin-columns a {
  text-decoration: none;
  color: #007BFF;
}

.admin-columns a:hover {
  text-decoration: underline;
}

.admin-columns i {
  margin-right: 8px;
  color: #444;
}

#admin {
  margin-top: 5px;
}

#admin h2 {
  font-size: 1.5rem;
}

.admin-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.admin-grid a {
  background-color: #eef;
  padding: 10px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.admin-grid a:hover {
  background-color: #dde;
}

/* ========== ESTILOS DE LA TABLA (AÑADIDOS Y OPTIMIZADOS) ========== */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

.no-data {
    text-align: center;
    font-style: italic;
    color: #888;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 600px) {
  body {
    padding: 10px;
    background-attachment: scroll;
  }

  .form-login {
    padding: 15px 20px;
  }

  .noticias,
  .enlaces-interes {
    font-size: 5vw;
    padding: 10px;
  }

  .admin-grid a {
    width: 100%;
  }

  /* Cambios para la tabla en orientación vertical */
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    border: 1px solid #ccc;
    margin-bottom: 10px;
  }

  td {
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50%;
    text-align: right;
  }

  td:before {
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    content: attr(data-label);
    text-align: left;
    font-weight: bold;
  }
}

@media (min-width: 601px) {
  .admin-columns {
    flex-direction: row;
  }

  .admin-grid a {
    width: calc(50% - 10px);
  }
