/* === ClipFlow AI — Design System === */
:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --accent: #7C3AED;
    --bg: #0F172A;
    --bg-card: #1E293B;
    --bg-input: #334155;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --border: #334155;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 200ms ease;
    --max-w: 1200px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* === Navbar === */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; color: white;
}
.logo-text { font-weight: 700; font-size: 18px; }
.logo-ai { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color var(--transition); }
.nav-links a:hover { color: var(--text); }
.nav-auth { display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: var(--transition); }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: var(--radius-sm); border: none;
    font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: all var(--transition); line-height: 1.4;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* === Hero === */
.hero {
    padding: 100px 0 80px; text-align: center;
    background: radial-gradient(ellipse at top, rgba(37,99,235,0.15) 0%, transparent 60%);
}
.hero h1 { font-size: 56px; font-weight: 800; line-height: 1.1; margin-bottom: 20px; }
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 20px; color: var(--text-muted); max-width: 600px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; }
.stat { text-align: center; }
.stat strong { display: block; font-size: 18px; }
.stat span { font-size: 13px; color: var(--text-muted); }

/* === Features === */
.features, .tools-section { padding: 80px 0; }
.features h2, .tools-section h2 { text-align: center; font-size: 36px; margin-bottom: 48px; }
.features-grid, .tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card, .tool-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 32px;
    border: 1px solid var(--border); transition: border-color var(--transition);
}
.feature-card:hover, .tool-card:hover { border-color: var(--primary); }
.feature-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 20px; color: white; margin-bottom: 16px;
}
.tool-icon { font-size: 36px; margin-bottom: 12px; }
.feature-card h3, .tool-card h3 { font-size: 20px; margin-bottom: 8px; }
.feature-card p, .tool-card p { color: var(--text-muted); font-size: 14px; }

/* === Auth === */
.auth-section { padding: 80px 0; display: flex; justify-content: center; }
.auth-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 40px;
    border: 1px solid var(--border); width: 100%; max-width: 440px;
}
.auth-card h2 { margin-bottom: 8px; }
.auth-sub { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.auth-alt { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 14px; }
.auth-alt a { color: var(--primary); text-decoration: none; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-input); color: var(--text);
    font-size: 14px; transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); }
