/* ==========================================
   EVAFM Radio PWA - Android App Style
   ========================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* CSS Custom Properties */
:root {
  /* Colors - EVAFM Brand */
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  --color-background: #ffffff;
  --color-surface: #f5f5f5;
  --color-border: #e0e0e0;

  /* Text Colors */
  --color-text-primary: #212121;
  --color-text-secondary: #757575;
  --color-text-light: #9e9e9e;

  /* Gradients */
  --gradient-player: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);

  /* Typography */
  --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;

  /* Transitions */
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
body.dark-mode {
  /* Colors - Dark Theme */
  --color-primary: #ef4444;
  --color-primary-dark: #dc2626;
  --color-background: #121212;
  --color-surface: #1e1e1e;
  --color-border: #2d2d2d;

  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: #b0b0b0;
  --color-text-light: #808080;

  /* Shadows - Darker for dark mode */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Dark Mode - Header */
body.dark-mode .header {
  background: #1e1e1e;
  border-bottom: 1px solid #2d2d2d;
}

body.dark-mode .hamburger span {
  background: #ffffff;
}

/* Dark Mode - Tabs */
body.dark-mode .tabs {
  background: #1e1e1e;
}

body.dark-mode .tab {
  background: #2d2d2d;
  color: #b0b0b0;
}

body.dark-mode .tab.active {
  background: var(--color-primary);
  color: white;
}

/* Dark Mode - Footer */
body.dark-mode .footer {
  background: #1e1e1e;
  border-top: 1px solid #2d2d2d;
}

body.dark-mode .footer-next {
  background: #2d2d2d;
}

/* Dark Mode - Player */
body.dark-mode .play-btn,
body.dark-mode .volume-btn {
  background: #2d2d2d;
}

/* Dark Mode - Schedule */
body.dark-mode .day-header {
  background: #1e1e1e;
}

body.dark-mode .day-header:hover {
  background: #2d2d2d;
}

body.dark-mode .program-item {
  background: #1e1e1e;
  border-bottom-color: #2d2d2d;
}

/* Dark Mode - Ad Slider */
body.dark-mode .ad-nav {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .ad-nav:hover {
  background: rgba(220, 38, 38, 0.8);
}

/* ==========================================
   Reset & Base
   ========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-background);
  color: var(--color-text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==========================================
   Header
   ========================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================
   Splash Screen
   ========================================== */

.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeOut 0.5s ease-out 2.5s forwards;
}

.splash-screen.hidden {
  display: none;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.splash-content {
  text-align: center;
  padding: var(--spacing-lg);
  max-width: 500px;
  width: 100%;
}

.splash-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  margin-bottom: var(--spacing-md);
  animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.splash-loader {
  width: 100%;
  max-width: 300px;
  height: 4px;
  background: rgba(220, 38, 38, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}

.loader-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

.app {
  opacity: 0;
  animation: fadeInApp 0.5s ease-out 2.5s forwards;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@keyframes fadeInApp {
  to {
    opacity: 1;
  }
}

/* ==========================================
   Sidebar Menu
   ========================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: var(--color-primary);
  z-index: 1000;
  transition: left var(--transition);
  box-shadow: var(--shadow-lg);
}

.sidebar.active {
  left: 0;
}

.sidebar-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--spacing-lg);
  color: white;
}

.sidebar-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-md);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  color: white;
  text-decoration: none;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-icon {
  font-size: 1.5rem;
  color: white;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-title {
  font-size: 0.875rem;
  margin-bottom: var(--spacing-sm);
}

.share-icons {
  display: flex;
  gap: var(--spacing-md);
}

.share-icon {
  font-size: 1.75rem;
  color: white;
  text-decoration: none;
  transition: transform var(--transition);
}

.share-icon:hover {
  transform: scale(1.1);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================
   Header
   ========================================== */

.header {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-right: var(--spacing-md);
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.hamburger span:nth-child(3) {
  width: 18px;
}

.cast-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all var(--transition);
  opacity: 1 !important;
}

.cast-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.cast-btn:active {
  transform: scale(0.95);
}

.header-logo {
  height: 32px;
  width: auto;
}

/* ==========================================
   Tabs
   ========================================== */

.tabs {
  display: flex;
  background: white;
  box-shadow: var(--shadow-sm);
}

.tab {
  flex: 1;
  padding: var(--spacing-md);
  background: #e0e0e0;
  border: none;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
}

.tab.active {
  background: var(--color-primary);
  color: white;
  border-bottom-color: var(--color-primary-dark);
}

/* ==========================================
   Tab Content
   ========================================== */

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
}

.tab-content.active {
  display: block;
}

/* ==========================================
   Circular Player
   ========================================== */

.player-container {
  padding: var(--spacing-lg);
  text-align: center;
}

.circular-player {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.player-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  cursor: pointer;
}

.ring-bg {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 4;
}

.ring-progress {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 565;
  stroke-dashoffset: 565;
  transform-origin: center;
  transition: stroke-dashoffset 0.3s ease;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition);
  z-index: 5;
}

.play-btn:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.play-icon {
  font-size: 2rem;
  color: var(--color-primary);
}

/* Volume Tooltip */
.volume-tooltip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(220, 38, 38, 0.95);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 1.25rem;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.volume-tooltip.show {
  opacity: 1;
}

/* Volume Handle */
#volume-handle {
  cursor: grab;
  transition: transform 0.1s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

#volume-handle:hover {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

#volume-handle:active {
  cursor: grabbing;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.current-program {
  text-align: center;
}

.program-name {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
}

.program-time {
  font-size: 1rem;
  color: var(--color-text-secondary);
}

/* ==========================================
   Advertisement Slider
   ========================================== */

.ad-slider {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: var(--spacing-lg) auto 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.ad-track {
  display: flex;
  transition: transform 0.5s ease;
}

.ad-item {
  min-width: 100%;
  flex-shrink: 0;
}

.ad-link {
  display: block;
  position: relative;
  padding-top: 56.25%;
  /* 16:9 Aspect Ratio */
  overflow: hidden;
}

.ad-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.ad-link:hover .ad-image {
  transform: scale(1.05);
}

.ad-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.ad-nav:hover {
  background: rgba(220, 38, 38, 0.8);
}

.ad-prev {
  left: 10px;
}

.ad-next {
  right: 10px;
}

.ad-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.ad-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all var(--transition);
}

.ad-dot.active {
  background: var(--color-primary);
  width: 24px;
  border-radius: 5px;
}

.ad-slider.hidden {
  display: none;
}

/* ==========================================
   Schedule Accordion
   ========================================== */

.schedule-container {
  padding: 0;
}

.day-item {
  border-bottom: 1px solid var(--color-border);
}

.day-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: white;
  border: none;
  font-family: var(--font-primary);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-primary);
  cursor: pointer;
  transition: background var(--transition);
}

