/* =========================
   ESTILOS GENERALES
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: #fdfdfd;
  color: #2f4f2f;
  line-height: 1.6;
  padding-top: 80px; /* Sincronizado con el nuevo alto del header */
}

/* =========================
   ENCABEZADO FIJO
========================= */
.main-header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  transition: all 0.4s ease;
  height: 80px; /* Un poco más alto para mejor estética */
}

.main-header.hide {
  transform: translateY(-100%);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo img {
  height: 48px;
}

.logo h1 {
  font-size: 1.3rem;
  color: #006b3f;
  font-weight: 700;
}

/* =========================
   MENÚ DE NAVEGACIÓN
========================= */
.nav-menu {
  display: flex;
  gap: 1.5rem;
}

.nav-menu a {
  text-decoration: none;
  color: #2f4f2f;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #006b3f;
  font-weight: 600;
}

/* =========================
   SECCIONES GENERALES
========================= */
.section-container {
  max-width: 1200px;
  margin: 4rem auto 2rem auto; /* Reducido de 7rem/4rem para eliminar espacios */
  padding: 0 1.5rem;
}

.intro {
  text-align: center;
  margin-bottom: 3rem;
}

.intro h2 {
  font-size: 2rem;
  color: #006b3f;
  margin-bottom: 1rem;
}

/* =========================
   TABLA DE PROGRAMAS
========================= */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.schedule-table th,
.schedule-table td {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

.schedule-table th {
  background: #006b3f;
  color: white;
  font-weight: 600;
}

.schedule-table tr:hover td {
  background: #f3f9f5;
}

/* =========================
   TARJETAS DE PROGRAMAS
========================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
  text-align: center;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card h4 {
  color: #006b3f;
  margin: 1rem 0 0.5rem;
}

.card p {
  padding: 0 1rem 1.5rem;
  font-size: 0.95rem;
}

/* =========================
   CONTACTO
========================= */
.contact-placeholder {
  background: #f5f8f5;
  border: 1px solid #d6e9d6;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  color: #2f4f2f;
  font-size: 1.05rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.contact-info ul {
  list-style: none;
  margin: 1.5rem 0;
}

.contact-info li {
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.social-media {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.social-icon {
  color: #006b3f;
  font-weight: 600;
  text-decoration: none;
  background: #e6f3ec;
  padding: 0.6rem 1rem;
  border-radius: 30px;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: #006b3f;
  color: white;
}

/* =========================
   BOTÓN ENVIAR
========================= */
.btn-send {
  display: inline-block;
  background: #006b3f;
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease, transform 0.2s ease;
  text-decoration: none;
}

.btn-send:hover {
  background: #049c5a;
  transform: scale(1.05);
}

/* =====================================================
   BANNER VISUAL (solo imagen)
   ===================================================== */
.banner-informativo {
  position: relative;
  width: 100%;
  height: 500px;
  background: #f5f9f4;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.8s ease-in-out;
}

.slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  padding: 15px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  transition: background 0.3s;
}

.carousel-btn:hover { background: rgba(0,0,0,0.6); }
.carousel-btn.prev { left: 20px; }
.carousel-btn.next { right: 20px; }


/* (Estilos unificados en .main-header) */

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 0 5px;          /* Logo pegado pero con un mínimo de aire */
  max-width: 100%;
  width: 100%;
  margin: 0;
  height: 80px;
  flex-wrap: nowrap;              /* Prohibido bajar de línea */
}

.logo img {
  height: 50px;
  width: auto;
  display: block;
}


.header-logo {
  position: absolute;
  bottom: -20px; /* o el valor que tengas ajustado */
  left: -30px; /* mueve la imagen hacia la izquierda */
  z-index: 10;
}

.header-logo img {
  max-height: 180px; /* ajusta el tamaño que ya tenías */
  width: auto;
  object-fit: contain;
}

/* Versión responsive */
@media (max-width: 768px) {
  .header-logo {
    left: -10px; /* menos desplazamiento en pantallas pequeñas */
    bottom: -10px;
  }

  .header-logo img {
    max-height: 120px;
  }
}


/* ======= MENÚ DE NAVEGACIÓN ======= */
.nav-menu {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-grow: 1;
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 30px;
  margin: 0;
  padding: 0;
  white-space: nowrap; /* Evita que los textos se partan */
}

.nav-menu a {
  text-decoration: none;
  color: #155c39;
  font-weight: 600;
  transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu .active {
  color: #f39200;
}

.btn-login {
  background: #155c39;
  color: white !important;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-login:hover {
  background: #f39200;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ==== AUDIO Y EN VIVO ==== */
.seccion-audio {
  display: none; /* Barra antigua innecesaria */
}

.contenedor-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  height: 50px;
  flex-shrink: 0;
  margin-left: 20px;
}

.seccion-audio, .contenedor-audio {
  height: 50px;
  overflow: hidden;
}

audio {
  width: 220px;
  height: 30px;
}

#liveIndicator {
  display: none; /* Oculto para evitar redundancia con el botón principal */
}

.live-waves {
  display: flex;
  gap: 3px;
  height: 15px;
  align-items: flex-end;
}

.live-waves span {
  display: block;
  width: 3px;
  height: 8px;
  background-color: #bbb;
  border-radius: 2px;
}

/* Ondas animadas cuando está "En Vivo" */
#liveIndicator.live .live-waves span {
  background-color: #2ea44f;
  animation: waveMove 1s infinite ease-in-out;
}

#liveIndicator.live .live-waves span:nth-child(1) { animation-delay: 0s; }
#liveIndicator.live .live-waves span:nth-child(2) { animation-delay: 0.2s; }
#liveIndicator.live .live-waves span:nth-child(3) { animation-delay: 0.4s; }

@keyframes waveMove {
  0%, 100% { height: 6px; }
  50% { height: 14px; }
}

/* Estado Fuera del Aire */
#liveIndicator.offline .live-waves span {
  background-color: #aaa;
  animation: none;
}

#liveIndicator.offline #liveText {
  color: #888;
}

/* ==== FOOTER ==== */
.footer {
  background-color: #176941;
  color: #fff;
  text-align: center;
  padding: 30px 20px 10px 20px; /* Reducido padding inferior */
  position: relative;
  z-index: 500;
  overflow: hidden;
  margin-top: 0;                /* Asegura que no haya espacio arriba */
}

.footer a {
  color: #d7f9d5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.footer a:hover {
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
  text-decoration: underline;
}

/* Sin pseudo-elemento de fondo: la marca de agua la hace .footer-watermark */
.footer::before {
  content: none;
}


/* Capas de texto e información */
.footer-container,
.footer-bottom {
  position: relative;
  z-index: 1500;
}

/* estructura interior */
.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: flex-start;
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo img {
  width: 300px;
  margin-bottom: 0px;
}

.footer-info h4,
.footer-social h4 {
  color: #f6b93b;
  margin-bottom: 10px;
}

.footer-info p {
  margin: 5px 0;
  color: #eaeaea;
}

.footer .social-icons a {
  color: #d7f9d5;
  margin: 0 10px;
  font-size: 1.4rem;
  transition: transform 0.3s ease, color 0.3s ease;
}

.footer .social-icons a:hover {
  color: #fff;
  transform: scale(1.15);
}


.footer-bottom {
  margin-top: 15px;
  font-size: 14px;
  padding: 12px;
  color: #eee;
  background: transparent;  /* elimina el fondo */
}

/* ==== Versión Responsive ==== */
@media (max-width: 768px) {
  .contenedor-audio {
    position: relative;    /* vuelve al flujo */
    top: 0;
    right: 0;
    margin-left: 0;
    justify-self: end;
    height: auto;
    padding: 8px 0;
  }

  /* Reduce el ancho del control para móviles */
  audio {
    width: 160px;
  }

  /* Si el menú colapsa y queda demasiado junto, pon el audio debajo */
  .header-container {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
  }
}

/* ======= YOUTUBE EMBED ======= */
.youtube-section {
  text-align: center;
  margin-top: 4rem;
}

.youtube-section h2 {
  color: #006b3f;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.youtube-frame {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16 / 9; /* mantiene proporción correcta */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.youtube-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.footer {
  position: relative;
  overflow: hidden; /* Corta el logo si es muy grande */
  background-color: #004d2c;
  color: #fff;
  padding: 60px 0 20px;
}
.footer a {
  color: #c8f7c5; /* Verde claro institucional CAS */
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.footer a:hover {
  color: #ffffff; /* Blanco puro al pasar el cursor */
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
  text-decoration: underline;
}

/* ==== Imagen institucional del Barranquero ==== */
.barranquero-container {
  position: relative;
  width: 100%;
  height: 0;
}

.barranquero-img {
  position: absolute;
  left: 5%;
  bottom: -140px; /* desborda hacia el banner */
  max-height: 200px;
  z-index: 10;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
  transition: transform 0.4s ease, filter 0.4s ease;
}

.barranquero-img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5));
}

