@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   LIGHT THEME (DEFAULT) – YouTube Red & White – PREMIUM
   ============================================================ */
:root, [data-theme="light"] {
    --bg-base: #F0F2F5;
    --bg-surface: rgba(255, 255, 255, 0.88);
    --bg-surface-solid: #FFFFFF;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-sidebar: linear-gradient(180deg, #FFFFFF 0%, #FFF5F5 100%);
    --bg-sidebar-solid: #FFFFFF;

    --border: rgba(0, 0, 0, 0.06);
    --border-bright: rgba(0, 0, 0, 0.12);

    --text: #1A1A1A;
    --text-muted: #6B7280;
    --text-on-primary: #FFFFFF;

    --primary: #FF0000;
    --primary-hover: #E60000;
    --primary-glow: rgba(255, 0, 0, 0.12);
    --primary-soft: rgba(255, 0, 0, 0.04);
    --primary-medium: rgba(255, 0, 0, 0.08);

    --accent: #FF6B35;
    --accent-glow: rgba(255, 107, 53, 0.12);

    --grad-primary: linear-gradient(135deg, #FF0000 0%, #FF4444 50%, #FF6B35 100%);
    --grad-hero: linear-gradient(135deg, #FF0000 0%, #FF2D2D 40%, #FF6B35 100%);
    --grad-glass: linear-gradient(135deg, rgba(255,0,0,0.02) 0%, rgba(255,107,53,0.02) 100%);
    --grad-shine: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 28px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 20px rgba(255,0,0,0.08);

    --input-bg: rgba(0, 0, 0, 0.025);
    --input-bg-focus: #FFFFFF;
    --input-border: rgba(0, 0, 0, 0.08);
    --lock-bg: rgba(255, 255, 255, 0.96);
    --sidebar-active-bg: rgba(255, 0, 0, 0.06);

    --t-fast: 0.15s ease;
    --t-normal: 0.25s ease;
    --t-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    --r-xl: 18px;
    --r-lg: 14px;
    --r-md: 10px;
    --r-sm: 7px;
    --r-full: 9999px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
    --bg-base: #0A0A0A;
    --bg-surface: rgba(22, 22, 22, 0.92);
    --bg-surface-solid: #161616;
    --bg-card: rgba(255, 255, 255, 0.035);
    --bg-card-hover: rgba(255, 255, 255, 0.065);
    --bg-sidebar: linear-gradient(180deg, #111111 0%, #0D0000 100%);
    --bg-sidebar-solid: #111111;

    --border: rgba(255, 255, 255, 0.06);
    --border-bright: rgba(255, 255, 255, 0.12);

    --text: #E8E8E8;
    --text-muted: #808080;
    --text-on-primary: #FFFFFF;

    --primary: #FF3333;
    --primary-hover: #FF1A1A;
    --primary-glow: rgba(255, 51, 51, 0.18);
    --primary-soft: rgba(255, 51, 51, 0.06);
    --primary-medium: rgba(255, 51, 51, 0.1);

    --accent: #FF8855;
    --accent-glow: rgba(255, 136, 85, 0.15);

    --grad-primary: linear-gradient(135deg, #FF1A1A 0%, #FF4444 50%, #FF8855 100%);
    --grad-hero: linear-gradient(135deg, #FF1A1A 0%, #FF3333 40%, #FF8855 100%);
    --grad-glass: linear-gradient(135deg, rgba(255,51,51,0.03) 0%, rgba(255,136,85,0.02) 100%);
    --grad-shine: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 28px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(255,51,51,0.1);

    --input-bg: rgba(255, 255, 255, 0.04);
    --input-bg-focus: rgba(255, 255, 255, 0.07);
    --input-border: rgba(255, 255, 255, 0.07);
    --lock-bg: rgba(10, 10, 10, 0.97);
    --sidebar-active-bg: rgba(255, 51, 51, 0.08);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg-base);
    color: var(--text);
    font-family: var(--font);
    height: 100vh;
    overflow: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* Animated background mesh */
body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 85% 5%, var(--primary-glow) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 10% 90%, var(--accent-glow) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 50% 50%, var(--primary-soft) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: bg-breathe 12s ease-in-out infinite alternate;
}
@keyframes bg-breathe {
    0%   { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dashboard {
    display: grid;
    grid-template-columns: 230px 1fr 310px;
    grid-template-rows: auto 1fr;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── TOP BAR ── */
.top-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: var(--bg-surface-solid);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 20;
    transition: background 0.4s ease;
    position: relative;
}
.top-bar::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 2px;
    background: var(--grad-primary);
    opacity: 0.3;
}

.top-bar-left { display: flex; align-items: center; gap: 12px; }

.logo-mark {
    width: 38px; height: 38px;
    background: var(--grad-hero);
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
    animation: logo-pulse 3s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes logo-pulse {
    0%, 100% { box-shadow: 0 4px 14px var(--primary-glow); }
    50%      { box-shadow: 0 4px 24px var(--primary-glow), 0 0 8px var(--primary-glow); }
}

.top-bar h1 {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -0.3px;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.top-bar .subtitle {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.top-bar-center { display: flex; gap: 10px; align-items: center; }

.stat-pill {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.7rem; font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 5px 14px;
    border-radius: var(--r-full);
    backdrop-filter: blur(8px);
    transition: all var(--t-fast);
}
.stat-pill:hover {
    border-color: var(--primary-glow);
    background: var(--primary-soft);
    transform: translateY(-1px);
}
.stat-pill .stat-num {
    font-weight: 900; font-size: 0.82rem;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-bar-right { display: flex; align-items: center; gap: 10px; }

.brand-tag {
    font-size: 0.6rem; font-weight: 800;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border: 1px solid var(--primary-glow);
    padding: 5px 12px;
    border-radius: var(--r-full);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
}
.brand-tag::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 50%; height: 100%;
    background: var(--grad-shine);
    animation: tag-shine 4s ease-in-out infinite;
}
@keyframes tag-shine {
    0% { left: -100%; }
    50%, 100% { left: 200%; }
}

.theme-btn {
    width: 38px; height: 38px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    transition: all var(--t-fast);
    backdrop-filter: blur(8px);
}
.theme-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 16px var(--primary-glow);
}
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }
[data-theme="light"] .icon-sun, :root .icon-sun { display: inline; }
[data-theme="light"] .icon-moon, :root .icon-moon { display: none; }

/* ── SIDEBAR ── */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    overflow-y: auto;
    transition: background 0.4s ease;
    position: relative;
}

.sidebar-label {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 10px 20px 6px;
    margin-top: 4px;
}
.sidebar-label:first-child { margin-top: 0; }

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    margin: 2px 10px;
    border-radius: var(--r-md);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--t-fast);
    text-align: left;
    width: calc(100% - 20px);
    position: relative;
    overflow: hidden;
}
.nav-btn::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    background: var(--grad-primary);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    transition: width 0.25s ease;
}
.nav-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    transform: translateX(2px);
}
.nav-btn.active {
    background: var(--sidebar-active-bg);
    color: var(--primary);
    font-weight: 700;
}
.nav-btn.active::before {
    width: 3px;
}
.nav-btn .nav-icon { font-size: 1.05rem; width: 24px; text-align: center; flex-shrink: 0; }
.nav-btn .lock-badge { margin-left: auto; font-size: 0.6rem; opacity: 0.4; }

.sidebar-divider { height: 1px; background: var(--border); margin: 12px 20px; }

/* ── MAIN AREA ── */
.main-area {
    overflow: hidden;
    padding: 20px 24px;
    background: transparent;
    position: relative;
    height: 100%;
}

.tab-content { display: none; animation: tabIn 0.3s ease; height: 100%; width: 100%; }
.tab-content.active { display: flex; flex-direction: column; }
@keyframes tabIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── TAB GRID & COLUMNS ── */
.tab-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

.workspace-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    min-height: 0;
}