.day-header:hover {
  background: var(--color-surface);
}

.day-toggle {
  font-size: 1.5rem;
  color: var(--color-primary);
  transition: transform var(--transition);
}

.day-item.active .day-toggle {
  transform: rotate(45deg);
}

.day-programs {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
}

.day-item.active .day-programs {
  max-height: 1000px;
}

.program-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  background: white;
}

.program-info {
  flex: 1;
}

.program-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.program-schedule {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.reminder-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
}

.reminder-toggle input {
  display: none;
}

.toggle-slider {
  width: 48px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: left var(--transition);
}

.reminder-toggle input:checked+.toggle-slider {
  background: var(--color-primary);
}

.reminder-toggle input:checked+.toggle-slider::before {
  left: 26px;
}

.toggle-label {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* ==========================================
   Footer
   ========================================== */

.footer {
  margin-top: 2rem;
  padding: var(--spacing-md) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-social {
  margin-bottom: var(--spacing-md);
}

.ad-link {
  max-height: 250px;
  overflow: hidden;
}

.social-title {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
}

.social-icons a {
  font-size: 2rem;
  color: var(--color-primary);
  text-decoration: none;
  transition: transform var(--transition);
}

.social-icons a:hover {
  transform: scale(1.1);
}

/* WhatsApp icon larger */
.social-icons a .fa-whatsapp {
  font-size: 2.5rem;
}

.footer-next {
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-xs);
  background: var(--color-surface);
  border-radius: 4px;
}

.next-label {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.next-program {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.footer-credits {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: var(--spacing-xs);
  padding-top: var(--spacing-xs);
}

.footer-credits a {
  color: var(--color-text-light);
  text-decoration: none;
}

.footer-credits sup {
  font-size: 0.6rem;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 480px) {
  .circular-player {
    width: 200px;
    height: 200px;
  }

  .play-btn {
    width: 60px;
    height: 60px;
  }

  .play-icon {
    font-size: 1.5rem;
  }

  /* Reduce footer spacing on mobile */
  .footer {
    margin-top: 0.5rem;
    padding: var(--spacing-xs) 0;
  }

  .footer-social {
    margin-bottom: var(--spacing-sm);
  }

  .footer-next {
    margin-bottom: var(--spacing-sm);
  }

  .ad-link {
    max-height: 180px;
  }
}

/* ==========================================
   Utility
   ========================================== */

.hidden {
  display: none !important;
}