/* ==========================================================================
   FixSage AI Agent - Design System & Modern Dark Aesthetic
   ========================================================================== */

:root {
  --bg-main: #070a12;
  --bg-surface: #0e1526;
  --bg-surface-elevated: #141f36;
  --bg-glass: rgba(16, 25, 44, 0.78);
  --bg-glass-card: rgba(20, 31, 54, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  --border-emerald: rgba(16, 185, 129, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-emerald: #10b981;
  --text-blue: #38bdf8;
  --text-amber: #f59e0b;
  --text-rose: #f43f5e;

  --accent-purple: #8b5cf6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --gradient-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.25);
  --shadow-emerald-glow: 0 0 30px rgba(16, 185, 129, 0.25);

  --font-main: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-kannada: 'Noto Sans Kannada', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Lights */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  top: -150px;
  left: 10%;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  bottom: 5%;
  right: 5%;
}

/* Glassmorphism Generic Utility */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(9, 13, 24, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.logo-symbol {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.5);
}

.logo-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.logo-text h1 span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
}

/* Channel Pill */
.channel-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.channel-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-info {
  display: flex;
  flex-direction: column;
}

.channel-name {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-verified {
  font-size: 0.7rem;
  color: #38bdf8;
}

.channel-handle {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.yt-link-btn {
  color: #ef4444;
  display: flex;
  align-items: center;
  margin-left: 2px;
  transition: transform 0.2s;
}

.yt-link-btn:hover {
  transform: scale(1.15);
}

/* 24/7 Daemon Indicator */
.daemon-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--border-emerald);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.pulse-indicator {
  width: 9px;
  height: 9px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-ring 2s infinite ease-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 18px var(--accent-emerald); }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.daemon-text {
  display: flex;
  flex-direction: column;
}

.daemon-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-emerald);
  letter-spacing: 0.3px;
}

.daemon-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.autopilot-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--text-amber);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}

.autopilot-toggle.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--text-emerald);
}

.autopilot-toggle:hover {
  transform: translateY(-1px);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  min-width: 220px;
  overflow: hidden;
  z-index: 110;
}

.dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-item {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 24px 120px 24px;
  position: relative;
  z-index: 10;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card.highlight-border {
  border-color: var(--border-emerald);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.12);
}

.stat-card.alert-card {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.1);
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper svg {
  width: 22px;
  height: 22px;
}

.stat-icon-wrapper.purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

.stat-icon-wrapper.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.stat-icon-wrapper.blue {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-blue);
}

.stat-icon-wrapper.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--text-amber);
}

.stat-meta {
  flex: 1;
}

.stat-title {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin: 4px 0;
}

.text-gradient-blue {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-amber {
  color: var(--text-amber);
}

.text-emerald {
  color: var(--text-emerald);
}

.stat-trend {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stat-trend.positive {
  color: var(--text-emerald);
  font-weight: 600;
}

.stat-trend.warning {
  color: var(--text-amber);
}

.score-comparison-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px 0;
}

.old-score {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
}

.arrow {
  color: var(--accent-emerald);
  font-size: 1rem;
}

.new-score {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-emerald);
  border-radius: var(--radius-full);
  transition: width 1s ease-in-out;
}

/* ==========================================================================
   Filter & Controls Bar
   ========================================================================== */
