﻿:root {
  --glass-dark: rgba(17, 19, 28, 0.7);
  --glass-light: rgba(255, 255, 255, 0.7);
  --border-dark: rgba(255, 255, 255, 0.1);
  --border-light: rgba(15, 23, 42, 0.08);
  --shadow-dark: 0 30px 80px rgba(0, 0, 0, 0.45);
  --shadow-light: 0 30px 80px rgba(15, 23, 42, 0.12);
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --accent-soft: rgba(56, 189, 248, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: #0a0a0a;
  color: #f8fafc;
}

body.light {
  background: #f8fafc;
  color: #0f172a;
}

body.light .hero-card,
body.light .meta-card,
body.light .inspector-card,
body.light .sheet-card,
body.light .modal-card {
  background: var(--glass-light);
  border-color: var(--border-light);
  box-shadow: var(--shadow-light);
  color: #0f172a;
}

body.light .command-bar,
body.light .input-primary,
body.light .command-input {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--border-light);
  color: #0f172a;
}

body.light .pill,
body.light .btn-secondary,
body.light .btn-ghost,
body.light .action-btn,
body.light .icon-btn {
  color: #0f172a;
}

body.light .hero-card .text-white,
body.light .hero-card .text-slate-300,
body.light .hero-card .text-slate-400,
body.light .inspector-card .text-slate-400,
body.light .meta-card .text-slate-300,
body.light .meta-card .text-slate-400,
body.light .sheet-card .text-slate-400 {
  color: #0f172a;
}

body.light .modal-card .text-slate-300,
body.light .modal-card .text-slate-400,
body.light .modal-card .text-slate-200 {
  color: #0f172a;
}

body.light .hero-card h1,
body.light .hero-card h2,
body.light .hero-card h3 {
  color: #0f172a;
}

body.light .command-hint {
  color: rgba(100, 116, 139, 0.9);
}

body.light .action-btn {
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--border-light);
}

body.light .action-btn.primary {
  color: #ffffff;
}

body.light .icon-btn {
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--border-light);
}

body.light .sheet {
  background: rgba(248, 250, 252, 0.7);
}

body.light header,
body.light footer {
  background: rgba(248, 250, 252, 0.7);
  border-color: rgba(15, 23, 42, 0.08);
}

body.focus-mode .meta-card,
body.focus-mode .inspector,
body.focus-mode .sheet,
body.focus-mode footer,
body.focus-mode header {
  display: none !important;
}

body.focus-mode .hero {
  margin-top: 10vh;
}

.mesh-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.25), transparent 55%),
    radial-gradient(circle at 20% 20%, rgba(129, 140, 248, 0.2), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(236, 72, 153, 0.2), transparent 45%),
    #0a0a0a;
  filter: blur(0px);
  z-index: 0;
  transition: background 0.6s ease;
}

body.light .mesh-bg {
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.25), transparent 55%),
    radial-gradient(circle at 20% 20%, rgba(129, 140, 248, 0.18), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(236, 72, 153, 0.18), transparent 45%),
    #f8fafc;
}

.hero {
  position: relative;
  z-index: 2;
}

.hero-card {
  padding: 2rem;
  border-radius: 2rem;
  background: var(--glass-dark);
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-dark);
  backdrop-filter: blur(24px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-card:hover {
  transform: translateY(-2px);
}

.command-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border-dark);
  background: rgba(10, 10, 10, 0.7);
  transition: box-shadow 0.2s ease, border 0.2s ease;
}

.command-bar:focus-within {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.25);
}

.command-icon {
  font-size: 0.9rem;
  opacity: 0.6;
}

.command-input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: none;
  background: transparent !important;
  color: #e2e8f0;
  font-size: 1rem;
  outline: none;
  caret-color: #38bdf8;
}

.command-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.command-input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

body.light .command-input::placeholder {
  color: rgba(100, 116, 139, 0.8);
}

