/* =======================================================
   PODCAST BRAIN MODERN THEME (DARK / GLASSMORPHISM)
   ======================================================= */
:root {
  --bg-primary: #0a0d14;
  --bg-surface: #121826;
  --bg-surface-elevated: #1a2236;
  --bg-surface-glass: rgba(18, 24, 38, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.16);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.2);
  --accent-emerald: #10b981;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* NAVBAR */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 26px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.badge-dot.warning {
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.badge-dot.danger {
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-color-hover);
}

.btn-gold {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 0 14px var(--accent-gold-glow);
}

.btn-emerald {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* MAIN CONTAINER GRID */
.app-container {
  display: grid;
  grid-template-columns: 280px 380px 1fr;
  flex: 1;
  height: calc(100vh - 61px);
  overflow: hidden;
}

/* SIDEBAR: PODCASTS */
.sidebar-podcasts {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pane-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--text-dim);
}

.podcasts-list {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.podcast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.podcast-item:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-color);
}

.podcast-item.active {
  background: var(--bg-surface-elevated);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.podcast-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #2a334a;
}

.podcast-meta {
  flex: 1;
  min-width: 0;
}

.podcast-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podcast-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* CENTER: EPISODES */
.episodes-panel {
  background: #0d121c;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.episodes-filters {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-blue);
}

.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.pill.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.episodes-list {
  padding: 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.episode-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.episode-card:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-color-hover);
}

.episode-card.active {
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px var(--accent-gold-glow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: capitalize;
}

.status-badge.new {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.status-badge.analyzed {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.status-badge.exported {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* RIGHT: INSPECTOR & AUDIO PLAYER */
.inspector-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow-y: auto;
}

/* STICKY AUDIO PLAYER */
.player-container {
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.player-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.player-status-tag {
  font-size: 12px;
  color: var(--accent-gold);
  font-family: var(--font-mono);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

audio {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
  outline: none;
}

.playback-speed {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* EPISODE DETAIL VIEW */
.episode-details {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.details-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.details-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.details-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.executive-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.executive-summary-title {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.executive-summary-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
}

/* TOPICS SECTION */
.topics-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topics-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.topics-filter-label {
  font-size: 13px;
  color: var(--text-muted);
}

.score-slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-slider {
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.topic-cards-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topic-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.topic-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.timestamp-btn {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.timestamp-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: #60a5fa;
  color: #fff;
  transform: translateY(-1px);
}

.topic-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.topic-score-badge.gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.topic-score-badge.emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.topic-score-badge.blue {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.topic-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.topic-rationale {
  font-size: 13px;
  color: #e2e8f0;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent-gold);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.topic-summary {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
}

.takeaways-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.takeaways-title {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 6px;
}

.takeaways-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.takeaways-list li {
  font-size: 13px;
  color: #e2e8f0;
  position: relative;
  padding-left: 18px;
}

.takeaways-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--accent-emerald);
}

.topic-quote {
  border-left: 3px solid var(--accent-purple);
  padding-left: 12px;
  font-style: italic;
  color: #a78bfa;
  font-size: 13px;
}

.wikilinks-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.wikilink-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 480px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.input-field {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent-blue);
}

/* EMPTY STATES & SPINNER */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 12px;
}

.empty-icon {
  font-size: 42px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px 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); }
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease;
}

.toast.success {
  border-color: var(--accent-emerald);
  color: #ecfdf5;
}

.toast.error {
  border-color: var(--accent-rose);
  color: #fff1f2;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