.controls-bar {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  flex: 1;
  min-width: 260px;
  max-width: 420px;
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.pill.active {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.sort-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sort-selector select {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   Video Cards Grid
   ========================================================================== */
.videos-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.video-card {
  padding: 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

/* Left Column: Media & Core Stats */
.video-preview-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.video-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-subtle);
}

.video-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.video-thumb-wrapper:hover img {
  transform: scale(1.05);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s;
}

.video-thumb-wrapper:hover .play-overlay {
  opacity: 1;
}

.play-overlay svg {
  width: 44px;
  height: 44px;
  fill: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.duration-chip {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
}

.video-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.badge-tag.highlight {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.video-metrics-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

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

.metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Right Column: Optimization Suite */
.video-content-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.title-header-group {
  flex: 1;
}

.current-title-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.current-title-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-kannada);
  margin-top: 2px;
}

.score-badge-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.badge-score {
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.badge-score.before {
  color: var(--text-muted);
}

.badge-score.after {
  color: var(--text-emerald);
}

/* 3-Way Title Selector */
.title-variants-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

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

.variants-header h4 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.char-counter {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.variants-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variant-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.variant-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.variant-item.selected {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
}

.variant-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.variant-item.selected .variant-badge {
  background: var(--accent-indigo);
  color: #fff;
}

.variant-content {
  flex: 1;
}

.variant-tag-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 2px;
  display: block;
}

.variant-text {
  font-size: 0.92rem;
  font-weight: 500;
  font-family: var(--font-kannada);
  color: var(--text-primary);
  line-height: 1.5;
}

/* Collapsible Tags & Description Tabs */
.collapsible-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.accordion-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.accordion-body {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  display: none;
}

.accordion-item.open .accordion-body {
  display: block;
}

/* Tag Cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-chip {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-kannada);
}

.tag-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Description Preview */
.desc-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-kannada);
  font-size: 0.84rem;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  line-height: 1.6;
}

/* Video Card Footer Actions */
.card-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.actions-left, .actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-apply-yt {
  background: var(--gradient-emerald);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-apply-yt:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-applied {
  background: rgba(16, 185, 129, 0.2);
  color: var(--text-emerald);
  border: 1px solid var(--border-emerald);
  cursor: default;
}

/* ==========================================================================
   24/7 Daemon Console Drawer (Floating Bottom)
   ========================================================================== */
.daemon-drawer {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 580px;
  background: rgba(14, 21, 38, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 35px rgba(0, 0, 0, 0.7);
  z-index: 90;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.daemon-drawer.collapsed {
  transform: translateY(calc(100% - 48px));
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-title h3 {
  font-size: 0.88rem;
  font-weight: 700;
}

.badge-live {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: var(--text-emerald);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.drawer-body {
  padding: 14px 18px;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.daemon-meta-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.terminal-logs {
  background: #050811;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px;
  height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry {
  display: flex;
  gap: 8px;
  line-height: 1.4;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-level {
  font-weight: 700;
  flex-shrink: 0;
}

.log-level.INFO { color: #38bdf8; }
.log-level.SUCCESS { color: #10b981; }
.log-level.WARNING { color: #f59e0b; }
.log-level.ERROR { color: #f43f5e; }

.log-msg {
  color: #e2e8f0;
}

/* ==========================================================================
   Modal Overlay
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-emerald);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
  font-weight: 500;
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-indigo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px auto;
}

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

.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .video-card {
    grid-template-columns: 1fr;
  }
  .daemon-drawer {
    width: calc(100% - 32px);
    right: 16px;
  }
}

/* ==========================================================================
   Security Gate / Password Authentication Modal
   ========================================================================== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8, 10, 15, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.auth-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 44px 36px;
  background: rgba(18, 22, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(99, 102, 241, 0.15);
  text-align: center;
  overflow: hidden;
}

.auth-shield-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 140px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(139, 92, 246, 0.15) 50%, transparent 75%);
  pointer-events: none;
  filter: blur(24px);
}

.auth-icon-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px auto;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(139, 92, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.auth-icon-badge svg {
  width: 30px;
  height: 30px;
}

.auth-modal h2 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 40%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-group input {
  width: 100%;
  padding: 14px 48px 14px 18px;
  background: rgba(10, 13, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.98rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input-group input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 19, 30, 0.95);
}

.btn-toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-toggle-pw:hover {
  color: #fff;
}

.auth-error-msg {
  display: none;
  font-size: 0.84rem;
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: left;
  animation: shake 0.35s ease;
}

.auth-error-msg.visible {
  display: block;
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 0.96rem;
  font-weight: 600;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.auth-footer {
  margin-top: 24px;
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.lock-btn {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  transition: all 0.2s ease;
}

.lock-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fff;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
