/* =====================================================================
   VideoLab — Core Stylesheet
   Design: dark technical base, blue→violet accent gradient used sparingly,
   timecode/monospace treatment for durations & data (functional, not decorative),
   film-strip perforation motif as a structural divider.
   ===================================================================== */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --secondary: #7C3AED;
  --dark: #0F172A;
  --bg: #F8FAFC;
  --white: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --success: #16A34A;
  --error: #DC2626;

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 48px rgba(15,23,42,.14);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.container { max-width: var(--container); 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: 15px;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--error); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: var(--container); margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 32px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-size: 13px; }
.main-nav { display: flex; align-items: center; gap: 28px; margin-left: 8px; flex: 1; }
.main-nav > a { font-weight: 500; color: var(--muted); font-size: 15px; }
.main-nav > a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle { background: none; border: none; font: inherit; font-weight: 500; color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 4px; padding: 0; }
.nav-dropdown-toggle:hover { color: var(--text); }
.chev { font-size: 11px; transition: transform .15s ease; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 18px); left: -20px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 10px; width: 300px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .18s ease;
}
.nav-dropdown.open .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown.open .chev { transform: rotate(180deg); }
.nav-dropdown-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); }
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--primary); }

.hamburger { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 38px; height: 38px; background: none; border: none; }
.hamburger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s ease; margin: 0 auto; }
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-drawer { position: fixed; top: 0; right: -100%; width: min(86vw, 360px); height: 100dvh; background: #fff; z-index: 200; transition: right .25s ease; box-shadow: var(--shadow-lg); overflow-y: auto; }
.mobile-drawer.open { right: 0; }
.mobile-drawer-inner { padding: 90px 24px 32px; display: flex; flex-direction: column; gap: 4px; }
.mobile-drawer-inner > a { padding: 12px 4px; font-weight: 500; border-bottom: 1px solid var(--border); }
.mobile-tools-toggle { background: none; border: none; font: inherit; text-align: left; padding: 12px 4px; font-weight: 500; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; width: 100%; }
.mobile-tools-list { display: none; flex-direction: column; padding: 6px 4px 6px 12px; background: var(--bg); border-radius: var(--radius-sm); margin: 4px 0; }
.mobile-tools-list.open { display: flex; }
.mobile-tools-list a { padding: 10px 6px; font-size: 14px; }
.mobile-drawer-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 150; opacity: 0; visibility: hidden; transition: opacity .2s ease; }
.drawer-backdrop.open { opacity: 1; visibility: visible; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; background: radial-gradient(circle at 15% 0%, #EEF2FF 0%, var(--bg) 55%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--primary); background: #EFF4FF; border: 1px solid #DCE7FF; padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); margin-bottom: 20px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 480px; margin-bottom: 30px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-trust { display: flex; gap: 26px; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.hero-trust span { display: flex; align-items: center; gap: 6px; }

/* Upload dropzone */
.dropzone {
  background: #fff; border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 44px 28px; text-align: center; transition: all .2s ease; position: relative;
}
.dropzone.dragover { border-color: var(--primary); background: #F5F8FF; }
.dropzone-icon { font-size: 40px; margin-bottom: 14px; }
.dropzone h3 { font-size: 18px; margin-bottom: 4px; }
.dropzone .or { color: var(--muted); font-size: 13px; margin: 14px 0; }
.dropzone input[type="file"] { display: none; }
.dropzone-formats { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.dropzone-card { box-shadow: var(--shadow-lg); }

.file-chip { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 14px; text-align: left; }
.file-chip .file-icon { width: 38px; height: 38px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-chip .file-meta { flex: 1; min-width: 0; }
.file-chip .file-meta strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .file-meta span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.file-chip .remove-file { background: none; border: none; color: var(--muted); font-size: 18px; padding: 4px; }
.file-chip .remove-file:hover { color: var(--error); }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); }
.section-head p { color: var(--muted); font-size: 16px; }

/* Film-strip divider — structural, echoes the video-editing subject */
.filmstrip-divider { display: flex; gap: 6px; justify-content: center; margin: 0 0 44px; }
.filmstrip-divider span { width: 10px; height: 10px; border-radius: 2px; background: var(--border); }

/* ---------- Tool grid ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tool-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 26px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #DCE7FF; }
.tool-card .tool-icon { width: 46px; height: 46px; border-radius: 12px; background: #EFF4FF; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.tool-card h3 { font-size: 16.5px; margin-bottom: 2px; }
.tool-card p { color: var(--muted); font-size: 13.5px; margin-bottom: 6px; flex: 1; }
.tool-card .tool-arrow { font-weight: 600; color: var(--primary); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.tool-card:hover .tool-arrow { gap: 10px; }

/* ---------- How it works / steps ---------- */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card { text-align: center; padding: 8px; }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 600; margin: 0 auto 16px; }
.step-card h3 { font-size: 17px; }
.step-card p { color: var(--muted); font-size: 14px; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 780px; margin: 0 auto; }
.price-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px; position: relative; }
.price-card.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.price-card .badge { position: absolute; top: -12px; right: 28px; background: var(--secondary); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.price-card h3 { font-size: 20px; }
.price-amount { font-family: var(--font-display); font-size: 40px; font-weight: 700; margin: 10px 0 18px; }
.price-amount span { font-size: 15px; color: var(--muted); font-weight: 500; }
.price-list { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 11px; }
.price-list li { display: flex; gap: 10px; font-size: 14.5px; }
.price-list li::before { content: "✓"; color: var(--success); font-weight: 700; }

/* ---------- Cards / forms ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-sm); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.form-control {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--text); transition: border-color .15s ease;
}
.form-control:focus { border-color: var(--primary); }
select.form-control { appearance: none; background: #fff url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%228%22><path d=%22M1 1l5 5 5-5%22 stroke=%22%2364748B%22 stroke-width=%222%22 fill=%22none%22/></svg>') no-repeat right 14px center; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.auth-shell { max-width: 420px; margin: 60px auto; padding: 0 24px; }
.auth-shell h1 { font-size: 26px; text-align: center; }
.auth-shell .subtitle { text-align: center; color: var(--muted); margin-bottom: 28px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--primary); font-weight: 600; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px; }
.alert-error { background: #FEF2F2; color: var(--error); border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: var(--success); border: 1px solid #BBF7D0; }

/* ---------- Tool page layout ---------- */
.tool-page-head { padding: 40px 0 8px; }
.tool-page-head h1 { font-size: 30px; }
.tool-page-head p { color: var(--muted); font-size: 16px; }
.tool-workspace { display: grid; grid-template-columns: 1fr 340px; gap: 28px; padding: 24px 0 72px; align-items: start; }
.tool-options .card + .card { margin-top: 18px; }
.progress-bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 14px 0; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 999px; transition: width .3s ease; width: 0%; }
.processing-note { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.result-box { text-align: center; padding: 20px 0; }
.result-box .check { width: 56px; height: 56px; border-radius: 50%; background: #F0FDF4; color: var(--success); font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.meta-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.meta-table td { padding: 9px 0; border-bottom: 1px solid var(--border); }
.meta-table td:first-child { color: var(--muted); width: 45%; }
.meta-table td:last-child { font-family: var(--font-mono); font-size: 13px; }
.timecode { font-family: var(--font-mono); }

.tabs { display: flex; gap: 4px; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; padding: 9px; border: none; background: none; border-radius: 7px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* Batch / merge list */
.file-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.file-list-item { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: grab; }
.file-list-item .drag-handle { color: var(--muted); }
.file-list-item .name { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list-item .status { font-size: 12px; color: var(--muted); }
.file-list-item.dragging { opacity: .5; }

/* Toasts */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--dark); color: #fff; padding: 13px 18px; border-radius: var(--radius-sm); font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: toast-in .2s ease; max-width: 320px; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Dashboard */
.dash-shell { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px 0 72px; }
.dash-sidebar { display: flex; flex-direction: column; gap: 4px; }
.dash-sidebar a { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--muted); }
.dash-sidebar a.active, .dash-sidebar a:hover { background: var(--bg); color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.stat-card .num { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: 13px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-block; }
.status-pill.completed { background: #F0FDF4; color: var(--success); }
.status-pill.processing { background: #EFF4FF; color: var(--primary); }
.status-pill.failed { background: #FEF2F2; color: var(--error); }
.status-pill.queued, .status-pill.cancelled { background: var(--bg); color: var(--muted); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

/* Footer */
.site-footer { background: var(--dark); color: #CBD5E1; padding: 56px 0 0; margin-top: 40px; }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 0 24px 40px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand .logo { color: #fff; }
.footer-brand p { color: #94A3B8; font-size: 13.5px; margin-top: 8px; }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 14px; }
.footer-col a { display: block; color: #94A3B8; font-size: 14px; padding: 5px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); text-align: center; padding: 20px 0; font-size: 13px; color: #64748B; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--dark); color: #CBD5E1; padding: 24px 16px; }
.admin-sidebar .logo { color: #fff; margin-bottom: 30px; }
.admin-sidebar a { display: block; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: #94A3B8; margin-bottom: 2px; }
.admin-sidebar a.active, .admin-sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-main { padding: 32px 36px; background: var(--bg); }
