@import url('https://fonts.googleapis.com/css2?family=Kavivanar&family=Mukta+Malar:wght@400;600;700&family=Noto+Serif+Tamil:wght@400;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #070a14;
  --bg-secondary: #0c1222;
  --bg-card: rgba(22, 30, 49, 0.65);
  --bg-card-hover: rgba(30, 41, 67, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.35);

  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-dark: #d97706;
  --accent-glow: 0 0 25px rgba(245, 158, 11, 0.45);

  --accent-coral: #ef4444;
  --accent-green: #10b981;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --font-sans: 'Outfit', 'Mukta Malar', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-tamil: 'Mukta Malar', 'Noto Serif Tamil', sans-serif;
  --font-brand: 'Kavivanar', cursive, sans-serif;
  --font-lyrics: 'Noto Serif Tamil', serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-height: 68px;
  --miniplayer-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Animated Glow Background */
.ambient-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at 50% 15%, #18223c 0%, #0a0e1c 50%, #05070e 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.22;
  will-change: transform;
}

.orb-gold {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #f59e0b, #d97706);
  top: -60px;
  right: -50px;
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.orb-indigo {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #6366f1, #312e81);
  bottom: 80px;
  left: -80px;
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, 60px) scale(1.15); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, -40px) scale(1.1); }
}

/* App Shell Container */
#app {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 540px;
  margin: 0 auto;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Top App Header */
.app-header {
  padding-top: calc(var(--safe-top) + 10px);
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 10, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
  object-fit: cover;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-gold-light);
  line-height: 1.15;
  letter-spacing: 0.3px;
  text-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  letter-spacing: 0.8px;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-coral);
  box-shadow: 0 0 8px var(--accent-coral);
  animation: pulseDot 1.6s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.icon-btn-header {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  position: relative;
}

.icon-btn-header:active {
  transform: scale(0.92);
}

.timer-active-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 6px var(--accent-gold);
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* Main Content Area (Tab Screens) */
.main-view-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px calc(var(--tabbar-height) + var(--safe-bottom) + 16px);
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.tab-pane.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ========================================================
   TAB 1: PLAYER SCREEN (வானொலி)
   ======================================================== */
.player-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100%;
  gap: 12px;
}

/* Album Art / Disc Component */
.disc-wrapper {
  position: relative;
  width: min(68vw, 240px);
  height: min(68vw, 240px);
  margin: 6px auto 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.disc-glow-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.28) 0%, rgba(245, 158, 11, 0) 70%);
  animation: glowBreath 4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes glowBreath {
  0% { transform: scale(0.96); opacity: 0.5; }
  100% { transform: scale(1.06); opacity: 0.95; }
}

.disc-art {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 4px rgba(245, 158, 11, 0.25);
  position: relative;
}

.disc-art.playing {
  animation: spinDisc 28s linear infinite;
}

.disc-art.paused {
  animation-play-state: paused;
}

@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.disc-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.disc-center-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #070a14;
  border: 4px solid #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  z-index: 2;
}

/* Now Playing Metadata Card */
.track-info-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 14px 18px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.track-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-gold);
  letter-spacing: 1.2px;
  margin-bottom: 4px;
}

.track-title {
  font-family: var(--font-tamil);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-family: var(--font-tamil);
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Visualizer Canvas */
.visualizer-box {
  width: 100%;
  height: 44px;
  margin: 6px 0 2px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

#mobile-visualizer {
  width: 100%;
  height: 100%;
  display: block;
}

/* Progress & Time */
.scrubber-container {
  width: 100%;
  margin: 4px 0;
}

.scrubber-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.scrubber-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-gold-dark), var(--accent-gold-light));
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  transition: width 0.4s linear;
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 0.75rem;
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-weight: 500;
}

/* Playback Controls */
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 6px 0;
  width: 100%;
}

.ctrl-btn-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  font-size: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(245, 158, 11, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  transition: all 0.2s;
}

.ctrl-btn-play:active {
  transform: scale(0.94);
  box-shadow: 0 3px 15px rgba(245, 158, 11, 0.4);
}

.volume-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
}

.vol-icon {
  font-size: 0.95rem;
  color: var(--accent-gold-light);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-gold-light);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* ========================================================
   TWO-LINE FULL LYRICS CARD (NO ELLIPSIS TRUNCATION)
   ======================================================== */