body.light .command-input {
  color: #0f172a;
  caret-color: #0ea5e9;
}

.command-input::selection {
  background: rgba(56, 189, 248, 0.35);
  color: #0f172a;
}

body.light .command-input::selection {
  background: rgba(14, 165, 233, 0.25);
  color: #0f172a;
}

.command-input:-webkit-autofill,
.command-input:-webkit-autofill:hover,
.command-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e2e8f0;
  box-shadow: 0 0 0px 1000px transparent inset;
  transition: background-color 9999s ease-in-out 0s;
}

body.light .command-input:-webkit-autofill,
body.light .command-input:-webkit-autofill:hover,
body.light .command-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a;
}

body.light .command-bar {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

body.light .command-bar:focus-within {
  border-color: rgba(14, 165, 233, 0.6);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.command-hint {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

.action-bar {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.action-hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.9);
}

body.light .action-hint {
  color: rgba(100, 116, 139, 0.9);
}

.action-btn {
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-btn.primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.7), rgba(99, 102, 241, 0.8));
  border: none;
  color: white;
}

.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pill {
  border-radius: 999px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.pill:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.5);
}

.pill.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2);
}

body.light .pill {
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--border-light);
}

body.light .pill.active {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.4);
}

.action-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px) scale(1.02);
}

.action-divider {
  height: 1.5rem;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 0.25rem;
}

.icon-btn {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  color: #e2e8f0;
}

.meta-card {
  position: relative;
  z-index: 2;
  padding: 1.8rem;
  border-radius: 2rem;
  border: 1px solid var(--border-dark);
  background: var(--glass-dark);
  box-shadow: var(--shadow-dark);
  overflow: hidden;
  animation: fadeUp 0.4s ease;
}

.meta-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(30px) saturate(1.2);
  opacity: 0.2;
  pointer-events: none;
}

.meta-content {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

.meta-thumb {
  position: relative;
  width: 260px;
  max-width: 100%;
}

.meta-thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-dark);
}

.duration-pill {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  background: rgba(10, 10, 10, 0.7);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.meta-info {
  flex: 1;
  min-width: 220px;
}

.meta-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pill-accent {
  background: rgba(236, 72, 153, 0.2);
  border-color: rgba(236, 72, 153, 0.4);
}

.meta-actions {
  position: relative;
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.clip-panel {
  border-radius: 1.2rem;
  border: 1px solid var(--border-dark);
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
}


.clip-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.6rem;
}

.range-primary {
  width: 100%;
  accent-color: #38bdf8;
}

.range-primary::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
}

.range-primary::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #38bdf8;
  border: 2px solid rgba(255, 255, 255, 0.7);
  margin-top: -5px;
}

.range-primary::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
}

.range-primary::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #38bdf8;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

body.light .clip-panel {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--border-light);
}

body.light .range-primary::-webkit-slider-runnable-track,
body.light .range-primary::-moz-range-track {
  background: rgba(15, 23, 42, 0.18);
}

.theme-toggle .theme-icon {
  display: inline-flex;
  align-items: center;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.theme-toggle .icon-sun {
  display: none;
}

body.light .theme-toggle .icon-sun {
  display: inline-block;
}

body.light .theme-toggle .icon-moon {
  display: none;
}

.meta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-primary {
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: white;
  font-weight: 600;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.25);
}

.btn-secondary {
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:disabled,
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-icon {
  font-size: 0.95rem;
}

.btn-ghost {
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--border-dark);
  background: transparent;
  color: #94a3b8;
}

.input-primary {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--border-dark);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.7rem 0.9rem;
  color: inherit;
}

.inspector {
  position: relative;
  z-index: 2;
}

.inspector-card {
  padding: 1.6rem;
  border-radius: 1.6rem;
  border: 1px solid var(--border-dark);
  background: var(--glass-dark);
  box-shadow: var(--shadow-dark);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.inspector-card:hover {
  transform: translateY(-2px);
}

.tab-group {
  display: flex;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-dark);
  padding: 0.2rem;
}

