/* ═══════════════════════════════════════════════════════
   PodVault — Design System
   Tema escuro estilo rádio/broadcasting profissional
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Sora:wght@300;400;500;600;700&display=swap');

/* ─── Variáveis ─────────────────────────────────────── */
:root {
  --bg-base:      #0a0a0f;
  --bg-surface:   #111118;
  --bg-card:      #18181f;
  --bg-elevated:  #1e1e28;
  --bg-hover:     #252530;

  --accent:       #e8ff47;
  --accent-dim:   #b8cc2a;
  --accent-glow:  rgba(232, 255, 71, 0.15);

  --red:          #ff4757;
  --green:        #2ed573;
  --blue:         #1e90ff;

  --text-primary:   #f0f0f5;
  --text-secondary: #9090a8;
  --text-muted:     #555568;

  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(232, 255, 71, 0.3);

  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  32px;

  --shadow-card:  0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:  0 0 40px rgba(232, 255, 71, 0.12);

  --player-h:     88px;
  --font-display: 'Space Mono', monospace;
  --font-body:    'Sora', sans-serif;
  --transition:   0.2s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: calc(var(--player-h) + 24px);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dim); }

img { max-width: 100%; }

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

/* ─── Navbar ─────────────────────────────────────────── */
.navbar {
  background: rgba(10,10,15,0.95) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent) !important;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}

.nav-link {
  color: var(--text-secondary) !important;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 6px 16px !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary) !important;
  background: var(--bg-elevated);
}

.nav-link.active { color: var(--accent) !important; }

/* ─── Layout ─────────────────────────────────────────── */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ─── Page Header ────────────────────────────────────── */
.page-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-secondary);
  margin: 4px 0 0;
  font-size: 0.875rem;
}

/* ─── Cards ──────────────────────────────────────────── */
.card-pod {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card-pod::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card-pod:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.card-pod:hover::before { opacity: 1; }

/* ─── Episode Cards ──────────────────────────────────── */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.episode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.episode-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.episode-card.playing {
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-glow);
}

.episode-card.playing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-glow);
  pointer-events: none;
}

.ep-number {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ep-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.4;
}

.ep-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.ep-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ─── Botões ─────────────────────────────────────────── */
.btn-pod {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.btn-play {
  background: var(--accent);
  color: #000;
}

.btn-play:hover {
  background: var(--accent-dim);
  transform: scale(1.03);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(255,71,87,0.3);
}

.btn-danger:hover {
  background: rgba(255,71,87,0.1);
}

/* ─── Forms ──────────────────────────────────────────── */
.form-pod label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-pod input,
.form-pod textarea,
.form-pod select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 12px 16px;
  transition: all var(--transition);
  outline: none;
}

.form-pod input:focus,
.form-pod textarea:focus,
.form-pod select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-card);
}

.form-pod textarea { resize: vertical; min-height: 100px; }

.form-group { margin-bottom: 20px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-elevated);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-zone input[type="file"] { display: none; }

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
  opacity: 0.6;
}

/* ─── Playlists ──────────────────────────────────────── */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.playlist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

.playlist-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.pl-icon {
  width: 52px; height: 52px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.pl-name {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 4px;
}

.pl-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* ─── Player ─────────────────────────────────────────── */
#global-player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--player-h);
  background: rgba(14, 14, 20, 0.97);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  z-index: 9999;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(.4,0,.2,1);
}

#global-player.visible {
  transform: translateY(0);
}

.player-info {
  flex: 0 0 260px;
  min-width: 0;
}

.player-ep-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.player-ep-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.player-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.player-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.btn-ctrl:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: scale(1.08);
}

.btn-ctrl.btn-play-main {
  width: 44px; height: 44px;
  background: var(--accent);
  color: #000;
  font-size: 1.1rem;
}

.btn-ctrl.btn-play-main:hover {
  background: var(--accent-dim);
  transform: scale(1.1);
}

.player-progress {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 36px;
}

.progress-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 99px;
  cursor: pointer;
  position: relative;
  transition: height var(--transition);
}

.progress-bar-wrap:hover { height: 6px; }

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition);
}

.progress-bar-wrap:hover .progress-fill::after { opacity: 1; }

.player-volume {
  flex: 0 0 140px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vol-icon {
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
}

/* ─── Alert / Flash ──────────────────────────────────── */
.alert-success {
  background: rgba(46,213,115,0.1);
  border: 1px solid rgba(46,213,115,0.3);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
}

.alert-danger {
  background: rgba(255,71,87,0.1);
  border: 1px solid rgba(255,71,87,0.3);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
}

.btn-close { filter: invert(1) brightness(0.6); }

/* ─── Login page ─────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.login-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 8px;
}

.login-tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 32px;
}

/* ─── Stats bar ──────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ─── Empty state ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  opacity: 0.3;
  display: block;
  margin-bottom: 16px;
}

.empty-state p { font-size: 0.875rem; }

/* ─── Queue/Playlist view ────────────────────────────── */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.queue-item:hover {
  border-color: var(--border);
  background: var(--bg-hover);
}

.queue-item.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.queue-num {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
}

.queue-title { flex: 1; font-size: 0.875rem; font-weight: 500; }

/* ─── Waveform animation (playing indicator) ─────────── */
.wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.wave-bars span {
  display: block;
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
  animation: wave-anim 0.8s ease-in-out infinite alternate;
}

.wave-bars span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.wave-bars span:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.wave-bars span:nth-child(3) { height: 8px;  animation-delay: 0.2s; }
.wave-bars span:nth-child(4) { height: 14px; animation-delay: 0.3s; }

@keyframes wave-anim {
  to { height: 4px; }
}

/* ─── Modal ──────────────────────────────────────────── */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary);
}

.modal-header {
  border-bottom: 1px solid var(--border) !important;
  padding: 20px 24px !important;
}

.modal-footer {
  border-top: 1px solid var(--border) !important;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 1px;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .player-info { flex: 0 0 160px; }
  .player-volume { display: none; }
  .stats-bar { flex-wrap: wrap; gap: 16px; }
  .episode-grid { grid-template-columns: 1fr; }
  #global-player { padding: 0 12px; gap: 12px; }
  .main-container { padding: 20px 12px; }
}

@media (max-width: 480px) {
  .player-info { flex: 0 0 120px; }
  .btn-ctrl { width: 32px; height: 32px; }
  .btn-ctrl.btn-play-main { width: 40px; height: 40px; }
}
