/* ============================================================
   TamilRadios.co.in — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg:           #0b0b12;
  --bg-card:      #13131f;
  --bg-elevated:  #1a1a2a;
  --bg-header:    #0d0d18;
  --bg-player:    #0d0d18;
  --accent:       #f0a500;
  --accent-dim:   rgba(240,165,0,0.15);
  --accent2:      #e85d04;
  --text:         #f0f0f8;
  --text-sec:     #7878a0;
  --text-muted:   #4a4a6a;
  --border:       rgba(255,255,255,0.07);
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --transition:   0.2s ease;
  --player-h:     80px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--player-h) + 20px);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   HEADER
   ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-content {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  height: 60px;
  max-width: 1400px;
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}
.logo-fallback {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #000;
  flex-shrink: 0;
}
.site-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
nav { margin-left: auto; }
nav ul { display: flex; gap: 4px; align-items: center; }
nav ul li a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-sec);
  transition: color var(--transition), background var(--transition);
}
nav ul li a:hover,
nav ul li a.active { color: var(--text); background: var(--bg-elevated); }
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  height: 36px;
  min-width: 200px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar i { color: var(--text-muted); font-size: 0.82rem; }
.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-menu {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 90;
}
.filter-wrapper {
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}
.filter-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.filter-container::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-sec);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { color: #000; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.filter-arrow {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-sec);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 1;
}
.filter-arrow:hover { background: var(--accent); color: #000; }
.filter-left { margin-right: 8px; }
.filter-right { margin-left: 8px; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

/* ---------- Section Headers ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}
.view-all {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--accent-dim);
  transition: all var(--transition);
}
.view-all:hover { background: var(--accent); color: #000; }

/* ---------- Genre Section ---------- */
.genre-section { margin-bottom: 36px; }

/* ---------- Stations Grid ---------- */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

/* ---------- Station Card ---------- */
.station-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  user-select: none;
}
.station-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(240,165,0,0.15);
}
.station-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.station-card.playing .station-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(240,165,0,0.15);
}

/* Station Art */
.station-art {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  position: relative;
  overflow: hidden;
}
.station-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.station-art .station-initials {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  text-align: center;
  padding: 8px;
  z-index: 1;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Card body */
.station-info {
  padding: 10px 12px 12px;
}
.station-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.station-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Favorite button */
.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all var(--transition);
  z-index: 2;
}
.favorite-btn:hover { color: #ff4d6d; background: rgba(0,0,0,0.7); }
.favorite-btn.active { color: #ff4d6d; }

/* Playing indicator */
.playing-indicator {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  align-items: flex-end;
  z-index: 2;
}
.playing-indicator span {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: soundbar 0.8s ease-in-out infinite alternate;
}
.playing-indicator span:nth-child(1) { height: 8px; animation-delay: 0s; }
.playing-indicator span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.playing-indicator span:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.playing-indicator span:nth-child(4) { height: 16px; animation-delay: 0.45s; }
@keyframes soundbar {
  from { transform: scaleY(0.3); }
  to { transform: scaleY(1); }
}

/* View-more card */
.view-more-card {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
}
.view-more-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-sec);
  font-size: 0.8rem;
}
.view-more-content i { font-size: 1.6rem; color: var(--accent); }

/* Empty state */
.empty-state {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.empty-state i { font-size: 2rem; }

/* ============================================================
   RECENTLY PLAYED / FAVORITES
   ============================================================ */
#recently-played-section,
#favorites-section { margin-bottom: 36px; }

/* ============================================================
   AUDIO PLAYER (bottom bar)
   ============================================================ */
.player-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-h);
  background: var(--bg-player);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  z-index: 200;
}
.player-content {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Now playing */
.now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  flex: 0 0 auto;
}
.now-playing-art {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.now-playing-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.now-playing-info { overflow: hidden; }
.now-playing-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-playing-sub {
  font-size: 0.75rem;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Player controls */
.player-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.control-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sec);
  font-size: 0.82rem;
  transition: all var(--transition);
}
.ctrl-btn:hover { color: var(--text); }
.ctrl-btn.active { color: var(--accent); }
.play-btn {
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: #000;
  font-size: 1rem;
  border-radius: 50%;
}
.play-btn:hover { background: #ffc020; transform: scale(1.05); }

/* Progress */
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 500px;
}
.time-label { font-size: 0.72rem; color: var(--text-muted); min-width: 32px; text-align: center; }
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s linear;
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}
.progress-bar:hover .progress-fill::after { opacity: 1; }

/* Volume */
.volume-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 140px;
}
.volume-controls i { color: var(--text-sec); font-size: 0.85rem; cursor: pointer; }
.volume-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  cursor: pointer;
}
.volume-fill {
  height: 100%;
  background: var(--text-sec);
  border-radius: 2px;
  width: 70%;
  transition: background var(--transition);
}
.volume-bar:hover .volume-fill { background: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 24px;
}
.footer-about {
  margin-bottom: 36px;
  max-width: 780px;
}
.footer-about p {
  font-size: 0.88rem;
  color: var(--text-sec);
  line-height: 1.7;
}
.footer-about strong { color: var(--accent); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 36px;
}
.footer-col h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.footer-links li { margin-bottom: 8px; }
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-sec);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.social-row { display: flex; gap: 10px; margin-bottom: 16px; }
.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sec);
  font-size: 0.85rem;
  transition: all var(--transition);
}
.social-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.newsletter-form {
  display: flex;
  gap: 8px;
}
.newsletter-form input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.83rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form button {
  padding: 8px 14px;
  background: var(--accent);
  color: #000;
  font-size: 0.83rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background var(--transition);
}
.newsletter-form button:hover { background: #ffc020; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.copyright { font-size: 0.8rem; color: var(--text-muted); }
.legal-links { display: flex; gap: 16px; }
.legal-links a { font-size: 0.8rem; color: var(--text-muted); transition: color var(--transition); }
.legal-links a:hover { color: var(--accent); }

/* ============================================================
   INNER PAGES (about, contact, etc.)
   ============================================================ */
.page-content {
  max-width: 860px;
  margin: 40px auto;
  padding: 0 24px;
}
.page-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
}
.page-card h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.page-card .page-subtitle {
  font-size: 0.9rem;
  color: var(--text-sec);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-card h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
}
.page-card p {
  font-size: 0.9rem;
  color: var(--text-sec);
  line-height: 1.75;
  margin-bottom: 12px;
}
.page-card ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 12px;
}
.page-card ul li {
  font-size: 0.9rem;
  color: var(--text-sec);
  line-height: 1.7;
  margin-bottom: 6px;
}
.page-card .highlight { color: var(--accent); font-weight: 600; }
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 8px;
  transition: all var(--transition);
}
.contact-email:hover { background: var(--accent); color: #000; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .header-content { padding: 0 16px; gap: 12px; }
  .search-bar { min-width: 0; flex: 1; }
  nav ul li a { padding: 6px 10px; font-size: 0.82rem; }
  .site-title { font-size: 1rem; }
  .main-content { padding: 16px 16px 0; }
  .filter-wrapper { padding: 0 16px; }
  .stations-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .player-content { padding: 0 12px; gap: 10px; }
  .now-playing { min-width: 0; flex: 1; }
  .volume-controls { display: none; }
  .progress-row { max-width: none; }
  .footer-inner { padding: 28px 16px 16px; }
  .page-card { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .stations-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