.settings-col {
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    min-height: 0;
}
.settings-col::-webkit-scrollbar { width: 5px; }
.settings-col::-webkit-scrollbar-track { background: transparent; }
.settings-col::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 99px; }

/* Textarea Card Autofit */
.textarea-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.textarea-card .form-group {
    flex: 1;
    min-height: 0;
}
.textarea-card textarea {
    flex: 1;
    height: 100%;
    resize: none;
    min-height: 120px;
}

/* Dropzone Card Autofit */
.dropzone-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.dropzone-card .dropzone {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding: 24px 16px;
}
.file-queue {
    max-height: 140px;
    overflow-y: auto;
}

/* ── LIBRARY PANEL ── */
.library-panel {
    background: var(--bg-surface-solid);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.4s ease;
}
.library-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.library-header h2 {
    font-size: 0.82rem; font-weight: 800; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}
.library-actions { display: flex; gap: 4px; }

.lib-action-btn {
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-muted); font-family: var(--font);
    font-size: 0.62rem; font-weight: 700;
    padding: 5px 10px; border-radius: var(--r-sm);
    cursor: pointer; transition: all var(--t-fast);
}
.lib-action-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.lib-action-btn.danger:hover { color: #D32F2F; border-color: #D32F2F; background: rgba(211,47,47,0.04); }

.library-search {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.library-search input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    font-family: var(--font); font-size: 0.78rem; color: var(--text);
    transition: all var(--t-fast);
}
.library-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.library-search input::placeholder { color: var(--text-muted); opacity: 0.5; }

.library-list { flex: 1; overflow-y: auto; padding: 8px 10px; }
.library-list::-webkit-scrollbar { width: 4px; }
.library-list::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 99px; }