.form-group input[type="range"] { padding: 0; background: none; border: none; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { color: var(--error); font-size: 14px; margin-bottom: 12px; padding: 8px 12px; background: rgba(239,68,68,0.1); border-radius: var(--radius-sm); }
.form-success { color: var(--success); font-size: 14px; margin-bottom: 12px; padding: 8px 12px; background: rgba(16,185,129,0.1); border-radius: var(--radius-sm); }

/* === Dashboard === */
.dashboard-section { padding: 40px 0; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.dash-header h1 { font-size: 28px; }
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    background: var(--primary); color: white;
}
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 24px;
    border: 1px solid var(--border); text-align: center;
}
.stat-card.highlight { border-color: var(--primary); background: rgba(37,99,235,0.1); }
.stat-value { display: block; font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* === Jobs List === */
.jobs-list h2 { font-size: 20px; margin-bottom: 16px; }
.job-card {
    background: var(--bg-card); border-radius: var(--radius-sm); padding: 16px 20px;
    border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    transition: border-color var(--transition);
}
.job-card:hover { border-color: var(--primary); }
.job-name { font-weight: 600; display: block; }
.job-meta { font-size: 13px; color: var(--text-muted); }
.job-status { text-align: right; }
.job-date { font-size: 12px; color: var(--text-muted); display: block; margin-top: 4px; }
.status-badge {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.status-pending { background: rgba(245,158,11,0.2); color: var(--warning); }
.status-uploaded { background: rgba(245,158,11,0.2); color: var(--warning); }
.status-processing { background: rgba(37,99,235,0.2); color: var(--primary); }
.status-completed { background: rgba(16,185,129,0.2); color: var(--success); }
.status-failed { background: rgba(239,68,68,0.2); color: var(--error); }

.empty-state { text-align: center; padding: 60px 0; color: var(--text-muted); }
.empty-state .btn { margin-top: 16px; }

/* === Upload === */
.upload-section { padding: 40px 0; }
.upload-zone {
    background: var(--bg-card); border: 2px dashed var(--border);
    border-radius: var(--radius); padding: 60px 40px; text-align: center;
    transition: border-color var(--transition);
}
.upload-zone.drag-active { border-color: var(--primary); background: rgba(37,99,235,0.05); }
.upload-icon { font-size: 64px; margin-bottom: 16px; }
.upload-prompt h3 { margin-bottom: 8px; }
.upload-browse { color: var(--primary); cursor: pointer; text-decoration: underline; }
.upload-hint { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.upload-filename { font-size: 14px; color: var(--text-muted); margin-top: 8px; }

.progress-bar, .progress-bar-lg {
    width: 100%; height: 8px; background: var(--bg-input);
    border-radius: 4px; overflow: hidden; margin-bottom: 12px;
}
.progress-bar-lg { height: 12px; }
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px; transition: width 0.5s ease;
}
.progress-fill.progress-error { background: var(--error); }

/* === Options === */
.options-panel { margin-top: 24px; }
.options-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 24px;
    border: 1px solid var(--border); margin-bottom: 16px;
}
.options-card h3 { margin-bottom: 16px; font-size: 18px; }
.option-group { display: flex; flex-direction: column; gap: 8px; }
.option-radio {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: border-color var(--transition);
}
.option-radio.selected { border-color: var(--primary); background: rgba(37,99,235,0.05); }
.option-radio input { margin-top: 4px; }
.option-radio strong { display: block; margin-bottom: 2px; }
.option-radio p { font-size: 13px; color: var(--text-muted); }

.file-info {
    display: flex; gap: 12px; align-items: center; margin-bottom: 20px;
    padding: 12px 16px; background: var(--bg-card); border-radius: var(--radius-sm);
    border: 1px solid var(--border); font-size: 14px;
}
.file-badge { font-weight: 600; color: var(--primary); }

/* === Job tracking === */
.job-section { padding: 60px 0; }
.progress-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 40px;
    border: 1px solid var(--border); text-align: center;
}
.progress-status { margin-bottom: 24px; display: flex; justify-content: center; align-items: center; gap: 12px; }
.progress-message { color: var(--text-muted); font-size: 16px; margin-top: 12px; }
.progress-percent { font-size: 24px; font-weight: 800; margin-top: 8px; }
.error-block, .success-block { margin-top: 24px; }
.error-block p { color: var(--error); margin-bottom: 12px; }
.success-block p { color: var(--success); font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* === Result === */
.result-section { padding: 40px 0; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 16px; }
.back-link:hover { color: var(--text); }
.result-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.video-player { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-el { width: 100%; max-height: 500px; display: block; }
.result-actions { display: flex; gap: 12px; margin-bottom: 32px; }
.result-extra { background: var(--bg-card); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); }
.result-extra h3 { margin-bottom: 12px; }
.download-links { display: flex; gap: 8px; flex-wrap: wrap; }
.transcription-meta { display: flex; gap: 8px; margin-bottom: 12px; }
.transcription-meta .badge {
    background: var(--bg-main); padding: 4px 12px; border-radius: 20px;
    font-size: 13px; color: var(--text-muted); border: 1px solid var(--border);
}
.transcription-text {
    background: var(--bg-main); border-radius: var(--radius); padding: 16px;
    font-size: 14px; line-height: 1.7; max-height: 300px; overflow-y: auto;
    margin-bottom: 16px; border: 1px solid var(--border); white-space: pre-wrap;
}
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.clips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-bottom: 24px; }
.clip-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 16px;
    border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
}
.clip-header { display: flex; justify-content: space-between; align-items: center; }
.clip-number { font-weight: 700; font-size: 14px; }
.clip-score { background: var(--primary); color: white; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.clip-player .video-el { max-height: 240px; border-radius: 8px; }
.clip-title { font-size: 14px; line-height: 1.4; color: var(--text-main); }
.clip-meta { font-size: 13px; color: var(--text-muted); }
.option-radio.disabled { opacity: 0.5; cursor: not-allowed; }
.option-radio.disabled input { pointer-events: none; }
.plan-badge {
    display: inline-block; background: var(--primary); color: white;
    font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-top: 4px; font-weight: 600;
}

/* === Pricing === */
.pricing-section { padding: 80px 0; text-align: center; }
.pricing-sub { color: var(--text-muted); font-size: 18px; margin-bottom: 48px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pricing-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 32px;
    border: 1px solid var(--border); text-align: left; position: relative;
    transition: border-color var(--transition);
}
.pricing-card.featured { border-color: var(--primary); }
.pricing-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: white; padding: 4px 16px;
    border-radius: 20px; font-size: 12px; font-weight: 600;
}
.pricing-header { margin-bottom: 24px; }
.pricing-header h3 { font-size: 22px; margin-bottom: 8px; }
.price { font-size: 40px; font-weight: 800; }
.period { font-size: 16px; color: var(--text-muted); }
.pricing-features { list-style: none; margin-bottom: 24px; }
.pricing-features li {
    padding: 8px 0; border-bottom: 1px solid var(--border);
    font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.pricing-features li::before { content: '\2713'; color: var(--success); font-weight: 700; }
.pricing-features li.disabled { color: var(--text-muted); }
.pricing-features li.disabled::before { content: '\2717'; color: var(--error); }
.pricing-card.current-plan { border-color: var(--success); }
.upgrade-link { display: block; margin-top: 6px; font-size: 12px; color: var(--primary); text-decoration: underline; }

/* === Settings === */
.settings-section { padding: 40px 0; }
.settings-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 24px;
    border: 1px solid var(--border); margin-bottom: 16px; max-width: 600px;
}
.settings-card h3 { margin-bottom: 16px; }