/* Versión responsive */
@media (max-width: 768px) {
  .barranquero-img {
    max-height: 90px;
    left: 2%;
    bottom: -25px;
  }
}


/* Ajuste para empujar el menú a la izquierda y equilibrar el header */
nav ul {
  margin-left: 0; /* antes -100px */
}

nav {
  flex-grow: 0;
  text-align: initial;
}

/* Imagen del barranquero flotando sobre el header */
.barranquero-logo {
  position: absolute;
  top: -20px;
  left: 20px;
  width: 150px;
  max-height: 200px;
  z-index: 20;
  pointer-events: none;
}

/* === Logo institucional en el header === */
.logo-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: auto;
  padding-left: 0;
  margin-left: 0;
}

.site-logo {
  height: 55px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.site-logo:hover {
  transform: scale(1.05); /* Micro-interacción premium */
}

/* === Botón Oír en Vivo === */
.btn-live {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #006b3f, #049c5a);
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 107, 63, 0.4);
  transition: all 0.3s ease;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.btn-live:hover {
  background: linear-gradient(135deg, #049c5a, #06c06e);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 107, 63, 0.5);
}

.btn-live.playing {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  box-shadow: 0 3px 10px rgba(192, 57, 43, 0.45);
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0%, 100% { box-shadow: 0 3px 10px rgba(192, 57, 43, 0.45); }
  50% { box-shadow: 0 5px 20px rgba(192, 57, 43, 0.7); }
}

/* Ondas de frecuencia dentro del botón */
.freq-waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
}

.freq-waves span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.6);
  animation: freqBounce 1.0s infinite ease-in-out;
}

