/* RadioPlay Custom Stylesheet - High-End Dark UI */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Dynamic values overridden by backend theme settings */
  --primary-color: #00f0ff;
  --secondary-color: #7000ff;
  --primary-glow: rgba(0, 240, 255, 0.35);
  --secondary-glow: rgba(112, 0, 255, 0.35);
  
  /* Core Color Tokens */
  --bg-dark: #070913;
  --bg-card: rgba(18, 22, 41, 0.65);
  --border-card: rgba(255, 255, 255, 0.08);
  --text-main: #f1f3f9;
  --text-muted: #8a96ab;
  --glass-blur: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100vh;
}

/* Layout container */
#app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
}

/* Sidebar Styling */
#sidebar {
  background: rgba(10, 12, 26, 0.95);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

.station-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s ease;
  cursor: pointer;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 3px 0 0 var(--primary-color);
}

/* Main Content Area */
#main-view {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 40px;
  padding-bottom: 120px; /* offset for bottom player */
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

.section-header {
  margin-bottom: 30px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Folder System (Categories) */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.folder-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.folder-card:hover, .folder-card.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-glow);
}

.folder-icon {
  font-size: 40px;
  margin-bottom: 8px;
  display: block;
  color: var(--primary-color);
}

.folder-name {
  font-weight: 600;
  font-size: 14px;
}

.folder-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* Music Library Table */
.table-container {
  overflow-x: auto;
}

.library-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.library-table th {
  padding: 14px 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}

.library-table th:hover {
  color: var(--text-main);
}

.library-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
  vertical-align: middle;
}

.library-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Studio Desk Widgets */
.studio-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.deck-container {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.deck-player {
  flex: 1;
  text-align: center;
}

.time-display {
  font-family: monospace;
  font-size: 48px;
  font-weight: bold;
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--primary-glow);
  margin: 16px 0;
}

/* Sound Carts Soundboard */
.carts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cart-button {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-main);
  border-radius: 8px;
  padding: 16px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cart-button:hover {
  background: var(--primary-color);
  color: #000;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Slide-out Edit Drawer */
#edit-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: #0d101f;
  border-left: 1px solid var(--border-card);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 30px;
  overflow-y: auto;
}

#edit-drawer.open {
  right: 0;
}

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

.drawer-close {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 14px;
}

.form-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 8px var(--primary-glow);
}

/* Bottom Broadcast Player */
#bottom-player {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(10, 12, 26, 0.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 999;
  gap: 20px;
}

/* Live/Offline status dot in footer player */
.bp-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.4s, box-shadow 0.4s;
}
.bp-dot--live {
  background: #00ff66;
  box-shadow: 0 0 8px #00ff66;
  animation: bpLivePulse 1.8s ease-in-out infinite;
}
.bp-dot--offline {
  background: rgba(255,255,255,0.2);
  box-shadow: none;
}
@keyframes bpLivePulse {
  0%,100% { box-shadow: 0 0 4px #00ff66; }
  50%      { box-shadow: 0 0 14px #00ff66; }
}

.track-info-brief {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brief-art {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
}

.brief-meta {
  display: flex;
  flex-direction: column;
}

.brief-title {
  font-size: 14px;
  font-weight: 600;
}

.brief-artist {
  font-size: 12px;
  color: var(--text-muted);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}

.control-btn:hover {
  color: var(--primary-color);
}

.library-table tr.selected-row {
  background: var(--primary-glow) !important;
  box-shadow: inset 4px 0 0 var(--primary-color);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: rgba(13, 16, 31, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.toast.success { border-color: rgba(85, 255, 0, 0.4); box-shadow: 0 0 15px rgba(85, 255, 0, 0.15); }
.toast.error { border-color: rgba(255, 60, 60, 0.4); box-shadow: 0 0 15px rgba(255, 60, 60, 0.15); }
.toast.warning { border-color: rgba(255, 170, 0, 0.4); box-shadow: 0 0 15px rgba(255, 170, 0, 0.15); }
.toast.info { border-color: rgba(0, 240, 255, 0.4); box-shadow: 0 0 15px rgba(0, 240, 255, 0.15); }

@keyframes toast-slide-in {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
  transform: translateX(120%);
  opacity: 0;
}

/* ═══════════════════════════════════════════════════════════════
   LIVE MONITOR — Studio Desk Radio Player with Visualizer
   ═══════════════════════════════════════════════════════════════ */
.live-monitor-card {
  margin-top: 28px;
}

.live-monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(255, 60, 60, 0.12);
  border: 1px solid rgba(255, 60, 60, 0.35);
  color: #ff5c5c;
  padding: 3px 9px;
  border-radius: 20px;
  animation: livePilseBorder 2s ease-in-out infinite;
}
@keyframes livePilseBorder {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,60,60,0); }
  50%      { box-shadow: 0 0 0 3px rgba(255,60,60,0.15); }
}

.monitor-ext-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  background: rgba(255,255,255,0.03);
  transition: all 0.2s;
  white-space: nowrap;
}
.monitor-ext-link:hover { color: var(--primary-color); border-color: var(--primary-color); background: rgba(0,240,255,0.05); }
.monitor-ext-admin:hover { color: #ffaa00; border-color: #ffaa00; background: rgba(255,170,0,0.05); }

/* Track info row */
.live-monitor-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.monitor-track-info {
  display: flex;
  gap: 18px;
  align-items: center;
}

.monitor-cover-wrap {
  position: relative;
  flex-shrink: 0;
}

.monitor-cover {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-card);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.4s ease;
}
.monitor-cover.spinning {
  animation: monitorSpin 8s linear infinite;
}
@keyframes monitorSpin {
  from { transform: rotate(0deg); } to { transform: rotate(360deg); }
}

.monitor-eq {
  position: absolute;
  bottom: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-glow);
  display: none;
}
.monitor-eq.active { display: block; animation: eqBlink 1s ease-in-out infinite; }
@keyframes eqBlink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

.monitor-meta { flex: 1; min-width: 0; }
.monitor-track-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--primary-color); margin-bottom: 4px; }
.monitor-title { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monitor-artist { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monitor-upnext { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Visualizer */
.monitor-vis-wrap {
  position: relative;
  height: 64px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  overflow: hidden;
}
#monitor-vis-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.monitor-vis-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-muted);
  pointer-events: none;
}

/* Controls bar */
.monitor-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.monitor-play-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #000;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px var(--primary-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}
.monitor-play-btn:hover { transform: scale(1.08); box-shadow: 0 0 30px var(--primary-glow); }
.monitor-play-btn:active { transform: scale(0.95); }

.monitor-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.monitor-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-color), #a78fff);
  border-radius: 2px;
  transition: width 1s linear;
  box-shadow: 0 0 6px var(--primary-glow);
}

.monitor-vol-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  cursor: pointer; outline: none;
}
.monitor-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 6px var(--primary-glow);
  cursor: pointer;
}

.monitor-url-input {
  width: 220px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  cursor: text;
  outline: none;
}

.monitor-copy-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  background: rgba(255,255,255,0.04);
  color: var(--primary-color);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.monitor-copy-btn:hover { background: rgba(0,240,255,0.08); }

