/* ==============================
   VARIABLES Y UTILIDADES
   ============================== */
:root {
  --rev-bg-header: #ffffff;
  --rev-bg-page: #f8f9fa;
  --rev-primary: #007cba;
  --rev-primary-dark: #005a87;
  --rev-danger: #e74c3c;
  --rev-text-dark: #2c3e50;
  --rev-text-muted: #7f8c8d;
  --rev-border-light: #e9ecef;
  --rev-shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
  --rev-shadow-medium: 0 6px 20px rgba(0, 0, 0, 0.12);
  --rev-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* ==============================
   CONTENEDOR PRINCIPAL - PROGRAMA EN VIVO
   ============================== */
.rev-live-container {
  display: flex;
  align-items: flex-start;
  background: var(--rev-bg-header);
  padding: clamp(15px, 4vw, 45px);
  border-radius: 16px;
  box-shadow: var(--rev-shadow-medium);
  margin: 30px 0;
  flex-wrap: wrap;
  gap: clamp(15px, 3vw, 50px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ==============================
   PROGRAMA ACTUAL (EN VIVO)
   ============================== */
.rev-current-program {
  display: flex;
  align-items: flex-start;
  position: relative;
  flex: 1;
  min-width: 300px;
  overflow: visible;
}

.rev-program-image-container {
  position: relative;
  top: -55px;
  margin-right: 30px;
  flex-shrink: 0;
  z-index: 2;
}

.rev-program-image {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border: 4px solid #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
}

.rev-program-image:hover {
  transform: scale(1.08);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.rev-program-info {
  flex: 1;
}

.rev-program-info h3 {
  margin: 0 0 8px;
  font-size: clamp(1.2em, 4vw, 1.4em);
  color: var(--rev-text-dark);
  font-weight: 700;
}

.rev-program-info p {
  margin: 4px 0;
  color: #555;
  font-size: clamp(0.85em, 2.5vw, 0.95em);
}

/* BADGE "EN VIVO" */
.rev-live-badge {
  display: inline-block;
  background: var(--rev-danger);
  color: white;
  padding: 6px 14px;
  border-radius: 30px;
  font-weight: bold;
  font-size: clamp(0.8em, 2.2vw, 0.9em);
  letter-spacing: 0.5px;
  margin-top: 12px;
  animation: revBlink 1.8s infinite;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

@keyframes revBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* ==============================
   PRÓXIMOS PROGRAMAS
   ============================== */
.rev-next-programs {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(0, 0, 0, 0.03);
  padding: 20px;
  border-radius: 12px;
  min-width: 250px;
}

.rev-next-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rev-mini-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.rev-next-item > div {
  flex: 1;
  min-width: 0;
}

.rev-next-label {
  font-size: clamp(0.7em, 2vw, 0.75em);
  color: #95a5a6;
  display: block;
  margin-bottom: 2px;
}

.rev-next-title {
  font-weight: 600;
  color: var(--rev-text-dark);
  font-size: clamp(0.9em, 2.8vw, 0.95em);
  line-height: 1.3;
  margin-bottom: 2px;
}

.rev-next-time {
  display: block;
  font-size: clamp(0.7em, 2vw, 0.8em);
  color: var(--rev-text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* ==============================
   PESTAÑAS DE DÍAS DE LA SEMANA
   ============================== */
.rev-full-schedule-tabs {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-top: 20px;
}

.rev-days-navigation {
  display: flex;
  background: #ffffff;
  border-bottom: 2px solid var(--rev-border-light);
  overflow-x: auto; /* Permite scroll horizontal en móviles */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 0 8px;
}

.rev-days-navigation::-webkit-scrollbar {
  height: 6px;
}

.rev-days-navigation::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.rev-day-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 100px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  color: #6c757d;
  transition: all 0.3s ease;
  font-size: clamp(0.85em, 2.5vw, 0.95em);
  white-space: nowrap;
  flex: 0 0 auto; /* Evita que se encojan */
}

.rev-day-tab:hover {
  background: #f8f9fa;
  color: #495057;
}

.rev-day-tab.active {
  color: var(--rev-primary);
  border-bottom-color: var(--rev-primary);
}

/* BADGE "HOY" EN PESTAÑAS */
.rev-hoy-badge {
  display: inline-block;
  background: var(--rev-danger);
  color: white;
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: bold;
  vertical-align: middle;
  line-height: 1;
}

/* Estilos para el día actual */
.rev-day-tab.active[data-dia="<?php echo $dia_actual; ?>"] {
  background: linear-gradient(135deg, var(--rev-primary) 0%, var(--rev-primary-dark) 100%);
  color: white;
  border-bottom: none;
}

.rev-day-tab.active[data-dia="<?php echo $dia_actual; ?>"] .rev-hoy-badge {
  background: rgba(255, 255, 255, 0.9);
  color: var(--rev-primary);
}

/* ==============================
   CONTENIDO DE PROGRAMACIÓN POR DÍA
   ============================== */
.rev-days-content {
  padding: clamp(20px, 5vw, 30px);
}

.rev-day-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.rev-day-content.active {
  display: block;
}

.rev-day-title {
  background: #ffffff; 
  color: var(--rev-text-dark);
  font-size: clamp(1.5em, 5vw, 1.8em);
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 3px solid #3498db;
  font-weight: 700;
}

.rev-no-programs {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
  font-size: 1.1em;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================
   CUADRÍCULA DE PROGRAMAS
   ============================== */
.rev-programs-grid {
  background: #ffffff;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(15px, 3vw, 25px);
  width: 100%;
}

.rev-program-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--rev-shadow-light);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #f0f0f0;
}

.rev-program-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--rev-shadow-hover);
}

.rev-card-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
  padding: 8px;
  box-sizing: border-box;
}

.rev-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.rev-card-content h3 {
  margin: 0 0 8px;
  font-size: clamp(1.1em, 3.5vw, 1.2em);
  line-height: 1.3;
  color: var(--rev-text-dark);
  font-weight: 700;
}

.rev-conductor {
  margin: 0 0 8px;
  color: var(--rev-text-muted);
  font-size: 0.95em;
  font-weight: 500;
}

.rev-time {
  margin: 0 0 12px;
  color: var(--rev-primary);
  font-weight: 600;
  font-size: 0.9em;
}

.rev-description {
  margin: auto 0 0;
  color: #5d6d7e;
  font-size: 0.9em;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==============================
   ESTILOS PARA FONDO OSCURO / IMAGEN DE FONDO
   ============================== */
.rev-live-container.has-bg-image {
  background-color: rgba(0, 0, 0, 0.6) !important;
  color: white !important;
}

.rev-live-container.has-bg-image .rev-program-title,
.rev-live-container.has-bg-image .rev-program-host,
.rev-live-container.has-bg-image .rev-program-time,
.rev-live-container.has-bg-image .rev-next-label,
.rev-live-container.has-bg-image .rev-next-title {
  color: white !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ==============================
   MEDIA QUERIES - AJUSTES FINALES
   ============================== */

/* Móviles pequeños: mantener pestañas horizontales con scroll */
@media (max-width: 767px) {
  .rev-live-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .rev-current-program {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .rev-program-image-container {
    top: -20px;
    margin-right: 0;
    margin-bottom: 15px;
  }

  .rev-program-image {
    width: 80px;
    height: 80px;
  }

  .rev-program-info {
    align-items: center;
  }

  .rev-next-programs {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    min-width: auto;
  }

  .rev-next-item {
    flex: 1 1 45%;
    flex-direction: column;
    text-align: center;
    min-width: 120px;
  }

  .rev-days-navigation {
    /* Mantener horizontal con scroll */
    flex-wrap: nowrap;
    padding: 0 4px;
  }

  .rev-day-tab {
    padding: 12px 14px;
    font-size: 0.85em;
  }

  /* Badge "HOY" en móviles pequeños */
  .rev-hoy-badge {
    font-size: 0.65em;
    padding: 1px 4px;
    margin-left: 4px;
  }
}

@media (max-width: 480px) {
  .rev-program-image {
    width: 70px;
    height: 70px;
  }

  .rev-next-programs {
    flex-direction: column;
    gap: 15px;
  }

  .rev-next-item {
    flex: 1 1 100%;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
  }

  .rev-mini-image {
    width: 40px;
    height: 40px;
  }

  .rev-card-content {
    padding: 15px;
  }

  .rev-card-image {
    height: 180px;
    padding: 5px;
  }
}