.empty-library {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 50px 16px; text-align: center; gap: 10px;
    color: var(--text-muted); font-size: 0.78rem;
}
.library-empty-art { font-size: 2.4rem; opacity: 0.12; }

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 12px;
    margin-bottom: 6px;
    display: flex; justify-content: space-between; align-items: center;
    transition: all 0.2s ease;
}
.video-card:hover {
    border-color: var(--border-bright);
    background: var(--bg-card-hover);
    transform: translateX(-2px);
    box-shadow: var(--shadow-md);
}
.video-card-info { min-width: 0; flex: 1; }
.video-card-title {
    font-size: 0.72rem; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.video-card-meta { font-size: 0.6rem; color: var(--text-muted); }
.video-card-actions { display: flex; gap: 3px; flex-shrink: 0; margin-left: 6px; }

.v-action {
    width: 28px; height: 28px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t-fast);
}
.v-action:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); transform: scale(1.1); }
.v-action.hf:hover { color: #FF9D00; border-color: #FF9D00; background: rgba(255,157,0,0.05); }

/* ============================================================
   SECTION CARDS — PREMIUM GLASS
   ============================================================ */
.section-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
    margin-bottom: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.section-card::before {
    content: '';
    position: absolute; inset: 0;
    background: var(--grad-glass);
    pointer-events: none;
    border-radius: var(--r-lg);
}
.section-card:hover {
    border-color: var(--border-bright);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.section-card h3 {
    font-size: 0.85rem; font-weight: 800; color: var(--text);
    margin-bottom: 4px;
    display: flex; align-items: center; gap: 8px;
    position: relative; z-index: 1;
}
.section-card h3::before {
    content: '';
    width: 3px; height: 14px;
    background: var(--grad-primary);
    border-radius: 2px;
    flex-shrink: 0;
}
.section-desc {
    font-size: 0.72rem; color: var(--text-muted);
    margin-bottom: 12px; position: relative; z-index: 1;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; position: relative; z-index: 1; }
.form-group label {
    font-size: 0.68rem; font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.3px; text-transform: uppercase;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

input[type="text"], input[type="number"], select, textarea {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    transition: all var(--t-fast);
    width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-glow);
    background: var(--input-bg-focus);
}
input[type="text"]::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.45; }
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }
select option { background: var(--bg-surface-solid); color: var(--text); }

input[type="file"] {
    background: var(--input-bg);
    border: 1.5px dashed var(--border-bright);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    font-family: var(--font); color: var(--text-muted); font-size: 0.78rem;
    cursor: pointer; transition: border-color var(--t-fast); width: 100%;
}
input[type="file"]:hover { border-color: var(--primary); }
.help-text { font-size: 0.62rem; color: var(--text-muted); }

/* ============================================================
   TOGGLE GROUP
   ============================================================ */
