/* ============================================
   Variables CSS para fácil personalización
   ============================================ */
:root {
  --color-primario: #1976d2;
  --color-primario-oscuro: #125ba3;
  --color-secundario: #0288d1;
  --color-acento: #ff9800;
  --color-exito: #4caf50;
  --color-alerta: #ffc107;
  --color-error: #f44336;
  --color-texto: #333;
  --color-texto-claro: #666;
  --color-fondo: #f5f9fc;
  --color-blanco: #ffffff;
  --color-borde: #e0e0e0;
  --sombra-suave: 0 2px 8px rgba(0, 0, 0, 0.1);
  --sombra-media: 0 4px 12px rgba(0, 0, 0, 0.15);
  --transicion: all 0.3s ease;
  --radio-borde: 8px;
  --espaciado: 20px;
}

/* ============================================
   Reset y estilos base
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--color-fondo);
  color: var(--color-texto);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Header Principal - Diseño Moderno
   ============================================ */
.principal-header {
  background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
  color: var(--color-blanco);
  padding: 20px 30px;
  box-shadow: var(--sombra-media);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideDown 0.5s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo-container img {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: var(--transicion);
}

.logo-container img:hover {
  transform: scale(1.05);
}

.logo-container span {
  font-weight: 700;
  font-size: 1.1em;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Botón de Pago Destacado */
.payment-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.payment-btn {
  background: linear-gradient(135deg, var(--color-acento) 0%, #ff6f00 100%);
  color: var(--color-blanco);
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2em;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
  transition: var(--transicion);
  border: 3px solid rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.payment-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.payment-btn:hover::before {
  width: 300px;
  height: 300px;
}

.payment-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
}

/* Información de Emergencias */
.emergency-container {
  text-align: right;
  font-size: 0.95em;
}

.emergency-container > div:first-child {
  font-weight: 700;
  font-size: 1.1em;
  margin-bottom: 8px;
  color: var(--color-acento);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.emergency-container a {
  color: var(--color-blanco);
  text-decoration: none;
  transition: var(--transicion);
}

.emergency-container a:hover {
  color: var(--color-acento);
}

/* ============================================
   Navegación Principal
   ============================================ */
nav {
  background: var(--color-blanco);
  box-shadow: var(--sombra-suave);
  position: sticky;
  top: 140px;
  z-index: 999;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0;
  margin: 0;
}

nav ul li {
  position: relative;
}

nav ul li a {
  display: block;
  padding: 18px 28px;
  text-decoration: none;
  color: var(--color-texto);
  font-weight: 600;
  transition: var(--transicion);
  position: relative;
  overflow: hidden;
}

nav ul li a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--color-primario);
  transition: var(--transicion);
  transform: translateX(-50%);
}

nav ul li a:hover {
  color: var(--color-primario);
  background: var(--color-fondo);
}

nav ul li a:hover::before {
  width: 80%;
}

/* ============================================
   Main Content
   ============================================ */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 30px;
  width: 100%;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Títulos */
h1 {
  color: var(--color-primario);
  font-size: 2.5em;
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  padding-bottom: 15px;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-primario), transparent);
  border-radius: 2px;
}

h2 {
  color: var(--color-primario);
  font-size: 1.8em;
  margin: 30px 0 20px;
  padding-left: 15px;
  border-left: 5px solid var(--color-primario);
}

/* ============================================
   Página de Inicio
   ============================================ */
.contenido-principal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--color-blanco);
  padding: 40px;
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra-media);
}

.texto-izquierda h1 {
  text-align: left;
  font-size: 2.2em;
}

.texto-izquierda h1::after {
  left: 0;
  transform: none;
}

.texto-izquierda p {
  margin-bottom: 20px;
  line-height: 1.8;
  color: var(--color-texto-claro);
}

.foto-derecha img {
  width: 100%;
  height: auto;
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra-media);
  transition: var(--transicion);
}

.foto-derecha img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Comunicados
   ============================================ */
.comunicacion-item {
  background: var(--color-blanco);
  padding: 30px;
  margin-bottom: 25px;
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra-suave);
  transition: var(--transicion);
  border-left: 5px solid var(--color-primario);
}

.comunicacion-item:hover {
  box-shadow: var(--sombra-media);
  transform: translateX(5px);
}

.comunicacion-item h2 {
  color: var(--color-primario);
  font-size: 1.5em;
  margin: 0 0 15px 0;
  padding: 0;
  border: none;
}

.comunicacion-item p {
  color: var(--color-texto-claro);
  line-height: 1.8;
  margin-bottom: 15px;
}

