/* ============================================================
   Kclip — styles
   Extracted from the original index.html monolith, plus new
   components (AI panel, settings, library, billing, admin link).
   ============================================================ */
:root {
    --bg: #08080d;
    --bg-elevated: #0f0f17;
    --card: #14141f;
    --card-hover: #1a1a28;
    --border: #222235;
    --border-light: #2a2a40;
    --text: #eaeaf0;
    --text-secondary: #9898b0;
    --text-muted: #5a5a72;
    --accent: #ff5733;
    --accent-light: #ff7a5c;
    --accent-dark: #cc4528;
    --accent-glow: rgba(255, 87, 51, 0.25);
    --success: #00d4a0;
    --success-glow: rgba(0, 212, 160, 0.2);
    --warning: #ffb020;
    --danger: #ff4466;
    --sidebar-w: 260px;
    --topbar-h: 60px;
    --timeline-h: 200px;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LANDING PAGE ===== */
#landing { display: block; }
#app-shell { display: none; }

.landing-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(8, 8, 13, 0.8);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s;
}
.landing-nav.scrolled { background: rgba(8, 8, 13, 0.95); }

.nav-brand {
    font-size: 1.5rem; font-weight: 700; color: var(--text);
    text-decoration: none; letter-spacing: -0.5px;
}
.nav-brand span { color: var(--accent); }

.nav-links a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.9rem; font-weight: 500; transition: color 0.2s;
    margin-left: 2rem;
}
.nav-links a:hover { color: var(--text); }

.btn-accent {
    background: var(--accent); color: #fff; border: none;
    padding: 0.6rem 1.6rem; border-radius: 8px;
    font-family: inherit; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: all 0.25s;
    text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 8px 30px var(--accent-glow);
    color: #fff;
}
.btn-accent:active { transform: translateY(0); }
.btn-accent:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
    background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border); padding: 0.6rem 1.6rem;
    border-radius: 8px; font-family: inherit; font-weight: 500;
    font-size: 0.9rem; cursor: pointer; transition: all 0.25s;
    text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-ghost:hover {
    border-color: var(--text-muted); color: var(--text);
    background: var(--card);
}

/* Hero */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    position: relative; overflow: hidden; padding-top: 80px;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.15;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
}
.hero-blob {
    position: absolute; border-radius: 50%; filter: blur(100px);
    animation: blobFloat 12s ease-in-out infinite alternate;
}
.hero-blob-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    top: -10%; right: -5%;
}
.hero-blob-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(0, 212, 160, 0.12), transparent 70%);
    bottom: 10%; left: -5%;
    animation-delay: -6s;
}
@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -30px) scale(1.1); }
}

