/* ==========================================================================
   ========== LACAJATONTA - HOJA DE ESTILOS UNIFICADA (TEMA OSCURO) ==========
   ========================================================================== */

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

:root {
  --bg: #0a0a0a;
  --text: #f0f0f0;
  --primary: #c90000;
  --primary-hover: #ff1a1a;
  --button-bg: #1f1f1f;
  --header-bg: #141414;
  --card-bg: #1e1e1e;
  --card-hover-bg: #333333;
  --accent-neon: rgba(57, 255, 20, 0.4);
  --accent-neon-hover: rgba(57, 255, 20, 1);
  --accent-neon-shadow: rgba(57, 255, 20, 0.3);
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg);
  background-image: linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0.85)), url('bgo.png');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
  overflow-x: hidden;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Safe area: evita que la barra de navegación del móvil tape el contenido inferior */
@supports (padding-bottom: var(--safe-bottom)) {
  body {
    padding-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px)) + 20px);
  }
}

/* ========== SECCIONES GENERALES ========== */
section,
.noticias,
.enlaces-interes {
  padding: 20px;
  margin: 15px 0;
  background-color: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 10px var(--accent-neon-shadow);
  font-size: clamp(1rem, 3vw, 1.3rem);
  border: 2px solid var(--accent-neon);
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: #fff;
  margin-bottom: 20px;
  font-weight: bold;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #fff;
  text-transform: uppercase;
}

section.nuevo h2,
.noticias h2 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin-bottom: 15px;
  color: #66ff66 !important;
}

ul,
section.nuevo ul,
.noticias ul,
.enlaces-interes ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

a,
section.nuevo a,
.noticias a {
  text-decoration: none;
  color: #66b2ff;
  font-size: clamp(1rem, 3vw, 1.3rem);
  display: inline-block;
  padding: 8px 12px;
  transition: color 0.3s ease, transform 0.2s ease;
}

a:hover,
section.nuevo a:hover,
.noticias a:hover {
  color: #99ccff;
  text-decoration: none;
  transform: scale(1.02);
}

/* ========== FORMULARIOS DE ACCESO (LOGIN / REGISTRO) ========== */
.form-login {
  width: 98%;
  max-width: min(98vw, 85vh); 
  aspect-ratio: 1 / 1;
  container-type: size;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  background: var(--card-bg);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.7), 0 0 15px var(--accent-neon-shadow);
  padding: 5.5cqw; 
  border-radius: 4cqw;
  border: 0.5cqw solid var(--accent-neon);
  color: var(--text);
  margin: 10px auto;
  box-sizing: border-box;
  text-align: left;
  overflow: hidden;
}

.form-login h5 {
  margin: 0;
  padding-bottom: 2cqw;
  text-align: center;
  border-bottom: 0.4cqw solid var(--primary);
  font-size: 8cqw;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.2cqw;
}

