/* --- Radio Atalaya Persistent Bar & Continuous Nav --- */

:root {
  --at-safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  padding-bottom: calc(72px + var(--at-safe-bottom)) !important;
}

#atalaya-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + var(--at-safe-bottom));
  padding-bottom: var(--at-safe-bottom);
  background: #11161d;
  border-top: 2px solid #74ddc7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 20px;
  padding-right: 20px;
  z-index: 9999999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}

@supports (backdrop-filter: blur(12px)) {
  #atalaya-sticky-bar {
    background: rgba(18, 22, 28, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

.at-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.at-logo-disc {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  background: #000;
  border: 2px solid #74ddc7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(116, 221, 199, 0.35);
  animation: at-rotate 12s linear infinite paused;
}
.at-logo-disc.spinning {
  animation-play-state: running;
}
@keyframes at-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.at-logo-disc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.at-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.at-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.at-status {
  font-size: 11px;
  color: #74ddc7;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.at-pulse-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: at-pulse 1.4s infinite;
}
@keyframes at-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

/* Sound Wave bars */
.at-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  margin-left: 6px;
}
.at-wave-bar {
  width: 3px;
  background: #74ddc7;
  border-radius: 2px;
  height: 3px;
}
.at-playing .at-wave-bar:nth-child(1) { animation: at-wave-anim 0.8s infinite ease-in-out; }
.at-playing .at-wave-bar:nth-child(2) { animation: at-wave-anim 1.1s infinite ease-in-out 0.2s; }
.at-playing .at-wave-bar:nth-child(3) { animation: at-wave-anim 0.9s infinite ease-in-out 0.4s; }
.at-playing .at-wave-bar:nth-child(4) { animation: at-wave-anim 1.2s infinite ease-in-out 0.1s; }
@keyframes at-wave-anim {
  0%, 100% { height: 3px; }
  50% { height: 14px; }
}

.at-center {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
}

.at-play-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: #74ddc7;
  border: none;
  color: #12161c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(116, 221, 199, 0.45);
  transition: transform 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.at-play-btn:active {
  transform: scale(0.94);
}
.at-play-btn svg {
  width: 20px;
  height: 20px;
  fill: #12161c;
}

.at-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.at-vol {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
}
.at-vol input[type="range"] {
  width: 80px;
  accent-color: #74ddc7;
  cursor: pointer;
}

.at-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(116, 221, 199, 0.14);
  color: #74ddc7;
  border: 1px solid rgba(116, 221, 199, 0.4);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.at-btn-pill:hover, .at-btn-pill:active {
  background: #74ddc7;
  color: #12161c;
}

/* Continuous navigation loading indicator */
#at-nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #74ddc7, #38bdf8);
  z-index: 10000000;
  transition: width 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}
#at-nav-bar.active {
  opacity: 1;
}

/* Ensure schedule image renders with proper aspect ratio and zoom cursor */
img[data-src*="PROGRAMACION"], img[src*="PROGRAMACION"], .wp-image-1804 {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  cursor: zoom-in;
}

/* --- Mobile specific optimizations --- */
@media (max-width: 768px) {
  #atalaya-sticky-bar {
    padding-left: 12px;
    padding-right: 12px;
    /* On mobile, use solid background to prevent scroll lag with heavy blur */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #11161d !important;
  }
  .at-vol {
    display: none !important;
  }
  .at-logo-disc {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }
  .at-title {
    font-size: 12.5px;
    max-width: 150px;
  }
  .at-status {
    font-size: 10px;
  }
  .at-btn-pill {
    padding: 5px 8px;
    font-size: 11px;
    gap: 4px;
  }
  .at-play-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }
}

@media (max-width: 420px) {
  .at-title {
    max-width: 120px;
  }
  .at-wave {
    display: none !important;
  }
  .at-btn-pill span.btn-label {
    display: none;
  }
  .at-btn-pill {
    padding: 6px;
    border-radius: 50%;
  }
}
