:root { color-scheme: dark; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 18% -5%, rgba(29,78,216,0.2), transparent 60%),
    radial-gradient(ellipse 55% 45% at 85% 5%, rgba(255,59,79,0.18), transparent 60%);
}

main, header { position: relative; z-index: 1; }

.text-gradient-sm {
  background: linear-gradient(90deg, #ff3b4f, #1d4ed8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #ff3b4f, #ff1c3a 45%, #1d4ed8);
  box-shadow: 0 0 20px rgba(255,59,79,0.45);
  display: grid;
  place-items: center;
}
.logo-mark::after {
  content: '';
  width: 1rem;
  height: 1rem;
  background: #05060a;
  border-radius: 0.35rem;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M5 4l14 8-14 8V4z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M5 4l14 8-14 8V4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 24px 48px -24px rgba(0,0,0,0.7);
}

.neon-border { position: relative; isolation: isolate; }
.neon-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,59,79,0.55), rgba(29,78,216,0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff3b4f, #ff1c3a 50%, #1d4ed8);
  box-shadow: 0 0 20px rgba(255,59,79,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(255,59,79,0.55); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #d1d5db;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.08); }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #9ca3af;
  transition: all 0.2s;
}
.nav-btn svg { width: 1rem; height: 1rem; }
.nav-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-btn.active {
  color: #fff;
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 1px rgba(255,59,79,0.35);
}

.input-field {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.input-field:focus { border-color: rgba(255,59,79,0.5); }

.stat-card {
  padding: 1.25rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: #fff; font-family: 'Space Grotesk', sans-serif; }
.stat-card .label { font-size: 0.75rem; color: #9ca3af; margin-top: 0.25rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #d1d5db;
}

.score-ring {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  background: conic-gradient(#ff3b4f var(--pct), rgba(255,255,255,0.08) 0);
  position: relative;
}
.score-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #0a0c12;
}

.video-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s;
}
.video-row:hover { background: rgba(255,255,255,0.04); }
.video-row img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 0.5rem; flex-shrink: 0; }

.channel-card {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.25s, box-shadow 0.25s;
}
.channel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(255,59,79,0.25), 0 16px 32px -12px rgba(255,59,79,0.2);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5,6,10,0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.loading-overlay.hidden { display: none; }

.orb-wrap { position: relative; width: 5rem; height: 5rem; }
.orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff3b4f, #1d4ed8, #ff3b4f);
  animation: spin 4s linear infinite;
}
.orb-inner {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #05060a;
  display: grid;
  place-items: center;
}
.spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid #ff3b4f;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.analysis-block h3 { font-weight: 600; color: #fff; margin-bottom: 0.5rem; }
.analysis-block ul { list-style: none; padding: 0; margin: 0; }
.analysis-block li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.875rem;
  color: #d1d5db;
}
.analysis-block li::before { content: '→ '; color: #ff3b4f; }

.thumb-preview {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16/9;
  border-radius: 1rem;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 20px 40px -15px rgba(0,0,0,0.6);
}

.drop-zone {
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone.dragover { border-color: #ff3b4f; background: rgba(255,59,79,0.08); }

.alert-error {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255,59,79,0.12);
  border: 1px solid rgba(255,59,79,0.35);
  color: #fecaca;
  font-size: 0.875rem;
}