/* === Footer === */
.footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: auto; }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-muted); font-size: 12px; }

/* === Loading === */
.loading { text-align: center; padding: 60px 0; color: var(--text-muted); }

/* === Video Tabs (before/after comparison) === */
.video-tabs { margin-bottom: 24px; }
.tab-buttons { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg-input); border-radius: var(--radius-sm); padding: 4px; width: fit-content; }
.tab-btn {
    padding: 8px 20px; border: none; background: transparent; color: var(--text-muted);
    font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 6px;
    transition: all var(--transition);
}
.tab-btn.active { background: var(--primary); color: white; }
.tab-btn:hover:not(.active) { color: var(--text); }

/* === Responsive === */
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    h1 { font-size: 28px; }
    h2 { font-size: 22px; }
    .result-stats { grid-template-columns: 1fr; }
    .clips-grid { grid-template-columns: 1fr; }
    .tab-buttons { width: 100%; }
    .tab-btn { flex: 1; text-align: center; }
    .download-links { flex-direction: column; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 36px; }
    .hero-sub { font-size: 16px; }
    .hero-stats { flex-direction: column; gap: 16px; }
    .hero-cta { flex-direction: column; }
    .features-grid, .tools-grid, .pricing-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); padding: 16px 24px; border-bottom: 1px solid var(--border); }
    .nav-links.active { display: flex; }
    .nav-auth { flex-direction: column; width: 100%; }
    .nav-auth .btn { width: 100%; }
    .dash-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .result-actions { flex-direction: column; }
    .footer-content { flex-direction: column; text-align: center; }
    .upload-zone { padding: 40px 20px; }
    .file-info { flex-direction: column; }
    .faq-question { font-size: 15px; padding: 14px 16px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid, .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .clips-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === FAQ Section === */
.faq-section { padding: 80px 0; }
.faq-section h2 { text-align: center; margin-bottom: 40px; }
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px; background: none; border: none; color: var(--text);
    font-size: 16px; font-weight: 500; cursor: pointer; text-align: left;
    transition: color var(--transition);
}
.faq-question:hover, .faq-question.active { color: var(--primary); }
.faq-arrow { font-size: 12px; transition: transform var(--transition); }
.faq-question.active .faq-arrow { transform: rotate(180deg); }
.faq-answer { padding: 0 20px 18px; }
.faq-answer p { color: var(--text-muted); line-height: 1.7; }

/* === Legal Pages === */
.legal-page { padding: 60px 0; }
.legal-page h1 { margin-bottom: 8px; }
.legal-date { color: var(--text-muted); font-size: 14px; margin-bottom: 40px; }
.legal-page h2 { font-size: 18px; margin: 32px 0 12px; color: var(--primary); }
.legal-page p, .legal-page li { color: var(--text-muted); line-height: 1.8; margin-bottom: 8px; }
.legal-page ul { padding-left: 24px; margin-bottom: 12px; }
.legal-page a { color: var(--primary); text-decoration: underline; }