.quick-lyrics-card {
  width: 100%;
  background: rgba(18, 24, 40, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.quick-lyrics-card:active {
  background: rgba(28, 38, 62, 0.85);
  transform: scale(0.98);
}

.quick-lyrics-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.quick-lyrics-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.quick-lyrics-icon-badge .q-icon {
  font-size: 1.15rem;
}

.quick-lyrics-content {
  flex: 1;
  min-width: 0;
}

.quick-lyrics-label {
  font-size: 0.72rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

/* Two-line text container - strictly NO ellipsis */
.quick-lyrics-two-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.lyrics-line-current {
  font-family: var(--font-lyrics);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent-gold-light);
  line-height: 1.38;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible !important;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

.lyrics-line-next {
  font-family: var(--font-lyrics);
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.38;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible !important;
}

.quick-lyrics-chevron {
  color: var(--accent-gold);
  font-size: 1.3rem;
  font-weight: 700;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Stats Pill Bar */
.stats-pills-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.stat-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 8px 10px;
  text-align: center;
}

.stat-pill-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-pill-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* ========================================================
   TAB 2: DEDICATED FULL-SCREEN LYRICS (பாடல் வரிகள்)
   ======================================================== */
.lyrics-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.lyrics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.lyrics-title-group h2 {
  font-family: var(--font-tamil);
  font-size: 1.15rem;
  color: var(--accent-gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lyrics-title-group p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lyrics-tools-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 10px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.tool-chip:active {
  transform: scale(0.92);
}

.tool-chip.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
}

/* Full Lyrics Viewport with Mask */
.lyrics-scroll-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
  padding: 28vh 12px 35vh;
  -webkit-overflow-scrolling: touch;
}

.lyrics-container-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Lyric Verse Line Styling */
.m-lyric-line {
  font-family: var(--font-lyrics);
  font-size: 1.15rem;
  line-height: 2.3;
  color: rgba(255, 255, 255, 0.45);
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.35s ease;
  transform: scale(0.94);
  max-width: 96%;
  position: relative;
  white-space: normal !important;
  word-break: break-word !important;
}

.m-lyric-line.active {
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
  opacity: 1;
  transform: scale(1.05);
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.16), transparent);
  text-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
  color: var(--accent-gold-light);
}

.lyric-time-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--accent-gold-light);
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 1px 6px;
  border-radius: 8px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Floating Resume Auto-Scroll Button */
.btn-jump-live {
  position: fixed;
  bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: #070a14;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: 25px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
}

.btn-jump-live.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ========================================================
   TAB 3: HISTORY SCREEN (வரலாறு)
   ======================================================== */
.history-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-header-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-header-card h2 {
  font-family: var(--font-tamil);
  font-size: 1.15rem;
  color: var(--accent-gold-light);
}

.history-count-badge {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-gold-light);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-item:active {
  background: var(--bg-card-hover);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.history-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.history-item-details {
  overflow: hidden;
}

.history-item-title {
  font-family: var(--font-tamil);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-item-time {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-weight: 500;
  flex-shrink: 0;
}

/* ========================================================
   TAB 4: SETTINGS SCREEN (அமைப்புகள்)
   ======================================================== */
.settings-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-group {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
}

.settings-group-title {
  font-family: var(--font-tamil);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-gold-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-row-info h4 {
  font-size: 0.92rem;
  font-weight: 600;
}

.setting-row-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Modern Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--border-subtle);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 30px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background-color: #070a14;
}

.timer-chips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.timer-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.timer-chip:active {
  transform: scale(0.94);
}

.timer-chip.active {
  background: var(--accent-gold);
  color: #070a14;
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.input-text {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  margin-top: 8px;
}

.input-text:focus {
  border-color: var(--accent-gold);
}

.btn-action-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  border: none;
  border-radius: 12px;
  color: #070a14;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: all 0.2s;
}

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

/* Mini Player Bar */
.mini-player-bar {
  position: absolute;
  bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 8px);
  left: 12px;
  right: 12px;
  height: var(--miniplayer-height);
  background: rgba(18, 24, 38, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 16px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 20;
  cursor: pointer;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.mini-player-bar.show {
  transform: translateY(0);
  opacity: 1;
}

.mini-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.mini-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.mini-info {
  overflow: hidden;
}

.mini-title {
  font-family: var(--font-tamil);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-size: 0.75rem;
  color: var(--accent-gold-light);
}

.mini-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: none;
  color: #070a14;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(9, 13, 25, 0.9);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 25;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-faint);
  background: transparent;
  border: none;
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: all 0.2s ease;
  position: relative;
}

.nav-icon {
  font-size: 1.35rem;
  transition: transform 0.2s ease;
}

.nav-label {
  font-family: var(--font-tamil);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.nav-item.active {
  color: var(--accent-gold-light);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.nav-item:active {
  transform: scale(0.92);
}

/* Modal Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 500px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-gold);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(var(--safe-bottom) + 20px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.show .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 44px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header h3 {
  font-family: var(--font-tamil);
  color: var(--accent-gold-light);
  font-size: 1.15rem;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

/* Toast */
.toast-msg {
  position: fixed;
  top: calc(var(--safe-top) + 65px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(18, 25, 41, 0.95);
  border: 1px solid var(--accent-gold);
  color: #fff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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