.hero h1 {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 700; line-height: 1.05;
    letter-spacing: -2px; margin-bottom: 1.5rem;
}
.hero h1 .accent-word {
    background: linear-gradient(135deg, var(--accent), var(--accent-light), var(--warning));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 1.15rem; color: var(--text-secondary);
    max-width: 520px; line-height: 1.7; margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual {
    position: relative; width: 100%; max-width: 580px;
    aspect-ratio: 16/10; border-radius: 16px; overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 60px var(--accent-glow);
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.hero-visual-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(8,8,13,0.6), rgba(8,8,13,0.3));
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 1.5rem;
}
.hero-timeline-mock {
    height: 50px; background: rgba(20,20,31,0.9);
    border-radius: 8px; border: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 1rem; gap: 0.5rem;
}
.mock-clip { height: 28px; border-radius: 4px; flex-shrink: 0; }
.mock-clip-1 { width: 30%; background: var(--accent); opacity: 0.8; }
.mock-clip-2 { width: 20%; background: var(--success); opacity: 0.7; }
.mock-clip-3 { width: 35%; background: var(--warning); opacity: 0.7; }
.mock-playhead {
    width: 2px; height: 40px; background: #fff;
    position: absolute; left: 55%; top: 8px;
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

/* Stats bar */
.stats-bar {
    display: flex; gap: 3rem; margin-top: 4rem;
    padding-top: 2rem; border-top: 1px solid var(--border);
}
.stat-item .stat-num { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.stat-item .stat-label {
    font-size: 0.8rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
}

/* Features */
.section-label {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 2px; color: var(--accent);
    margin-bottom: 1rem;
}
.section-label::before { content: ''; width: 24px; height: 2px; background: var(--accent); }
.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700; letter-spacing: -1px; margin-bottom: 1rem;
}
.section-desc {
    color: var(--text-secondary); font-size: 1.05rem;
    max-width: 560px; line-height: 1.7;
}

.feature-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; padding: 2rem;
    transition: all 0.35s; position: relative; overflow: hidden;
    height: 100%;
}
.feature-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0; transition: opacity 0.35s;
}
.feature-card:hover {
    border-color: var(--border-light);
    background: var(--card-hover);
    transform: translateY(-4px);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 1.2rem;
}
.feature-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.6rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* How it works */
.step-card { text-align: center; padding: 2rem 1.5rem; position: relative; }
.step-num {
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700; margin: 0 auto 1.2rem;
    border: 2px solid var(--accent); color: var(--accent);
    transition: all 0.3s;
}
.step-card:hover .step-num { background: var(--accent); color: #fff; }
.step-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.step-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* Pricing */
.pricing-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 2.5rem 2rem;
    transition: all 0.35s; position: relative;
}
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 60px var(--accent-glow); }
.pricing-card:hover { transform: translateY(-6px); }
.pricing-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: #fff; font-size: 0.75rem;
    font-weight: 600; padding: 0.3rem 1rem; border-radius: 20px;
    text-transform: uppercase; letter-spacing: 1px;
}
.pricing-name { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }
.pricing-price { font-size: 3rem; font-weight: 700; margin-bottom: 0.3rem; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-period { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }
.pricing-features { list-style: none; padding: 0; margin-bottom: 2rem; }
.pricing-features li {
    padding: 0.4rem 0; font-size: 0.9rem; color: var(--text-secondary);
    display: flex; align-items: center; gap: 0.6rem;
}
.pricing-features li i { color: var(--success); font-size: 0.8rem; }
.pricing-features li.disabled { color: var(--text-muted); text-decoration: line-through; }
.pricing-features li.disabled i { color: var(--text-muted); }

.btn-pricing {
    width: 100%; padding: 0.75rem; border-radius: 10px;
    font-family: inherit; font-weight: 600; font-size: 0.95rem;
    cursor: pointer; transition: all 0.25s; text-align: center;
    text-decoration: none; display: block; border: none;
}
.btn-pricing-primary { background: var(--accent); color: #fff; border: none; }
.btn-pricing-primary:hover { background: var(--accent-light); color: #fff; box-shadow: 0 8px 30px var(--accent-glow); }
.btn-pricing-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-pricing-secondary:hover { border-color: var(--text-muted); background: var(--card-hover); color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 4rem 0 2rem; background: var(--bg-elevated); }
.footer-brand { font-size: 1.3rem; font-weight: 700; }
.footer-brand span { color: var(--accent); }
.footer-links a {
    color: var(--text-muted); text-decoration: none;
    font-size: 0.85rem; display: block; padding: 0.25rem 0;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-muted); font-size: 0.8rem; }

/* ===== MODALS ===== */
.modal-dark .modal-content {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; color: var(--text);
}
.modal-dark .modal-header { border-bottom: 1px solid var(--border); }
.modal-dark .modal-footer { border-top: 1px solid var(--border); }
.modal-dark .btn-close { filter: invert(1) grayscale(1) brightness(0.8); }
.modal-dark .form-control, .modal-dark .form-select {
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text); border-radius: 10px; padding: 0.7rem 1rem;
    font-family: inherit;
}
.modal-dark .form-control:focus, .modal-dark .form-select:focus {
    background: var(--bg-elevated); border-color: var(--accent);
    color: var(--text); box-shadow: 0 0 0 3px var(--accent-glow);
}
.modal-dark .form-control::placeholder { color: var(--text-muted); }
.modal-dark .form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }

/* ===== APP SHELL ===== */
.app-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w); background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 100;
}
.sidebar-brand {
    padding: 1.2rem 1.5rem; display: flex; align-items: center; gap: 0.6rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand .brand-icon {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--accent); display: flex; align-items: center;
    justify-content: center; font-size: 0.9rem; font-weight: 700; color: #fff;
}
.sidebar-brand .brand-text { font-weight: 700; font-size: 1.15rem; }
.sidebar-brand .brand-text span { color: var(--accent); }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-section-label {
    font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-muted); padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}
.sidebar-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.75rem; border-radius: 8px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.88rem; font-weight: 500; transition: all 0.2s;
    cursor: pointer; border: none; background: none; width: 100%;
    font-family: inherit; text-align: left;
}
.sidebar-link:hover { background: var(--card); color: var(--text); }
.sidebar-link.active { background: var(--accent); color: #fff; }
.sidebar-link i { width: 18px; text-align: center; font-size: 0.9rem; }
.sidebar-badge {
    margin-left: auto; font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    background: var(--accent); color: #fff; padding: 0.1rem 0.4rem; border-radius: 4px;
}

.sidebar-user {
    padding: 1rem 1rem; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.75rem;
}
.sidebar-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--border-light); display: flex;
    align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.85rem; color: var(--accent); flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    font-size: 0.85rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-plan { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; background: var(--bg); }