.tab {
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.tab.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.skeleton {
  border-radius: 0.4rem;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.5rem;
  z-index: 60;
}

.sheet-card {
  width: min(680px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-dark);
  background: var(--glass-dark);
  box-shadow: var(--shadow-dark);
  animation: fadeUp 0.35s ease;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 70;
}

.modal-card {
  max-width: 28rem;
  width: 100%;
  border-radius: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-dark);
  background: var(--glass-dark);
  box-shadow: var(--shadow-dark);
  animation: fadeUp 0.35s ease;
}

.toast-stack {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 80;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border-dark);
  background: rgba(0, 0, 0, 0.6);
  color: #e2e8f0;
  box-shadow: var(--shadow-dark);
  animation: toastIn 0.3s ease;
}

.focus-exit {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--border-dark);
  background: rgba(0, 0, 0, 0.6);
  color: #e2e8f0;
  box-shadow: var(--shadow-dark);
}

body.light .focus-exit {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  border-color: var(--border-light);
  box-shadow: var(--shadow-light);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.link-btn {
  color: #94a3b8;
  transition: color 0.2s ease;
}

.link-btn:hover {
  color: #f8fafc;
}

.powered-link {
  color: #0ea5e9;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(14, 165, 233, 0.6);
}

.powered-link:hover {
  color: #22c55e;
  text-decoration-color: rgba(34, 197, 94, 0.6);
}

body.light .powered-link {
  color: #0ea5e9;
  text-decoration-color: rgba(14, 165, 233, 0.5);
}

@media (max-width: 768px) {
  .hero-card {
    padding: 1.5rem;
  }

  .action-divider {
    display: none;
  }

  .meta-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta-thumb img {
    height: 180px;
  }

  .toast-stack {
    left: 1rem;
    right: 1rem;
  }
}
/* ---- Premium polish overrides ---- */
body.accent-midnight {
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --accent-soft: rgba(56, 189, 248, 0.2);
}

body.accent-forest {
  --accent: #34d399;
  --accent-2: #14b8a6;
  --accent-soft: rgba(34, 197, 94, 0.18);
}

.mesh-bg {
  animation: meshShift 18s ease-in-out infinite alternate;
}

.mesh-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.25'/></svg>");
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.hero-card,
.meta-card,
.inspector-card,
.sheet-card,
.modal-card,
.bento-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(34px);
}

.logo-wrap {
  height: 38px;
  width: 38px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.light .logo-wrap {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

body.light .hero-card,
body.light .meta-card,
body.light .inspector-card,
body.light .sheet-card,
body.light .modal-card,
body.light .bento-card {
  border-color: rgba(15, 23, 42, 0.08);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.command-bar {
  border: 1px solid rgba(255, 255, 255, 0.14);
}

body.light .command-bar {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 2px 6px rgba(148, 163, 184, 0.5), inset 0 -2px 6px rgba(255, 255, 255, 0.7);
}

.bento-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.bento-card {
  padding: 1.5rem;
  border-radius: 1.6rem;
  background: var(--glass-dark);
  box-shadow: var(--shadow-dark);
}

body.light .bento-card {
  background: var(--glass-light);
  box-shadow: var(--shadow-light);
}

.download-progress {
  width: 100%;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.progress-fill.indeterminate {
  width: 40%;
  animation: progressPulse 1.4s ease-in-out infinite;
}

.progress-meta {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.9);
}

.action-row {
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
}

.command-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-dark);
  background: rgba(0, 0, 0, 0.6);
  color: #e2e8f0;
  z-index: 80;
}

@keyframes meshShift {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

@keyframes progressPulse {
  0% { transform: translateX(-30%); opacity: 0.6; }
  50% { transform: translateX(60%); opacity: 1; }
  100% { transform: translateX(130%); opacity: 0.6; }
}
.mini-card {
  padding: 0.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

body.light .mini-card {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.03);
}