.freq-waves span:nth-child(1) { height: 6px;  animation-delay: 0.0s; }
.freq-waves span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.freq-waves span:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.freq-waves span:nth-child(4) { height: 16px; animation-delay: 0.1s; }
.freq-waves span:nth-child(5) { height: 8px;  animation-delay: 0.25s; }

@keyframes freqBounce {
  0%, 100% { transform: scaleY(1); opacity: 0.6; }
  50% { transform: scaleY(1.8); opacity: 1; }
}

/* === Botón Compartir === */
.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #006b3f;
  background: transparent;
  color: #006b3f;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.btn-share:hover {
  background: #006b3f;
  color: #fff;
  transform: scale(1.1);
}

/* === Logo marca de agua en footer === */
.footer-watermark {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image: url('../img/logo11.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: auto 140%; /* Mucho más grande para legibilidad */
  opacity: 0.18;
  filter: none;
}

.footer-watermark img {
  display: none; /* Usamos background-image para que se repita */
}

.header,
.header-container,
.contenedor-audio {
  overflow: visible; /* evita que se creen capas invisibles */
}

/* =========================================
   RESPONSIVO MULTIDISPOSITIVO (Tablets/Móvil)
========================================= */
@media (max-width: 1000px) {
  .main-header {
    height: auto;
    padding: 10px;
    position: relative; /* Evita que flote encima en celulares cortando el contenido */
  }
  
  .header-container {
    flex-direction: column;
    height: auto;
    padding: 15px 10px;
    gap: 15px;
    align-items: center;
  }
  
  .contenedor-audio {
    position: relative;
    right: auto;
    top: auto;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    height: auto;
    padding: 10px 0;
  }
  
  .nav-menu {
    width: 100%;
    margin-top: 10px;
  }
  
  .nav-menu ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  
  .barranquero-logo {
    position: relative;
    top: 0;
    left: 0;
    width: 120px;
    display: block;
    margin: 0 auto;
  }
  
  body {
    padding-top: 20px; /* Como el header ya no es "fixed" arriba, soltamos el espacio */
  }
}

@media (max-width: 500px) {
  audio {
    width: 220px;
  }
  .btn-login {
    padding: 6px 12px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
  }
}

/* === MODAL DE EXPORTACIÓN === */
.modal-export {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 77, 44, 0.85); /* Verde oscuro institucional con transparencia */
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center; justify-content: center;
  z-index: 10000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-export.active {
  opacity: 1; pointer-events: all;
}
.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  max-width: 350px;
  width: 90%;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-export.active .modal-content {
  transform: translateY(0);
}
.modal-content h3 { color: #006b3f; margin-bottom: 20px; }
.export-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #f9f9f9;
  color: #333;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-opt:hover {
  background: #eef7f0;
  border-color: #006b3f;
  color: #006b3f;
  transform: translateX(5px);
}
.btn-opt i { color: #006b3f; font-size: 1.1rem; }
.btn-close-modal {
  margin-top: 20px;
  background: none;
  border: none;
  color: #888;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}