.form-login .controls {
  width: 100%;
  height: 14cqw;
  border: 0.25cqw solid #333;
  margin-bottom: 0;
  padding: 0 4cqw; 
  background: #111;
  color: #fff;
  font-size: 4.5cqw;
  border-radius: 1.8cqw;
  outline: none;
  display: flex;
  align-items: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-login .controls:focus {
  border-color: var(--primary);
  box-shadow: 0 0 2cqw rgba(201, 0, 0, 0.5);
}

.form-login input[type="submit"].controls {
  background: var(--primary);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.2cqw;
  height: 11.5cqw;
  font-size: 4.5cqw;
  margin-top: 1cqw;
  margin-bottom: 0;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form-login input[type="submit"].controls:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 3cqw rgba(201, 0, 0, 0.8);
  transform: translateY(-0.4cqw);
}

.form-login p {
  text-align: center;
  margin-top: 0.5cqw; 
  margin-bottom: 0;
  color: #aaa;
  font-size: 3.8cqw;
  display: flex;
  justify-content: center;
  gap: 1.5cqw;
  flex-wrap: wrap;
}

.form-login a {
  color: #ff7777; 
  text-decoration: none;
  font-size: 3.6cqw;
  display: inline-block;
  padding: 0.5cqw 1cqw;
  transition: color 0.3s ease, transform 0.2s ease;
}

.form-login a:hover {
  color: #ff9999; 
  text-decoration: underline;
  transform: scale(1.02);
}

.opciones-login {
  display: flex;
  flex-direction: column;
  gap: 1.5cqw; 
  margin-bottom: 1.5cqw;
}

.recordar-usuario,
.mantener-sesion {
  font-size: 3.6cqw;
  display: flex;
  align-items: center;
  gap: 2.5cqw;
  color: #ccc;
}

.recordar-usuario input[type="checkbox"],
.mantener-sesion input[type="checkbox"] {
  width: 5.2cqw;
  height: 5.2cqw;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 0.4cqw solid var(--primary);
  border-radius: 1.2cqw;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  background-color: #111;
  transition: background-color 0.2s, border-color 0.2s;
}

.recordar-usuario input[type="checkbox"]:checked,
.mantener-sesion input[type="checkbox"]:checked {
  background-color: var(--primary);
  border-color: var(--primary-hover);
}

.recordar-usuario input[type="checkbox"]:checked::before,
.mantener-sesion input[type="checkbox"]:checked::before {
  content: '✔';
  font-size: 3.4cqw;
  color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
}

.recordar-usuario input[type="checkbox"]:focus,
.recordar-usuario input[type="checkbox"]:focus-visible,
.mantener-sesion input[type="checkbox"]:focus,
.mantener-sesion input[type="checkbox"]:focus-visible {
  outline: 3px solid #ffd700;
  outline-offset: 3px;
  border-color: #ffd700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.45), 0 0 16px rgba(255, 215, 0, 0.6);
}

.recordar-usuario label,
.mantener-sesion label {
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  font-size: 3.4cqw;
}

/* ========== SECCIÓN DE CONTACTO ========== */
.form-group {
  margin-bottom: 24px;
  text-align: left;
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  color: #ccc;
  font-weight: bold;
  font-size: 1.1rem;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: #111;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(201, 0, 0, 0.5);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

button[type="submit"] {
  background-color: var(--primary);
  color: white;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

button[type="submit"]:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 0 15px rgba(201, 0, 0, 0.8);
  transform: translateY(-2px);
}

/* ========== ADMINISTRACIÓN ========== */
.admin-section {
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: 14px;
  width: 100%;
  max-width: 900px;
  margin: 15px auto;
  border: 2px solid var(--accent-neon);
}

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

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

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

.admin-columns a {
  text-decoration: none;
  color: #fff;
  background: #1f1f1f;
  padding: 10px 15px;
  border-radius: 8px;
  display: block;
  border: 1px solid #333;
  transition: all 0.3s ease;
}

.admin-columns a:hover {
  background: var(--card-hover-bg);
  border-color: var(--accent-neon-hover);
  box-shadow: 0 0 10px var(--accent-neon-shadow);
  color: var(--text);
}

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

.admin-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  width: 100%;
}

.admin-grid a {
  background-color: #1f1f1f;
  color: #fff;
  padding: 15px;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  border: 1px solid #333;
  transition: all 0.3s ease;
}

.admin-grid a:hover {
  background-color: var(--card-hover-bg);
  border-color: var(--accent-neon-hover);
  box-shadow: 0 0 12px var(--accent-neon-shadow);
}

/* ========== ESTILOS DE TABLAS DE DATOS ========== */
.table-container {
  overflow-x: auto;
  margin: 20px 0;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #333;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: #141414;
}

th, td {
  padding: 12px 15px;
  text-align: center;
  border: 1px solid #2a2a2a;
}

th {
  background-color: #1c1c1c;
  font-weight: bold;
  color: #66ff66; 
  text-transform: uppercase;
  font-size: 0.95rem;
}

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

tr:hover {
  background-color: #222;
}

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

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

  .form-login {
    width: 98%;
    max-width: 98%;
    aspect-ratio: 1 / 1;
    padding: 5.5cqw;
    margin: 15px auto;
  }

  .noticias,
  .enlaces-interes {
    font-size: 1rem;
    padding: 15px;
  }

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

  table, thead, tbody, th, td, tr {
    display: block;
  }

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

  tr {
    border: 1px solid #333;
    margin-bottom: 12px;
    background-color: #141414;
    border-radius: 8px;
    overflow: hidden;
  }

  td {
    border: none;
    border-bottom: 1px solid #222;
    position: relative;
    padding-left: 50%;
    text-align: right;
    font-size: 0.9rem;
  }

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

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

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

/* ========== ACCESIBILIDAD Y SOPORTE ANDROID TV ========== */
a:focus,
a:focus-visible,
a:active,
button:focus,
button:focus-visible,
button:active,
input:focus,
input:focus-visible,
textarea:focus,
[tabindex]:focus,
[tabindex]:focus-visible {
  outline: 4px solid #66ff66;
  outline-offset: 2px;
  background-color: rgba(102, 255, 102, 0.15);
  border-radius: 8px;
  box-shadow: 0 0 15px 5px rgba(102, 255, 102, 0.6);
  transition: outline 0.1s ease-in, background-color 0.1s ease-in;
}
