/* Cutdee Subtitle - Linear emerald theme
   Mirrors abroll-pro-max design for consistency across cutdee.com apps.
*/
:root {
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --paper: #fafaf9;
  --paper-2: #f5f5f4;
  --ink: #0a0a0a;
  --ink-2: #404040;
  --ink-3: #737373;
  --line: #e7e5e4;
  --line-2: #d6d3d1;
  --red-500: #ef4444;
  --amber-500: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 12px;
}

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

html, body {
  font-family: 'Inter', 'Noto Sans Thai', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  font-size: 15px;
}

a { color: var(--emerald-700); text-decoration: none; }
a:hover { text-decoration: underline; }

code { font-family: ui-monospace, 'SF Mono', monospace; font-size: 0.9em; background: var(--paper-2); padding: 1px 6px; border-radius: 4px; }

/* ─── Nav ─── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 249, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--emerald-700); color: var(--paper);
  border-radius: 8px; font-weight: 800; font-size: 18px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-tagline { font-size: 11px; color: var(--ink-3); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 6px 12px; border-radius: 6px;
  color: var(--ink-2); font-weight: 500; font-size: 14px;
}
.nav-link:hover { background: var(--paper-2); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 13px; color: var(--ink-2); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px;
  font-weight: 600; font-size: 14px; line-height: 1;
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-primary { background: var(--emerald-700); color: var(--paper); }
.btn-primary:hover { background: var(--emerald-800); text-decoration: none; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { background: var(--paper-2); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper-2); text-decoration: none; }

/* ─── Hero ─── */
.hero { padding: 80px 24px 60px; text-align: center; background: linear-gradient(180deg, var(--emerald-50) 0%, var(--paper) 100%); }
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-tag {
  display: inline-block; padding: 4px 12px; margin-bottom: 20px;
  background: var(--emerald-100); color: var(--emerald-800);
  border-radius: 999px; font-size: 13px; font-weight: 600;
}
.hero-title {
  font-size: 56px; font-weight: 800; line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.strike { text-decoration: line-through; color: var(--ink-3); }
.emerald { color: var(--emerald-700); }
.hero-subtitle { font-size: 18px; color: var(--ink-2); margin-bottom: 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Features ─── */
.features { padding: 60px 24px; max-width: 1200px; margin: 0 auto; }
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.feature {
  padding: 24px; background: white;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: all 0.2s;
}
.feature:hover { border-color: var(--emerald-500); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 32px; margin-bottom: 12px; }
.feature h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.feature p { font-size: 14px; color: var(--ink-2); }

/* ─── Container / Sections ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 32px 0 16px; }
h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.lead { font-size: 16px; color: var(--ink-2); margin-bottom: 24px; }
.muted { color: var(--ink-3); font-size: 13px; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: 14px; color: var(--ink-2); }

/* ─── Sample ─── */
.sample-section { padding: 60px 24px; background: var(--paper-2); }
.sample-section h2 { text-align: center; }
.sample-section .lead { text-align: center; }
.sample-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; max-width: 1100px; margin: 32px auto;
}
@media (max-width: 720px) { .sample-grid { grid-template-columns: 1fr; } }
.sample-card {
  background: white; padding: 20px; border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
.sample-card h3 { margin-bottom: 12px; }
.sample-video { width: 100%; border-radius: 6px; background: #000; }
.sample-srt {
  background: var(--paper-2); padding: 12px; border-radius: 6px;
  font-size: 12px; max-height: 240px; overflow: auto;
  font-family: ui-monospace, monospace;
}
.sample-form {
  max-width: 700px; margin: 24px auto;
  background: white; padding: 24px; border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
.sample-form h3 { margin-bottom: 16px; }
.sample-form .form-row { margin-bottom: 16px; }
.sample-form .btn { width: 100%; }

/* ─── Forms ─── */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 24px;
}
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.form-section {
  background: white; padding: 20px; border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
.form-section h3 { margin-bottom: 12px; }
.form-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 12px;
}
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea {
  padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 6px;
  background: white; color: var(--ink);
  font-family: inherit; font-size: 14px;
  transition: border-color 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.textarea { font-family: ui-monospace, monospace; font-size: 13px; resize: vertical; }
.color-input { width: 100%; height: 38px; padding: 2px; cursor: pointer; }
.range { width: 100%; }
.sub-input-toggle { display: flex; gap: 16px; margin-bottom: 12px; }
.sub-input-toggle label { flex-direction: row; align-items: center; gap: 6px; }

.burn-form { background: white; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); margin-bottom: 24px; }
.burn-form > .form-section { margin-bottom: 20px; }
.burn-form > .btn { width: 100%; }
.preview { margin-top: 8px; }
.preview video { max-width: 100%; max-height: 200px; border-radius: 6px; }

/* ─── Alerts ─── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-warn { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }

/* ─── Status / Progress ─── */
.status {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.status-pending { background: var(--paper-2); color: var(--ink-3); }
.status-uploading, .status-ready { background: #dbeafe; color: #1e40af; }
.status-processing { background: #fef3c7; color: #92400e; }
.status-done { background: var(--emerald-100); color: var(--emerald-800); }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-canceled { background: var(--paper-2); color: var(--ink-3); }

.progress { background: white; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); margin-bottom: 24px; }
.progress-bar { width: 100%; height: 8px; background: var(--paper-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: var(--emerald-600); border-radius: 999px; transition: width 0.3s; }
.mini-bar { width: 100%; height: 4px; background: var(--paper-2); border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.mini-fill { height: 100%; background: var(--emerald-500); }

.result { background: white; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--emerald-500); margin-top: 16px; }
.result video { width: 100%; max-height: 480px; border-radius: 6px; background: #000; margin: 16px 0; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.log-block {
  background: var(--ink); color: #d1fae5;
  padding: 12px; border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: 12px;
  max-height: 200px; overflow: auto;
  margin-top: 12px;
}

/* ─── Jobs table ─── */
.jobs-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.jobs-table th, .jobs-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.jobs-table th { background: var(--paper-2); font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--ink-3); }
.jobs-table tr:hover { background: var(--paper); }

/* ─── Job detail ─── */
.job-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.job-card { background: white; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.job-card h3 { margin-bottom: 8px; }
.job-card .progress-bar { margin: 8px 0; }
.job-video { width: 100%; max-height: 200px; border-radius: 6px; background: #000; margin: 8px 0; }
.settings-block { background: var(--paper-2); padding: 8px; border-radius: 6px; font-size: 12px; max-height: 200px; overflow: auto; }
.files-list { list-style: none; }
.files-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.files-list li:last-child { border-bottom: 0; }
.events-list { max-height: 400px; overflow: auto; }
.event { padding: 6px 8px; font-size: 13px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.event-error { background: #fee2e2; }
.event-warn { background: #fef3c7; }
.event small { min-width: 60px; }

/* ─── Empty ─── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--ink-3); }
.empty-state .btn { margin-top: 16px; }

/* ─── Code blocks ─── */
.code-block {
  background: var(--ink); color: #ecfdf5;
  padding: 16px; border-radius: 8px;
  font-family: ui-monospace, monospace; font-size: 13px;
  overflow-x: auto; margin: 12px 0;
}
.code-block code { background: transparent; padding: 0; color: inherit; }

/* ─── API section ─── */
.api-section { padding: 60px 24px; background: var(--paper-2); }

/* ─── Footer ─── */
.footer {
  padding: 40px 24px; text-align: center;
  border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 13px;
}
.footer p { margin: 4px 0; }
.main { min-height: calc(100vh - 200px); }
