/* ===================================================================
   YT Automator — Design System
=================================================================== */

:root {
  --bg: #0b0d12;
  --bg-elevated: #12151c;
  --bg-card: #161a23;
  --border: #232838;
  --border-light: #2c3244;
  --text: #eef0f5;
  --text-muted: #9aa3b5;
  --text-faint: #626a80;

  --accent: #7c5cff;
  --accent-2: #ff5c9e;
  --accent-gradient: linear-gradient(135deg, #7c5cff 0%, #ff5c9e 100%);
  --accent-soft: rgba(124, 92, 255, 0.14);

  --success: #2dd4a7;
  --success-soft: rgba(45, 212, 167, 0.14);
  --warning: #ffb547;
  --warning-soft: rgba(255, 181, 71, 0.14);
  --danger: #ff5c72;
  --danger-soft: rgba(255, 92, 114, 0.14);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.25);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0 0 1em; color: var(--text-muted); }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(124, 92, 255, 0.5); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(255, 92, 114, 0.3);
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 14.5px; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .navbar-inner { position: relative; }
  .mobile-menu {
    display: none;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    flex-direction: column;
    gap: 16px;
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a { color: var(--text-muted); font-weight: 500; padding: 6px 0; }
}
@media (min-width: 861px) { .mobile-menu { display: none !important; } }

/* ---------- Hero ---------- */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse at center, rgba(124,92,255,0.25) 0%, rgba(124,92,255,0) 70%);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #b6a5ff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  max-width: 820px;
  margin: 0 auto 20px;
}
.hero .subtitle {
  max-width: 600px;
  margin: 0 auto 36px;
  font-size: 17px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); }

.grid {
  display: grid;
  gap: 22px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.card-hover { transition: transform 0.2s ease, border-color 0.2s ease; }
.card-hover:hover { transform: translateY(-3px); border-color: var(--border-light); }

.feature-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #b6a5ff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

/* ---------- Pricing ---------- */
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan-badge {
  position: absolute; top: -12px; right: 24px;
  background: var(--accent-gradient);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
}
.plan-price { font-size: 40px; font-weight: 800; margin: 12px 0 4px; }
.plan-price span { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.plan-features { margin: 24px 0; flex: 1; }
.plan-features li { display: flex; gap: 10px; padding: 7px 0; color: var(--text-muted); font-size: 14px; }
.plan-features li::before { content: "✓"; color: var(--success); font-weight: 700; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--text-muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], textarea, select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 100px; }

.auth-shell {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 24px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }

/* ---------- Alerts ---------- */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: #ff8a9a; border-color: rgba(255,92,114,0.3); }
.alert-success { background: var(--success-soft); color: #5fe3c0; border-color: rgba(45,212,167,0.3); }

/* ---------- App shell (dashboard/admin) ---------- */
.app-shell { display: flex; min-height: calc(100vh - 68px); }
.sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  background: var(--bg-elevated);
}
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14.5px;
  margin-bottom: 4px;
}
.sidebar a:hover { background: var(--bg-card); color: var(--text); }
.sidebar a.active { background: var(--accent-soft); color: #cabdff; }
.main-content { flex: 1; padding: 32px 28px; min-width: 0; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar a { white-space: nowrap; margin-bottom: 0; }
  .main-content { padding: 20px 16px; }
}

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px; flex-wrap: wrap; gap: 14px;
}
.page-head h1 { margin: 0; font-size: 24px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .label { font-size: 13px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-faint); font-weight: 600; text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.05em; background: var(--bg-elevated); }
tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-processing { background: var(--warning-soft); color: var(--warning); }
.badge-ready_for_review { background: var(--accent-soft); color: #cabdff; }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-publishing { background: var(--warning-soft); color: var(--warning); }
.badge-published { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }
.badge-failed { background: var(--danger-soft); color: var(--danger); }
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-suspended { background: var(--danger-soft); color: var(--danger); }
.badge-trial { background: var(--accent-soft); color: #cabdff; }

/* ---------- Upload dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { font-size: 40px; margin-bottom: 14px; }

/* ---------- Preview page ---------- */
.preview-grid { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .preview-grid { grid-template-columns: 1fr; } }
.thumb-frame {
  width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.thumb-frame img, .thumb-frame video { width: 100%; height: 100%; object-fit: cover; }
.tag-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-pill { background: var(--bg-elevated); border: 1px solid var(--border-light); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; text-align: center; color: var(--text-faint); font-size: 13.5px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.progress-bar { height: 8px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent-gradient); border-radius: 999px; }