.comunicacion-item small {
  color: var(--color-texto-claro);
  font-style: italic;
  display: block;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--color-borde);
}

.comunicacion-item.destacado {
  border-left-color: var(--color-acento);
  background: linear-gradient(135deg, var(--color-blanco) 0%, #fff8e1 100%);
}

/* ============================================
   Formularios
   ============================================ */
form {
  background: var(--color-blanco);
  padding: 40px;
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra-media);
  max-width: 700px;
  margin: 30px auto;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-texto);
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 20px;
  border: 2px solid var(--color-borde);
  border-radius: var(--radio-borde);
  font-size: 1em;
  transition: var(--transicion);
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primario);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

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

button[type="submit"],
.btn-primary {
  background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
  color: var(--color-blanco);
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transicion);
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
}

button[type="submit"]:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* ============================================
   Mensajes y Alertas
   ============================================ */
.mensaje-exito {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #2e7d32;
  padding: 20px;
  border-radius: var(--radio-borde);
  margin-bottom: 25px;
  border-left: 5px solid var(--color-exito);
  box-shadow: var(--sombra-suave);
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mensaje-error {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  color: #c62828;
  padding: 20px;
  border-radius: var(--radio-borde);
  margin-bottom: 25px;
  border-left: 5px solid var(--color-error);
  box-shadow: var(--sombra-suave);
}

.mensaje-alerta {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  color: #f57c00;
  padding: 20px;
  border-radius: var(--radio-borde);
  margin-bottom: 25px;
  border-left: 5px solid var(--color-alerta);
  box-shadow: var(--sombra-suave);
}

/* ============================================
   Footer
   ============================================ */
footer {
  background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
  color: var(--color-blanco);
  text-align: center;
  padding: 25px 20px;
  margin-top: auto;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

footer small {
  font-size: 0.9em;
  opacity: 0.9;
}

footer a {
  color: var(--color-acento);
  text-decoration: none;
  transition: var(--transicion);
}

footer a:hover {
  text-decoration: underline;
}

/* ============================================
   Secciones de Contenido
   ============================================ */
section {
  background: var(--color-blanco);
  padding: 30px;
  margin-bottom: 30px;
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra-suave);
}

section p {
  line-height: 1.8;
  color: var(--color-texto-claro);
  margin-bottom: 15px;
}

.listado {
  background: var(--color-fondo);
  padding: 20px;
  border-radius: var(--radio-borde);
  margin: 20px 0;
  white-space: pre-line;
  line-height: 1.8;
}

/* ============================================
   Tablas (para gestores admin)
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-blanco);
  border-radius: var(--radio-borde);
  overflow: hidden;
  box-shadow: var(--sombra-suave);
  margin: 20px 0;
}

thead {
  background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
  color: var(--color-blanco);
}

th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.5px;
}

td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--color-borde);
}

tr:hover {
  background: var(--color-fondo);
}

tr:last-child td {
  border-bottom: none;
}

/* ============================================
   Badges y Estados
   ============================================ */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-warning {
  background: #fff8e1;
  color: #f57c00;
}

.badge-danger {
  background: #ffebee;
  color: #c62828;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 992px) {
  .principal-header {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .emergency-container {
    text-align: center;
  }

  .contenido-principal {
    grid-template-columns: 1fr;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav ul li a {
    border-bottom: 1px solid var(--color-borde);
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.5em;
  }
}

@media (max-width: 768px) {
  main {
    padding: 20px 15px;
  }

  form {
    padding: 25px;
  }

  .principal-header {
    padding: 15px 20px;
    top: 0;
  }

  nav {
    top: auto;
    position: static;
  }

  .logo-container img {
    width: 60px;
  }

  .logo-container span {
    font-size: 1em;
  }

  .payment-btn {
    padding: 12px 24px;
    font-size: 1em;
  }

  table {
    font-size: 0.9em;
  }

  th, td {
    padding: 10px 8px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.6em;
  }

  .contenido-principal,
  section {
    padding: 20px;
  }

  .comunicacion-item {
    padding: 20px;
  }
}

/* ============================================
   Utilidades
   ============================================ */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.card {
  background: var(--color-blanco);
  padding: 25px;
  border-radius: var(--radio-borde);
  box-shadow: var(--sombra-suave);
  transition: var(--transicion);
}

.card:hover {
  box-shadow: var(--sombra-media);
  transform: translateY(-3px);
}

/* ============================================
   Animaciones de carga
   ============================================ */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(25, 118, 210, 0.3);
  border-radius: 50%;
  border-top-color: var(--color-primario);
  animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