/* Dashboard */
.dash-header {
    padding: 2rem 2.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
}
.dash-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.5px; }
.dash-content { padding: 2rem 2.5rem; }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.project-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden; cursor: pointer;
    transition: all 0.3s; position: relative;
}
.project-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.project-thumb {
    aspect-ratio: 16/9; background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb-placeholder { color: var(--text-muted); font-size: 2rem; }
.project-card-body { padding: 1rem 1.2rem; }
.project-card-name {
    font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-card-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 1rem; }
.project-card-actions {
    position: absolute; top: 0.5rem; right: 0.5rem;
    display: flex; gap: 0.3rem; opacity: 0; transition: opacity 0.2s;
}
.project-card:hover .project-card-actions { opacity: 1; }
.project-action-btn {
    width: 32px; height: 32px; border-radius: 6px;
    background: rgba(0,0,0,0.7); border: none; color: #fff;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 0.8rem; transition: background 0.2s;
}
.project-action-btn:hover { background: var(--accent); }
.project-action-btn.delete:hover { background: var(--danger); }

.new-project-card {
    border: 2px dashed var(--border);
    background: transparent; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 220px; transition: all 0.3s; cursor: pointer;
    border-radius: 14px;
}
.new-project-card:hover { border-color: var(--accent); background: rgba(255,87,51,0.03); }
.new-project-card i { font-size: 2rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.new-project-card span { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }

.empty-state { text-align: center; padding: 5rem 2rem; }
.empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 2rem; }

/* ===== EDITOR ===== */
.editor-topbar {
    height: var(--topbar-h); padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem;
    background: var(--bg-elevated);
}
.editor-topbar .back-btn {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; font-size: 1.1rem; padding: 0.5rem;
    border-radius: 6px; transition: all 0.2s;
}
.editor-topbar .back-btn:hover { color: var(--text); background: var(--card); }

.editor-project-name {
    font-weight: 600; font-size: 1rem;
    background: none; border: 1px solid transparent;
    color: var(--text); padding: 0.3rem 0.5rem; border-radius: 6px;
    font-family: inherit; outline: none;
}
.editor-project-name:hover { border-color: var(--border); }
.editor-project-name:focus { border-color: var(--accent); }

.editor-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.btn-save {
    background: var(--card); border: 1px solid var(--border);
    color: var(--text-secondary); padding: 0.45rem 1rem;
    border-radius: 8px; font-family: inherit; font-weight: 500;
    font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 0.4rem;
}
.btn-save:hover { border-color: var(--text-muted); color: var(--text); }
.btn-ai {
    background: linear-gradient(135deg, #7864ff, var(--accent)); border: none; color: #fff;
    padding: 0.45rem 1rem; border-radius: 8px; font-family: inherit; font-weight: 600;
    font-size: 0.85rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 0.4rem;
}
.btn-ai:hover { filter: brightness(1.1); box-shadow: 0 8px 24px rgba(120,100,255,0.3); }

.btn-export-top {
    background: var(--accent); border: none; color: #fff;
    padding: 0.45rem 1.2rem; border-radius: 8px;
    font-family: inherit; font-weight: 600; font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 0.4rem;
}
.btn-export-top:hover { background: var(--accent-light); }

.editor-body { display: flex; height: calc(100vh - var(--topbar-h) - var(--timeline-h)); }

.editor-left {
    width: 280px; border-right: 1px solid var(--border);
    background: var(--bg-elevated); display: flex; flex-direction: column; flex-shrink: 0;
}
.panel-tabs { display: flex; border-bottom: 1px solid var(--border); }
.panel-tab {
    flex: 1; padding: 0.7rem; text-align: center;
    font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
    background: none; border: none; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
    border-bottom: 2px solid transparent;
}
.panel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.panel-tab:hover { color: var(--text-secondary); }

.panel-content { flex: 1; overflow-y: auto; padding: 1rem; }

.upload-zone {
    border: 2px dashed var(--border); border-radius: 12px;
    padding: 2rem 1rem; text-align: center; cursor: pointer;
    transition: all 0.3s; margin-bottom: 1rem;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: rgba(255,87,51,0.05); }
.upload-zone i { font-size: 1.8rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.upload-zone p { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.3rem; }
.upload-zone .upload-hint { font-size: 0.72rem; color: var(--text-muted); opacity: 0.6; }

.media-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem; border-radius: 8px; cursor: pointer;
    transition: background 0.2s; margin-bottom: 0.4rem;
}
.media-item:hover { background: var(--card); }
.media-item.active { background: var(--card); border: 1px solid var(--accent); }
.media-thumb {
    width: 60px; height: 36px; border-radius: 4px;
    background: var(--bg); flex-shrink: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-info { flex: 1; min-width: 0; }
.media-name {
    font-size: 0.8rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-dur { font-size: 0.7rem; color: var(--text-muted); }

.clip-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem; border-radius: 8px;
    background: var(--card); margin-bottom: 0.4rem;
    border: 1px solid var(--border); transition: all 0.2s; cursor: pointer;
}
.clip-item:hover { border-color: var(--border-light); }
.clip-item.active { border-color: var(--accent); }
.clip-color { width: 4px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.clip-info { flex: 1; min-width: 0; }
.clip-name { font-size: 0.8rem; font-weight: 500; }
.clip-time { font-size: 0.7rem; color: var(--text-muted); }
.clip-delete {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 0.3rem; border-radius: 4px;
    transition: all 0.2s; font-size: 0.75rem;
}
.clip-delete:hover { color: var(--danger); background: rgba(255,68,102,0.1); }

.editor-center {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: #050508; position: relative; overflow: hidden;
}
.video-container {
    position: relative; max-width: 90%; max-height: 90%;
    border-radius: 4px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.video-container video {
    display: block; max-width: 100%; max-height: calc(100vh - var(--topbar-h) - var(--timeline-h) - 60px);
    background: #000;
}
.video-controls {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 1.5rem 1rem 0.8rem; display: flex; align-items: center; gap: 0.75rem;
}
.vc-btn {
    background: none; border: none; color: #fff; cursor: pointer;
    font-size: 1rem; padding: 0.4rem; opacity: 0.8; transition: opacity 0.2s;
}
.vc-btn:hover { opacity: 1; }
.vc-time {
    font-size: 0.75rem; color: rgba(255,255,255,0.7);
    font-variant-numeric: tabular-nums; margin-left: 0.5rem;
}

.no-video-msg { text-align: center; color: var(--text-muted); }
.no-video-msg i { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.3; }
.no-video-msg p { font-size: 0.9rem; }

.editor-right {
    width: 280px; border-left: 1px solid var(--border);
    background: var(--bg-elevated); flex-shrink: 0;
    overflow-y: auto; padding: 1.2rem;
}
.right-section { margin-bottom: 1.5rem; }
.right-section-title {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted); margin-bottom: 0.8rem;
}
.right-field { margin-bottom: 0.8rem; }
.right-field label {
    display: block; font-size: 0.78rem; color: var(--text-secondary);
    margin-bottom: 0.3rem; font-weight: 500;
}
.right-field select, .right-field input[type="number"], .right-field input[type="text"] {
    width: 100%; background: var(--card); border: 1px solid var(--border);
    color: var(--text); padding: 0.5rem 0.7rem; border-radius: 8px;
    font-family: inherit; font-size: 0.85rem;
}
.right-field select:focus, .right-field input:focus { outline: none; border-color: var(--accent); }
.right-field input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Timeline */
.editor-timeline {
    height: var(--timeline-h); border-top: 1px solid var(--border);
    background: var(--bg-elevated); display: flex; flex-direction: column;
}
.timeline-toolbar {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.78rem;
}
.timeline-toolbar .tt-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 0.3rem 0.5rem; border-radius: 4px;
    font-size: 0.8rem; transition: all 0.2s; font-family: inherit;
}
.timeline-toolbar .tt-btn:hover { color: var(--text); background: var(--card); }
.timeline-toolbar .tt-btn.active { color: var(--accent); }
.timeline-toolbar .tt-sep { width: 1px; height: 16px; background: var(--border); margin: 0 0.2rem; }
.timeline-toolbar .tt-time { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.timeline-ruler { height: 24px; position: relative; margin: 0 1rem; border-bottom: 1px solid var(--border); }
.ruler-mark {
    position: absolute; bottom: 0; font-size: 0.6rem; color: var(--text-muted);
    transform: translateX(-50%);
}
.ruler-mark::after {
    content: ''; position: absolute; bottom: -1px; left: 50%;
    width: 1px; height: 6px; background: var(--border);
}

.timeline-tracks {
    flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; padding: 0.5rem 1rem;
}
.timeline-track {
    height: 48px; position: relative; border-radius: 6px;
    background: rgba(20,20,31,0.5); margin-bottom: 0.4rem;
}
.timeline-clip {
    position: absolute; top: 4px; bottom: 4px; border-radius: 4px;
    cursor: pointer; display: flex; align-items: center;
    padding: 0 8px; font-size: 0.7rem; font-weight: 500;
    transition: opacity 0.2s; min-width: 20px; overflow: hidden; white-space: nowrap;
}
.timeline-clip:hover { opacity: 0.9; }
.timeline-clip.active { outline: 2px solid #fff; outline-offset: -1px; }

.trim-handle {
    position: absolute; top: 0; bottom: 0; width: 8px;
    cursor: col-resize; z-index: 5; transition: background 0.2s;
}
.trim-handle:hover, .trim-handle.dragging { background: rgba(255,255,255,0.3); }
.trim-handle-left { left: 0; border-radius: 4px 0 0 4px; }
.trim-handle-right { right: 0; border-radius: 0 4px 4px 0; }

.playhead-line {
    position: absolute; top: 0; bottom: 0; width: 2px;
    background: #fff; z-index: 10; pointer-events: none;
    box-shadow: 0 0 6px rgba(255,255,255,0.4);
}
.playhead-top {
    position: absolute; top: -4px; left: -5px;
    width: 12px; height: 8px; background: #fff;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.export-modal-options { display: flex; flex-direction: column; gap: 1rem; }

/* Toast */
.toast-container {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
}
.kclip-toast {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 0.8rem 1.2rem;
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.85rem; min-width: 280px; max-width: 400px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease-out;
}
.kclip-toast.success { border-left: 3px solid var(--success); }
.kclip-toast.error { border-left: 3px solid var(--danger); }
.kclip-toast.info { border-left: 3px solid var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

.progress-bar-kclip { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 0.5rem; }
.progress-bar-kclip .fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }

/* Responsive */
@media (max-width: 992px) {
    .hero-visual { display: none; }
    .stats-bar { gap: 1.5rem; }
    .editor-left, .editor-right { display: none; }
    .app-sidebar { width: 60px; }
    .app-sidebar .brand-text, .sidebar-section-label,
    .sidebar-link span, .sidebar-user-info, .sidebar-badge { display: none; }
    .sidebar-link { justify-content: center; padding: 0.7rem; }
    .sidebar-link i { width: auto; }
    .app-main { margin-left: 60px; }
}
@media (max-width: 576px) {
    .nav-links { display: none; }
    .hero h1 { letter-spacing: -1px; }
    .stats-bar { flex-wrap: wrap; gap: 1rem; }
    .project-grid { grid-template-columns: 1fr; }
    .dash-header, .dash-content { padding-left: 1.2rem; padding-right: 1.2rem; }
}

/* Animations */
.fade-in { animation: fadeIn 0.6s ease-out both; }
.fade-in-up { animation: fadeInUp 0.6s ease-out both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Storage bar */
.storage-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 0.5rem; }
.storage-bar .fill { height: 100%; border-radius: 2px; transition: width 0.5s; }
.storage-info { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; }

/* Loading spinner */
.spinner-kclip {
    width: 20px; height: 20px; border: 2px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
    position: fixed; inset: 0; background: rgba(8,8,13,0.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; flex-direction: column; gap: 1rem;
}
.loading-overlay .spinner-kclip { width: 40px; height: 40px; border-width: 3px; }

/* ============================================================
   NEW COMPONENTS (v2 upgrade)
   ============================================================ */

/* Generic content views (library, exports, settings) */
.view-content { padding: 2rem 2.5rem; }
.list-table { width: 100%; border-collapse: collapse; }
.list-table th {
    text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border);
}
.list-table td { padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.list-table tr:hover td { background: var(--card); }

.badge {
    display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.55rem;
    border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge.free { background: rgba(152,152,176,0.15); color: var(--text-secondary); }
.badge.pro { background: rgba(255,87,51,0.15); color: var(--accent); }
.badge.team { background: rgba(120,100,255,0.15); color: #7864ff; }
.badge.completed { background: var(--success-glow); color: var(--success); }
.badge.processing { background: rgba(255,176,32,0.15); color: var(--warning); }
.badge.failed { background: rgba(255,68,102,0.15); color: var(--danger); }
.badge.queued { background: rgba(152,152,176,0.15); color: var(--text-secondary); }

/* Settings cards */
.settings-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    padding: 1.5rem; margin-bottom: 1.25rem; max-width: 640px;
}
.settings-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; }
.settings-card .muted { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.settings-card .form-control, .settings-card .form-select {
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
    border-radius: 10px; padding: 0.6rem 0.9rem; font-family: inherit; width: 100%; margin-bottom: 0.8rem;
}
.settings-card label { font-size: 0.8rem; color: var(--text-secondary); display:block; margin-bottom: 0.3rem; }

/* AI panel */
.ai-tool-btn {
    display: flex; align-items: center; gap: 0.6rem; width: 100%;
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
    border-radius: 10px; padding: 0.7rem 0.9rem; cursor: pointer; transition: all 0.2s;
    font-family: inherit; font-size: 0.85rem; text-align: left; margin-bottom: 0.5rem;
}
.ai-tool-btn:hover { border-color: var(--accent); background: var(--card-hover); }
.ai-tool-btn .ai-ico { width: 30px; height: 30px; border-radius: 8px; display:flex; align-items:center; justify-content:center;
    background: linear-gradient(135deg,#7864ff,var(--accent)); color:#fff; flex-shrink:0; }
.ai-tool-btn .pro-tag { margin-left: auto; font-size: 0.6rem; font-weight: 700; color: var(--accent); }
.ai-result {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.2rem; white-space: pre-wrap; font-size: 0.88rem; line-height: 1.7;
    color: var(--text-secondary); max-height: 50vh; overflow-y: auto;
}
.ai-usage { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.6rem; }

/* Pricing toggle in modal */
.plan-switch { display: inline-flex; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 0.2rem; }
.plan-switch button {
    background: none; border: none; color: var(--text-secondary); font-family: inherit;
    padding: 0.4rem 1rem; border-radius: 8px; cursor: pointer; font-size: 0.82rem; font-weight: 600;
}
.plan-switch button.active { background: var(--accent); color: #fff; }
