/* =============================================
   COMANDANTE GÓMEZ RADIO — DESIGN SYSTEM
   Theme: Black & Gold Military-Luxe
   ============================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Gold palette */
  --gold-100: #f5e6b8;
  --gold-200: #e8d48b;
  --gold-300: #d4a843;
  --gold-400: #c9a84c;
  --gold-500: #b8942f;
  --gold-600: #9a7a1f;
  --gold-700: #7c6219;
  --gold-gradient: linear-gradient(135deg, #d4a843 0%, #c9a84c 30%, #f5e6b8 50%, #c9a84c 70%, #b8942f 100%);
  --gold-gradient-subtle: linear-gradient(135deg, #c9a84c 0%, #b8942f 100%);
  --gold-glow: 0 0 20px rgba(201, 168, 76, 0.3), 0 0 60px rgba(201, 168, 76, 0.1);

  /* Dark palette */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --border-subtle: rgba(201, 168, 76, 0.12);
  --border-accent: rgba(201, 168, 76, 0.3);

  /* Text */
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;

  /* Fonts */
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --header-height: 72px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Utility --- */
.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gold-border {
  border: 1px solid var(--border-accent);
}

/* --- Background Ambient Glow --- */
.ambient-glow {
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- App Container --- */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 1200px;
}

.header-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-400);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.2);
}

.header-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  padding-bottom: calc(24px + var(--safe-area-bottom));
  gap: 32px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* --- Hero Section (Logo + Status) --- */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0 8px;
}

.hero-logo {
  width: 160px;
  height: 160px;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid var(--border-accent);
  box-shadow: var(--gold-glow);
  animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 500;
}

/* --- Live Status Badge --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.status-badge.live {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.status-badge.offline {
  background: rgba(120, 120, 120, 0.1);
  border: 1px solid rgba(120, 120, 120, 0.3);
  color: #787878;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.live .status-dot {
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* =============================================
   PLAYER SECTION
   ============================================= */
.player-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* --- Play Button --- */
.play-btn-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Outer ring animation */
.play-btn-ring {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.play-btn-ring.active {
  opacity: 1;
  border-color: var(--gold-400);
  animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { 
    transform: scale(1); 
    opacity: 0.4;
    border-color: var(--gold-400);
  }
  50% { 
    transform: scale(1.15); 
    opacity: 0;
    border-color: var(--gold-300);
  }
}

.play-btn-ring-2 {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid transparent;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.play-btn-ring-2.active {
  opacity: 1;
  border-color: var(--gold-500);
  animation: ringPulse 2s ease-in-out infinite;
  animation-delay: 0.6s;
}

.play-btn {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid var(--gold-400);
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.play-btn:hover {
  border-color: var(--gold-300);
  box-shadow: var(--gold-glow), 0 4px 30px rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
}

.play-btn:active {
  transform: scale(0.97);
}

.play-btn.playing {
  border-color: var(--gold-300);
  box-shadow: var(--gold-glow);
  background: linear-gradient(145deg, #1a1508, #0f0d06);
}

.play-btn svg {
  width: 38px;
  height: 38px;
  fill: var(--gold-400);
  transition: all 0.3s ease;
}

.play-btn.playing svg {
  fill: var(--gold-300);
}

/* Play icon offset for visual centering */
.play-btn .icon-play {
  margin-left: 4px;
}

/* --- Loading Spinner (inside play button) --- */
.play-btn .spinner {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 3px solid transparent;
  border-top-color: var(--gold-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- Audio Visualizer --- */
.visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 50px;
  width: 200px;
  padding: 0 10px;
}

.visualizer-bar {
  width: 4px;
  min-height: 4px;
  border-radius: 2px;
  background: var(--gold-gradient-subtle);
  transition: height 0.15s ease;
}

.visualizer.active .visualizer-bar {
  animation: barDance 1.2s ease-in-out infinite;
}

.visualizer.active .visualizer-bar:nth-child(1) { animation-delay: 0s; }
.visualizer.active .visualizer-bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer.active .visualizer-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer.active .visualizer-bar:nth-child(4) { animation-delay: 0.05s; }
.visualizer.active .visualizer-bar:nth-child(5) { animation-delay: 0.15s; }
.visualizer.active .visualizer-bar:nth-child(6) { animation-delay: 0.25s; }
.visualizer.active .visualizer-bar:nth-child(7) { animation-delay: 0.08s; }
.visualizer.active .visualizer-bar:nth-child(8) { animation-delay: 0.18s; }
.visualizer.active .visualizer-bar:nth-child(9) { animation-delay: 0.22s; }
.visualizer.active .visualizer-bar:nth-child(10) { animation-delay: 0.12s; }
.visualizer.active .visualizer-bar:nth-child(11) { animation-delay: 0.03s; }
.visualizer.active .visualizer-bar:nth-child(12) { animation-delay: 0.16s; }
.visualizer.active .visualizer-bar:nth-child(13) { animation-delay: 0.07s; }
.visualizer.active .visualizer-bar:nth-child(14) { animation-delay: 0.2s; }
.visualizer.active .visualizer-bar:nth-child(15) { animation-delay: 0.13s; }
.visualizer.active .visualizer-bar:nth-child(16) { animation-delay: 0.09s; }

@keyframes barDance {
  0%, 100% { height: 6px; opacity: 0.5; }
  25% { height: 28px; opacity: 0.9; }
  50% { height: 14px; opacity: 0.7; }
  75% { height: 40px; opacity: 1; }
}

.visualizer:not(.active) .visualizer-bar {
  height: 4px;
  opacity: 0.2;
}

/* --- Player Status Text --- */
.player-status {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  min-height: 1.2em;
}

.player-status.error {
  color: #ef4444;
}

/* =============================================
   CAROUSEL SECTION
   ============================================= */
.carousel-section {
  width: 100%;
  max-width: 600px;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: 16px;
  padding-left: 4px;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

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

.carousel-slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
}

.carousel-slide-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.carousel-slide-sponsor {
  font-size: 0.75rem;
  color: var(--gold-400);
  margin-top: 4px;
  font-weight: 500;
}

/* Carousel Navigation Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 0;
  background: var(--bg-card);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.carousel-dot.active {
  background: var(--gold-400);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

/* Carousel Arrow Buttons */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-accent);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(8px);
  color: var(--gold-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.carousel-arrow:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: var(--gold-400);
}

.carousel-arrow.prev { left: 10px; }
.carousel-arrow.next { right: 10px; }

.carousel-arrow svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* Empty carousel state */
.carousel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  gap: 8px;
}

.carousel-empty svg {
  width: 32px;
  height: 32px;
  stroke: var(--text-muted);
  fill: none;
  opacity: 0.5;
}

/* =============================================
   INSTALL SECTION
   ============================================= */
.install-section {
  width: 100%;
  max-width: 600px;
}

.install-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
}

.install-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}

.install-header:hover {
  background: var(--bg-elevated);
}

.install-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.05));
  border: 1px solid var(--border-accent);
}