.toggle-group {
    display: flex; gap: 2px;
    background: var(--input-bg); padding: 3px;
    border-radius: var(--r-sm);
    margin-bottom: 12px;
    border: 1px solid var(--border);
    position: relative; z-index: 1;
}
.toggle-btn {
    flex: 1; background: transparent; border: none;
    color: var(--text-muted); font-family: var(--font);
    font-size: 0.72rem; font-weight: 700;
    padding: 7px 4px; border-radius: 5px;
    cursor: pointer; transition: all var(--t-fast);
}
.toggle-btn.active {
    background: var(--bg-surface-solid);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.toggle-btn:hover:not(.active) { color: var(--text); }

.sub-panel { display: none; position: relative; z-index: 1; }
.sub-panel.active { display: block; animation: tabIn 0.2s ease; }

/* ============================================================
   DROPZONE
   ============================================================ */
.dropzone {
    border: 2px dashed var(--border-bright);
    background: var(--primary-soft);
    padding: 22px 16px;
    text-align: center;
    border-radius: var(--r-md);
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: all var(--t-normal);
    position: relative; z-index: 1;
}
.dropzone:hover, .dropzone.drag-over {
    border-color: var(--primary);
    background: var(--primary-medium);
    box-shadow: 0 0 24px var(--primary-glow), inset 0 0 12px var(--primary-soft);
}
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-icon {
    width: 28px; height: 28px; color: var(--text-muted);
    transition: all 0.3s ease;
}
.dropzone:hover .dropzone-icon { color: var(--primary); transform: translateY(-3px) scale(1.15); }
.dropzone span { font-size: 0.78rem; color: var(--text-muted); }
.dropzone strong { color: var(--primary); }

.file-queue { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.file-item {
    display: flex; justify-content: space-between;
    padding: 6px 10px;
    background: var(--primary-soft); border: 1px solid rgba(255,0,0,0.06);
    border-radius: var(--r-sm); font-size: 0.72rem;
    animation: tabIn 0.2s ease;
}
.file-count-pill {
    background: var(--primary-soft); color: var(--primary);
    border-radius: var(--r-full); padding: 2px 8px;
    font-size: 0.62rem; font-weight: 700; margin-left: 6px;
}

/* ============================================================
   RATIO CARDS
   ============================================================ */
.ratio-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; z-index: 1; }
.ratio-3col { grid-template-columns: repeat(3,1fr) !important; }

.ratio-card {
    border: 1.5px solid var(--border); background: var(--bg-card);
    border-radius: var(--r-md); padding: 12px 8px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; transition: all var(--t-bounce); position: relative;
}
.ratio-card:hover { border-color: var(--border-bright); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ratio-card:has(input:checked), .ratio-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 16px var(--primary-glow);
}
.ratio-card input[type="radio"] { position: absolute; top: 6px; right: 6px; accent-color: var(--primary); width: 12px; height: 12px; }

.ratio-box { background: var(--input-bg); border: 2px solid var(--border-bright); border-radius: 3px; transition: all 0.2s ease; }
.vertical-box   { width: 22px; height: 38px; }
.horizontal-box { width: 38px; height: 22px; }
.ratio-card:has(input:checked) .ratio-box, .ratio-card.selected .ratio-box {
    border-color: var(--primary); background: var(--primary-glow);
    box-shadow: 0 0 8px var(--primary-glow);
}
.ratio-label { text-align: center; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.ratio-card:has(input:checked) .ratio-label, .ratio-card.selected .ratio-label { color: var(--text); font-weight: 700; }
.ratio-label small { display: block; font-size: 0.58rem; font-weight: 400; opacity: 0.65; }
.small-card { padding: 10px 6px; }
.small-card .ratio-label { font-size: 0.68rem; }

/* ============================================================
   CHECKBOXES
   ============================================================ */
.checkbox-container {
    display: block; position: relative; padding-left: 26px;
    margin-bottom: 8px; cursor: pointer;
    font-size: 0.78rem; user-select: none; color: var(--text);
}
.checkbox-container input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark {
    position: absolute; top: 1px; left: 0;
    height: 16px; width: 16px;
    background: var(--input-bg); border: 1.5px solid var(--border-bright);
    border-radius: 4px; transition: all var(--t-fast);
}
.checkbox-container:hover .checkmark { border-color: var(--primary); }
.checkbox-container input:checked ~ .checkmark {
    background: var(--primary); border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}
.checkmark::after {
    content: ''; position: absolute; display: none;
    left: 4px; top: 1px; width: 5px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark::after { display: block; }
.filters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.checkbox-group { margin-top: 8px; }

/* ============================================================
   SLIDERS
   ============================================================ */
.sliders-row { margin-top: 8px; }
.slider-group label { display: flex; align-items: center; gap: 4px; }
.slider-val { font-weight: 700; color: var(--primary); font-size: 0.65rem; }

.style-slider {
    -webkit-appearance: none; width: 100%;
    height: 4px; background: var(--border);
    border-radius: var(--r-full); outline: none; cursor: pointer; margin-top: 4px;
}
.style-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    background: var(--grad-primary);
    border-radius: 50%; cursor: pointer;
    box-shadow: 0 0 8px var(--primary-glow);
    transition: transform 0.15s ease;
}
.style-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }
.slider-marks { display: flex; justify-content: space-between; font-size: 0.58rem; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   MOOD / AGE CHIPS
   ============================================================ */
.mood-grid, .age-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.mood-chip, .age-chip {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-full); padding: 5px 12px;
    font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
    cursor: pointer; transition: all var(--t-fast); user-select: none;
}
.mood-chip:hover:not(.disabled), .age-chip:hover {
    border-color: var(--primary); color: var(--primary); background: var(--primary-soft);
    transform: translateY(-1px);
}
.mood-chip.active, .age-chip.active {
    background: var(--grad-primary); color: #fff; border-color: transparent;
    box-shadow: 0 2px 10px var(--primary-glow);
    transform: translateY(-1px);
}
.mood-chip.disabled { opacity: 0.3; cursor: not-allowed; }
.age-chip { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 12px; border-radius: var(--r-md); }
.age-desc { font-size: 0.55rem; font-weight: 400; opacity: 0.6; }
.mood-support-tag { font-size: 0.58rem; font-weight: 600; }
.mood-support-tag.supported { color: #34A853; }
.mood-support-tag.unsupported { color: var(--text-muted); }

/* ============================================================
   VOICE PICKER
   ============================================================ */
.voice-picker-wrap { display: flex; gap: 6px; align-items: stretch; }
.voice-picker-wrap select { flex: 1; }
.preview-voice-btn {
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--primary); font-family: var(--font);
    font-size: 0.7rem; font-weight: 700;
    padding: 6px 12px; border-radius: var(--r-sm);
    cursor: pointer; transition: all var(--t-fast); white-space: nowrap;
}
.preview-voice-btn:hover { background: var(--primary-soft); border-color: var(--primary); transform: scale(1.05); }
.preview-voice-btn.loading { opacity: 0.4; pointer-events: none; }
.voice-preview-player { margin-top: 6px; }
.preview-label { font-size: 0.62rem; color: var(--text-muted); display: block; margin-top: 3px; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-wrap {
    display: none; flex-direction: column; gap: 6px;
    margin-top: 12px; padding: 12px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.progress-wrap.visible { display: flex; }
.progress-header { display: flex; justify-content: space-between; align-items: center; }
.progress-status {
    font-size: 0.72rem; font-weight: 700; color: var(--primary);
    display: flex; align-items: center; gap: 5px;
}
.pulse-dot {
    width: 6px; height: 6px;
    background: var(--primary); border-radius: 50%;
    box-shadow: 0 0 6px var(--primary);
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
.progress-pct { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.progress-track { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill {
    height: 100%; width: 0%;
    background: var(--grad-primary);
    border-radius: 99px; transition: width 0.4s ease;
    box-shadow: 0 0 8px var(--primary-glow);
}
.progress-step { font-size: 0.62rem; color: var(--text-muted); }

/* ============================================================
   SUBMIT BUTTON — PREMIUM
   ============================================================ */
.submit-btn {
    width: 100%; padding: 12px 16px;
    background: var(--grad-primary);
    color: #fff; border: none;
    border-radius: var(--r-md);
    font-family: var(--font); font-size: 0.9rem; font-weight: 800;
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 10px;
    box-shadow: 0 6px 20px var(--primary-glow);
    position: relative; overflow: hidden;
    letter-spacing: 0.2px;
}
.submit-btn::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.8s ease;
}
.submit-btn:hover::before { left: 200%; }
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--primary-glow); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled, .submit-btn.loading { opacity: 0.5; pointer-events: none; }
.btn-loader { display: none; }
.submit-btn.loading .btn-loader {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: spin 0.5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LOCK OVERLAY
   ============================================================ */
.lock-overlay {
    position: absolute; inset: 0;
    background: var(--lock-bg);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 50;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; border-radius: var(--r-lg);
    text-align: center; padding: 30px;
}
.lock-overlay .lock-icon { font-size: 2.8rem; opacity: 0.5; animation: lock-bob 2.5s ease-in-out infinite; }
@keyframes lock-bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-3deg); } }
.lock-overlay h3 { font-size: 1rem; font-weight: 800; color: var(--text); }
.lock-overlay p { font-size: 0.78rem; color: var(--text-muted); max-width: 300px; line-height: 1.5; }
.follow-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #1877F2, #0D5FBF); color: #fff;
    border: none; padding: 11px 24px;
    border-radius: var(--r-full);
    font-family: var(--font); font-size: 0.82rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(24,119,242,0.3);
}
.follow-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(24,119,242,0.4); }
.unlock-note { font-size: 0.6rem; color: var(--text-muted); }