.install-header-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold-400);
  fill: none;
  stroke-width: 2;
}

.install-header-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.install-header-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.install-chevron {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  transition: transform 0.3s ease;
}

.install-card.open .install-chevron {
  transform: rotate(180deg);
}

.install-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.install-card.open .install-body {
  max-height: 600px;
}

.install-steps {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.install-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.install-step-num {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--gold-gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: #0a0a0a;
}

.install-step-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 3px;
}

.install-step-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Divider between install cards */
.install-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0;
}

/* PWA Install Button (Chrome/Android native prompt) */
.pwa-install-btn {
  display: none;
  width: 100%;
  max-width: 600px;
  padding: 14px 24px;
  border: 2px solid var(--gold-400);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(201, 168, 76, 0.12), rgba(201, 168, 76, 0.04));
  color: var(--gold-300);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.pwa-install-btn:hover {
  background: linear-gradient(145deg, rgba(201, 168, 76, 0.2), rgba(201, 168, 76, 0.08));
  box-shadow: var(--gold-glow);
}

.pwa-install-btn.visible {
  display: block;
}

/* =============================================
   FOOTER
   ============================================= */
.app-footer {
  text-align: center;
  padding: 24px 16px;
  padding-bottom: calc(24px + var(--safe-area-bottom));
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.footer-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-gold {
  color: var(--gold-500);
  font-weight: 600;
}

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */
.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

.hero-section.fade-in-up { animation-delay: 0.1s; }
.player-section.fade-in-up { animation-delay: 0.2s; }
.carousel-section.fade-in-up { animation-delay: 0.3s; }
.install-section.fade-in-up { animation-delay: 0.4s; }

/* =============================================
   DESKTOP LAYOUT (1024px+)
   ============================================= */
@media (min-width: 1024px) {
  .main-content {
    padding: 40px 32px;
    gap: 48px;
  }

  .hero-section {
    padding: 32px 0 16px;
  }

  .hero-logo {
    width: 200px;
    height: 200px;
    border-radius: 28px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .player-section {
    gap: 28px;
  }

  .play-btn {
    width: 130px;
    height: 130px;
  }

  .play-btn svg {
    width: 44px;
    height: 44px;
  }

  .play-btn-ring, .play-btn-ring-2 {
    width: 170px;
    height: 170px;
  }

  .visualizer {
    width: 280px;
    height: 60px;
    gap: 4px;
  }

  .visualizer-bar {
    width: 5px;
  }

  .desktop-layout {
    display: flex;
    gap: 40px;
    width: 100%;
    align-items: flex-start;
  }

  .desktop-player-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .desktop-carousel-col {
    flex: 1;
    max-width: 560px;
  }

  .carousel-section {
    max-width: none;
  }

  .install-section {
    max-width: 800px;
  }

  .install-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .install-cards-grid .install-card {
    height: fit-content;
  }

  .install-divider {
    display: none;
  }

  .carousel-slide {
    aspect-ratio: 16/10;
  }
}

/* =============================================
   TABLET LAYOUT (768px–1023px)
   ============================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  .main-content {
    padding: 32px 24px;
    gap: 40px;
  }

  .hero-logo {
    width: 180px;
    height: 180px;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .carousel-section,
  .install-section {
    max-width: 560px;
  }
}

/* =============================================
   SMALL MOBILE (< 380px)
   ============================================= */
@media (max-width: 380px) {
  .play-btn {
    width: 90px;
    height: 90px;
  }

  .play-btn svg {
    width: 30px;
    height: 30px;
  }

  .play-btn-ring, .play-btn-ring-2 {
    width: 120px;
    height: 120px;
  }

  .hero-logo {
    width: 130px;
    height: 130px;
  }

  .hero-name {
    font-size: 1.25rem;
  }

  .visualizer {
    width: 160px;
  }
}

/* =============================================
   VOLUME SLIDER
   ============================================= */
.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 180px;
}

.volume-control svg {
  width: 18px;
  height: 18px;
  stroke: var(--gold-500);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  cursor: pointer;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-elevated);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-400);
  border: 2px solid var(--bg-primary);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-400);
  border: 2px solid var(--bg-primary);
  cursor: pointer;
}