/* ============================================================
   SOURCE TOGGLE / URL / BADGE / INLINE
   ============================================================ */
.source-toggle {
    display: flex; gap: 2px; background: var(--input-bg); padding: 3px;
    border-radius: var(--r-sm); margin-bottom: 10px; border: 1px solid var(--border);
    position: relative; z-index: 1;
}
.source-toggle-btn {
    flex: 1; background: transparent; border: none;
    color: var(--text-muted); font-family: var(--font);
    font-size: 0.72rem; font-weight: 700;
    padding: 6px 8px; border-radius: 4px;
    cursor: pointer; transition: all var(--t-fast);
}
.source-toggle-btn.active { background: var(--bg-surface-solid); color: var(--text); box-shadow: var(--shadow-sm); }

.url-input-wrap { position: relative; }
.url-input-wrap input { padding-left: 36px; }
.url-input-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.badge {
    display: inline-flex; align-items: center; gap: 3px;
    background: var(--primary-soft); border: 1px solid var(--primary-glow);
    color: var(--primary); font-size: 0.6rem; font-weight: 700;
    padding: 3px 8px; border-radius: var(--r-full);
}
.inline-group { display: flex; align-items: center; gap: 8px; }
.number-input { display: flex; align-items: center; gap: 6px; }
.number-input input { width: 70px; text-align: center; }
.number-input span { font-size: 0.72rem; color: var(--text-muted); }
.optional-group { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }

/* ============================================================
   MODAL / TOAST
   ============================================================ */
.modal {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); cursor: pointer; }
.modal-content {
    position: relative; z-index: 1;
    background: var(--bg-surface-solid); border: 1px solid var(--border);
    border-radius: var(--r-xl);
    max-width: 780px; width: 90%; max-height: 85vh; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.close-btn {
    background: transparent; border: none;
    color: var(--text-muted); font-size: 1.4rem;
    cursor: pointer; line-height: 1; transition: color var(--t-fast);
}
.close-btn:hover { color: var(--primary); }
.modal-body { padding: 16px; }
.modal-body video { width: 100%; border-radius: var(--r-md); background: #000; }

.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-surface-solid);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 22px;
    border-radius: var(--r-full);
    font-family: var(--font); font-size: 0.8rem; font-weight: 600;
    z-index: 2000;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #D32F2F; color: #fff; border-color: #D32F2F; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) { .dashboard { grid-template-columns: 190px 1fr 280px; } }
@media (max-width: 900px) {
    .dashboard { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto; height: auto; min-height: 100vh; }
    body { overflow: auto; }
    body::before { display: none; }
    .sidebar { flex-direction: row; border-right: none; border-bottom: 1px solid var(--border); padding: 6px; overflow-x: auto; background: var(--bg-surface-solid); }
    .sidebar-label, .sidebar-divider { display: none; }
    .nav-btn { white-space: nowrap; margin: 0 2px; padding: 8px 12px; }
    .nav-btn::before { display: none; }
    .library-panel { border-left: none; border-top: 1px solid var(--border); max-height: 300px; }
    .stat-pill { display: none; }
}
@media (max-width: 600px) {
    .top-bar h1 { font-size: 0.85rem; }
    .brand-tag { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .filters-grid { grid-template-columns: 1fr; }
}
