/* ═══════════════════════════════════════════════════════════════════════════
   QuoteVid Pro — Design System
   Premium dark theme with glassmorphism
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
    /* ── Backgrounds ──────────────────────────────── */
    --bg-primary:    #09090b;
    --bg-secondary:  #0f0f13;
    --bg-card:       rgba(17, 17, 24, 0.85);
    --bg-hover:      rgba(255, 255, 255, 0.04);
    --bg-input:      rgba(255, 255, 255, 0.05);
    --bg-elevated:   #18181f;

    /* ── Borders ──────────────────────────────────── */
    --border:        rgba(255, 255, 255, 0.07);
    --border-hover:  rgba(255, 255, 255, 0.12);
    --border-focus:  rgba(139, 92, 246, 0.4);

    /* ── Text ─────────────────────────────────────── */
    --text-primary:   #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted:     #52525b;

    /* ── Accent ───────────────────────────────────── */
    --accent:        #8b5cf6;
    --accent-hover:  #7c3aed;
    --accent-subtle: rgba(139, 92, 246, 0.12);
    --accent-glow:   rgba(139, 92, 246, 0.2);

    /* ── Semantic ─────────────────────────────────── */
    --success:       #22c55e;
    --success-hover: #16a34a;
    --warning:       #eab308;
    --danger:        #ef4444;
    --info:          #3b82f6;

    /* ── Radii ────────────────────────────────────── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* ── Shadows ──────────────────────────────────── */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);

    /* ── Motion ───────────────────────────────────── */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Typography ───────────────────────────────── */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* ── Layout ───────────────────────────────────── */
    --sidebar-width: 340px;
    --topbar-height: 56px;

    /* ── Spacing ──────────────────────────────────── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Glass Card ───────────────────────────────────────────────────────────── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        var(--bg-primary);
}

.auth-container { width: 100%; max-width: 420px; padding: 20px; }

.auth-card { padding: 40px 32px; }

.auth-header { text-align: center; margin-bottom: 32px; }

.logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; }

.logo-icon {
    font-size: 28px;
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-text { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }

.auth-subtitle { color: var(--text-secondary); font-size: 0.95rem; }

.auth-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; }

.auth-error {
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
}

.auth-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
.select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

input:focus, .select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder { color: var(--text-muted); }

select.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Slider */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    outline: none;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 16px var(--accent-glow);
}

/* Color Picker */
.color-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-picker {
    width: 40px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    padding: 2px;
}

.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border: none; border-radius: 4px; }

.color-hex {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
}

/* Switch */
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.switch-label input { display: none; }

.switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
    flex-shrink: 0;
}

.switch-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: var(--transition);
}

.switch-label input:checked + .switch-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.switch-label input:checked + .switch-slider::after {
    transform: translateX(20px);
    background: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    border: none;
}

.btn-accent:hover {
    box-shadow: var(--shadow-glow);
    filter: brightness(1.1);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover { background: var(--success-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; font-weight: 600; }

.btn-group {
    display: flex;
    gap: 0;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.btn-group-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.btn-toggle {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-toggle.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-toggle:hover:not(.active) { background: var(--bg-hover); }

/* ═══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.user-greeting {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 8px 8px 0;
}

.sidebar-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.sidebar-tab .tab-icon { font-size: 1.1rem; }

.sidebar-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.sidebar-tab:hover:not(.active) { color: var(--text-secondary); }

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tab-content.active { display: block; }

.tab-content::-webkit-scrollbar { width: 4px; }
.tab-content::-webkit-scrollbar-track { background: transparent; }
.tab-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
.panel-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.panel-section .form-group { margin-top: 12px; }

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ── Upload Zone ──────────────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--text-secondary);
}

.upload-zone p { margin-bottom: 8px; font-size: 0.85rem; }

/* ── Quotes List & Cards ────────────────────────────────────────────────── */
.quotes-list {
    max-height: 480px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.story-scene-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.story-scene-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}

.story-scene-card.active {
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.06);
    box-shadow: var(--shadow-glow);
}

.scene-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-badge {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.85rem;
}

.scene-textarea {
    width: 100%;
    font-size: 0.85rem;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

.scene-textarea:focus {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.08);
}

.author-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scene-author-input {
    flex-grow: 1;
    font-size: 0.8rem;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.scene-author-input:focus {
    border-color: var(--border-focus);
}

.scene-media-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.scene-thumb-wrapper {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.scene-thumb-wrapper:hover {
    border-color: var(--border-hover);
}

.scene-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-search-input {
    flex-grow: 1;
    font-size: 0.75rem;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.scene-search-input:focus {
    border-color: var(--border-focus);
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 20px 0;
}


/* ── Section Header with Actions ──────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 0.7rem;
}

.selection-info {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 8px;
    padding: 4px 0;
}

/* ── Quote Item with Checkbox ─────────────────────────────────────────── */
.quote-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.quote-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1.5px solid var(--border);
    border-radius: 3px;
    background: var(--bg-input);
    cursor: pointer;
    margin-top: 2px;
    transition: var(--transition);
}

.quote-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.quote-checkbox:checked::after {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    line-height: 16px;
    width: 100%;
    height: 100%;
}

.quote-text-content {
    flex: 1;
    min-width: 0;
}

/* ── Preset Grid ──────────────────────────────────────────────────────────── */
.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.preset-card {
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.preset-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0.2;
    z-index: 0;
}

.preset-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.preset-card.active {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.preset-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.preset-category {
    font-size: 0.65rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(139, 92, 246, 0.04) 0%, transparent 60%),
        var(--bg-primary);
}

/* ── Preview ──────────────────────────────────────────────────────────────── */
.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.preview-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.preview-wrapper.ratio-9-16 { width: 270px; height: 480px; }
.preview-wrapper.ratio-1-1 { width: 400px; height: 400px; }
.preview-wrapper.ratio-16-9 { width: 480px; height: 270px; }

#previewCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.preview-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Action Bar ───────────────────────────────────────────────────────────── */
.action-bar {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-section { width: 100%; }

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 6px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.action-buttons .btn { min-width: 180px; }

/* ═══════════════════════════════════════════════════════════════════════════
   CUSTOM SELECT DROPDOWN — Fully CSS-Styled Dark Theme
   Replaces native <select> which can't style <option> popups in Chromium.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Keep native selects styled for any remaining instances (gradient dir, FPS) */
select.select {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

select.select option {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    padding: 10px 14px;
}

select.select option:hover,
select.select option:checked {
    background-color: var(--accent);
    color: white;
}

select.select::-ms-expand { display: none; }

/* ── Custom Select Container ─────────────────────────────────────────────── */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-select-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Dropdown Options Panel ──────────────────────────────────────────────── */
.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 200;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    animation: dropdownSlide 0.15s ease;
}

.custom-select.open .custom-select-options {
    display: block;
}

@keyframes dropdownSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.custom-select-options::-webkit-scrollbar { width: 4px; }
.custom-select-options::-webkit-scrollbar-track { background: transparent; }
.custom-select-options::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ── Individual Option ───────────────────────────────────────────────────── */
.custom-select-option {
    padding: 9px 12px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-option:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
}

.custom-select-option.active {
    background: var(--accent);
    color: white;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESOLUTION GRID
   ═══════════════════════════════════════════════════════════════════════════ */

.resolution-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.resolution-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    color: var(--text-secondary);
}

.resolution-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.resolution-card.active {
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

.resolution-label {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.resolution-card.active .resolution-label {
    color: var(--accent);
}

.resolution-detail {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.7;
}

.resolution-hint {
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

.mobile-view-toggle {
    display: none;
}

@media (max-width: 768px) {
    .mobile-view-toggle {
        display: flex;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 8px 16px;
        gap: 8px;
        z-index: 10;
    }
    
    .mobile-toggle-btn {
        flex: 1;
        padding: 8px 12px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        color: var(--text-secondary);
        font-size: 0.82rem;
        font-weight: 500;
        cursor: pointer;
        transition: var(--transition);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    
    .mobile-toggle-btn.active {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
        box-shadow: var(--shadow-sm);
    }

    .app-layout {
        flex-direction: column;
        height: calc(100vh - 108px);
        overflow: hidden;
        position: relative;
    }

    /* By default on mobile, show editor and hide preview pane */
    .sidebar {
        width: 100%;
        height: 100%;
        max-height: none;
        border-right: none;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .main-content {
        display: none;
        padding: 16px;
        height: 100%;
        width: 100%;
        flex-direction: column;
        justify-content: space-between;
        overflow-y: auto;
    }

    /* When preview tab is active on mobile */
    .app-layout.view-preview .sidebar {
        display: none;
    }

    .app-layout.view-preview .main-content {
        display: flex;
    }

    .preview-wrapper.ratio-9-16 { width: 200px; height: 355px; }
    .preview-wrapper.ratio-1-1 { width: 280px; height: 280px; }
    .preview-wrapper.ratio-16-9 { width: 320px; height: 180px; }

    .action-bar {
        width: 100%;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    .action-buttons .btn { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-section { animation: fadeIn 0.3s ease both; }
.panel-section:nth-child(2) { animation-delay: 0.05s; }
.panel-section:nth-child(3) { animation-delay: 0.1s; }
.panel-section:nth-child(4) { animation-delay: 0.15s; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.btn-loader { animation: pulse 1.5s ease infinite; }

/* ═══════════════════════════════════════════════════════════════════════════
   CREDITS DISPLAY — Topbar
   ═══════════════════════════════════════════════════════════════════════════ */

.credits-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    transition: var(--transition);
}

.credits-display:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.35);
}

.credits-icon { font-size: 1rem; }
.credits-count { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.credits-label { color: var(--text-secondary); font-size: 0.78rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRICING MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.pricing-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pricing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pricing-dialog {
    position: relative;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pricing-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.pricing-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-subtitle {
    color: var(--text-secondary);
    margin-top: 6px;
    font-size: 0.95rem;
}

.pricing-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pricing-close:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* ── Pricing Grid ────────────────────────────────────────────────────────── */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.pricing-card {
    position: relative;
    padding: 24px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.pricing-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pricing-card.popular {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-secondary) 100%);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.12);
}

.pricing-card.current {
    opacity: 0.65;
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 14px;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: var(--radius-xl);
    white-space: nowrap;
}

.pricing-card-header {
    text-align: center;
    margin-bottom: 20px;
}

.plan-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.price-period {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    flex: 1;
}

.plan-features li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-check {
    color: var(--success);
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.plan-cta {
    margin-top: auto;
}

.pricing-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: var(--bg-elevated); }
.toast-info { background: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   PRICING MODAL — RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .pricing-dialog {
        padding: 24px 16px;
    }

    .credits-display {
        padding: 4px 10px;
        font-size: 0.78rem;
    }

    .credits-label { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   STOCK MEDIA SEARCH & GRID
   ═══════════════════════════════════════════════════════════════════════════ */

.search-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.search-input-group input[type="text"] {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.88rem;
    transition: var(--transition);
}

.search-input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.stock-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding: 2px;
}

.stock-media-item {
    position: relative;
    aspect-ratio: 9/16;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    background: #000;
    transition: var(--transition);
}

.stock-media-item:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: scale(1.03);
}

.stock-media-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.stock-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stock-media-item .video-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 2px;
    text-transform: uppercase;
}

.stock-media-grid::-webkit-scrollbar {
    width: 4px;
}

.stock-media-grid::-webkit-scrollbar-track {
    background: transparent;
}

.stock-media-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ICON UTILITIES — Lucide replaces <i> with <svg class="lucide">
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base icon sizing */
svg.lucide { flex-shrink: 0; }

.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 20px; height: 20px; }

/* Section title icons — flex alignment */
.section-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.section-title svg.lucide { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }

/* Tab icons */
.tab-icon { display: flex; align-items: center; justify-content: center; }
.tab-icon svg.lucide { width: 18px; height: 18px; }

/* Button icons — .btn already uses inline-flex + gap:8px */
.btn svg.lucide { width: 16px; height: 16px; flex-shrink: 0; }

/* .btn-text and .btn-loader should also align children */
.btn-text, .btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Credits icon */
.credits-display { display: inline-flex; align-items: center; gap: 6px; }
.credits-icon { display: inline-flex; align-items: center; }
.credits-icon svg.lucide { width: 14px; height: 14px; color: var(--warning); }

/* ── Loading Spinner ─────────────────────────────────────────────────────── */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Music Control ────────────────────────────────────────────────────────── */
.music-control-group { display: flex; gap: 8px; align-items: center; }
.btn-icon-only { padding: 0 12px; min-width: 42px; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon-only svg.lucide { margin: 0; }

/* ── Custom Select Arrow Icon ─────────────────────────────────────────────── */
.custom-select-arrow { display: inline-flex; align-items: center; }
.custom-select-arrow svg.lucide { width: 14px; height: 14px; }

/* ── Logo Icon ────────────────────────────────────────────────────────────── */
.logo-icon { display: inline-flex; align-items: center; }
.logo-icon svg.lucide { width: 20px; height: 20px; color: var(--accent); }

/* ── Mobile Toggle ────────────────────────────────────────────────────────── */
.mobile-toggle-btn { display: inline-flex; align-items: center; gap: 6px; }
.mobile-toggle-btn svg.lucide { width: 16px; height: 16px; }

/* ── Premium Music Library UI ────────────────────────────────────────────── */
.music-library-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.music-track-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.music-track-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.music-track-card.active {
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.06);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

.music-track-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.music-track-play-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.05);
}

.music-track-play-btn.playing {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.music-track-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.music-track-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-track-genre {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.music-track-select-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
}

.music-track-card.active .music-track-select-indicator {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.music-library-list::-webkit-scrollbar {
    width: 4px;
}

.music-library-list::-webkit-scrollbar-track {
    background: transparent;
}

.music-library-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ── Music Source Tabs ───────────────────────────────────────────────────── */
.music-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 0;
}

.music-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.music-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.music-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* ── Music Tab Content ───────────────────────────────────────────────────── */
.music-tab-content {
    display: none;
}

.music-tab-content.active {
    display: block;
}

/* ── Music Search Bar ────────────────────────────────────────────────────── */
.music-search-bar {
    display: flex;
    gap: 6px;
    margin: 10px 0 4px 0;
}

.music-search-bar .form-input {
    flex: 1;
    font-size: 0.78rem;
    padding: 7px 12px;
}

.music-search-bar .btn-sm {
    padding: 6px 12px;
    min-width: 36px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.music-search-bar .btn-sm:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.music-search-bar .btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Jamendo Track Card Extensions ───────────────────────────────────────── */
.music-track-card .music-track-cover {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.music-track-artist {
    font-size: 0.62rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-track-duration {
    font-size: 0.62rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: auto;
    padding-right: 4px;
}

/* Loading state for Jamendo cards during download */
.music-track-card.downloading {
    pointer-events: none;
    opacity: 0.7;
}

.music-track-card.downloading::after {
    content: "Downloading...";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--accent-light);
    font-weight: 500;
}

.music-track-card {
    position: relative;
}

/* ── Jamendo Placeholder ─────────────────────────────────────────────────── */
.jamendo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 16px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

/* ── Social Account Links ────────────────────────────────────────────────── */
.account-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}
.account-link-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Branded hover glows */
#acc-instagram:hover {
    border-color: rgba(225, 48, 108, 0.4);
    box-shadow: 0 0 15px rgba(225, 48, 108, 0.1);
    background: rgba(225, 48, 108, 0.02);
}
#acc-youtube:hover {
    border-color: rgba(255, 0, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.1);
    background: rgba(255, 0, 0, 0.02);
}

.account-link-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.platform-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

#acc-instagram .platform-icon {
    color: #e1306c;
    background: rgba(225, 48, 108, 0.1);
}
#acc-youtube .platform-icon {
    color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

#acc-instagram:hover .platform-icon {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(225, 48, 108, 0.3);
}
#acc-youtube:hover .platform-icon {
    background: #ff0000;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

.platform-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.platform-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.platform-status {
    font-size: 0.78rem;
    font-weight: 500;
}
.platform-status.connected {
    color: var(--success);
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}
.platform-status.disconnected {
    color: var(--text-muted);
}

.scheduler-queue-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}
.queue-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
}
.queue-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.queue-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.queue-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
}
.queue-platform-badge.instagram {
    background: rgba(225, 48, 108, 0.1);
    color: #e1306c;
    border: 1px solid rgba(225, 48, 108, 0.2);
}
.queue-platform-badge.youtube {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
    border: 1px solid rgba(255, 0, 0, 0.2);
}
.queue-platform-badge svg.lucide { width: 14px; height: 14px; }

.btn-cancel-post {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-cancel-post:hover {
    color: #ffffff;
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}
.btn-cancel-post svg.lucide {
    width: 14px;
    height: 14px;
}

.queue-item-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
    font-style: italic;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
}
.queue-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.queue-status-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.queue-status-badge.queued { background: rgba(234, 179, 8, 0.15); color: var(--warning); border: 1px solid rgba(234, 179, 8, 0.25); }
.queue-status-badge.posting { background: rgba(59, 130, 246, 0.15); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.25); }
.queue-status-badge.posted { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.25); }
.queue-status-badge.failed { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.25); }

/* ── Scheduler Modal ──────────────────────────────────────────────────────── */
.scheduler-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.music-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    gap: 8px;
}

.music-search-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.scheduler-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.scheduler-dialog {
    position: relative;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    background: rgba(17, 17, 24, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}
.scheduler-dialog::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #d946ef);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}
.scheduler-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.scheduler-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}
.scheduler-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.scheduler-close:hover {
    color: var(--text-primary);
}
.scheduler-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}
.platform-selector-group {
    display: flex;
    gap: 12px;
}
.platform-select-btn {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.platform-select-btn:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}
.platform-select-btn svg.lucide {
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

/* Branded Selector Cards when active */
.platform-select-btn[id$="instagram"].active {
    border-color: #e1306c;
    background: rgba(225, 48, 108, 0.08);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(225, 48, 108, 0.25);
    transform: translateY(-4px);
}
.platform-select-btn[id$="youtube"].active {
    border-color: #ff0000;
    background: rgba(255, 0, 0, 0.08);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.25);
    transform: translateY(-4px);
}
.platform-select-btn[id$="instagram"].active svg.lucide {
    transform: scale(1.15);
}
.platform-select-btn[id$="youtube"].active svg.lucide {
    transform: scale(1.15);
}

.platform-indicator-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}
.platform-select-btn.platform-connected[id$="instagram"] .platform-indicator-dot {
    background: #e1306c;
    box-shadow: 0 0 8px #e1306c;
}
.platform-select-btn.platform-connected[id$="youtube"] .platform-indicator-dot {
    background: #ff0000;
    box-shadow: 0 0 8px #ff0000;
}
.platform-disconnected .platform-indicator-dot {
    background: var(--danger);
}
.platform-disconnected {
    opacity: 0.65;
}
.platform-disconnected.active {
    border-color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.06) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2) !important;
}

.modal-video-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    padding: 10px;
}
.modal-video-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
}
.modal-video-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
    transform: translateX(2px);
}
.modal-video-item.selected {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: inset 4px 0 0 var(--accent), 0 4px 12px rgba(139, 92, 246, 0.1);
}
.video-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    transition: var(--transition);
}
.modal-video-item.selected .video-icon-wrapper {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 0 10px var(--accent-glow);
}
.video-item-text {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}
.scheduler-dialog .textarea, 
.scheduler-dialog .input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color-scheme: dark;
}
.scheduler-dialog .textarea:focus, 
.scheduler-dialog .input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 12px var(--accent-glow);
}
.scheduler-dialog .textarea {
    resize: vertical;
    min-height: 80px;
}
.field-warning {
    display: block;
    color: var(--warning);
    font-size: 0.78rem;
    margin-top: 8px;
    text-align: center;
}
.scheduler-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ── Bright Lizard 8 Loader Redesign ─────────────────────────────────────── */
#aiGenerateBtn .loader-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 28px; /* Room for the orb on the left */
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  background-color: transparent;
  user-select: none;
}

#aiGenerateBtn .loader {
  position: absolute;
  left: 0;
  top: calc(50% - 10px);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: transparent;
  animation: loader-rotate 2s linear infinite;
  z-index: 0;
}

@keyframes loader-rotate {
  0% {
    transform: rotate(90deg);
    box-shadow:
      0 1px 3px 0 #fff inset,
      0 2px 4px 0 #ad5fff inset,
      0 7px 7px 0 #471eec inset;
  }
  50% {
    transform: rotate(270deg);
    box-shadow:
      0 1px 3px 0 #fff inset,
      0 2px 2px 0 #d60a47 inset,
      0 5px 7px 0 #311e80 inset;
  }
  100% {
    transform: rotate(450deg);
    box-shadow:
      0 1px 3px 0 #fff inset,
      0 2px 4px 0 #ad5fff inset,
      0 7px 7px 0 #471eec inset;
  }
}

#aiGenerateBtn .loader-letter {
  display: inline-block;
  opacity: 0.4;
  transform: translateY(0);
  animation: loader-letter-anim 2s infinite;
  z-index: 1;
}

#aiGenerateBtn .loader-letter:nth-child(1) { animation-delay: 0s; }
#aiGenerateBtn .loader-letter:nth-child(2) { animation-delay: 0.1s; }
#aiGenerateBtn .loader-letter:nth-child(3) { animation-delay: 0.2s; }
#aiGenerateBtn .loader-letter:nth-child(4) { animation-delay: 0.3s; }
#aiGenerateBtn .loader-letter:nth-child(5) { animation-delay: 0.4s; }
#aiGenerateBtn .loader-letter:nth-child(6) { animation-delay: 0.5s; }
#aiGenerateBtn .loader-letter:nth-child(7) { animation-delay: 0.6s; }
#aiGenerateBtn .loader-letter:nth-child(8) { animation-delay: 0.7s; }
#aiGenerateBtn .loader-letter:nth-child(9) { animation-delay: 0.8s; }
#aiGenerateBtn .loader-letter:nth-child(10) { animation-delay: 0.9s; }
#aiGenerateBtn .loader-letter:nth-child(11) { animation-delay: 1.0s; }
#aiGenerateBtn .loader-letter:nth-child(12) { animation-delay: 1.1s; }
#aiGenerateBtn .loader-letter:nth-child(13) { animation-delay: 1.2s; }

@keyframes loader-letter-anim {
  0%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  20% {
    opacity: 1;
    transform: scale(1.15);
  }
  40% {
    opacity: 0.7;
    transform: translateY(0);
  }
}

/* ── Video Generate Pegtop Loader ────────────────────────────────────────── */
#generateBtn .video-pegtop-loader-container {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-right: 6px;
  overflow: visible;
}

#generateBtn .video-pegtop-loader {
  --fill-color: #a78bfa;
  --shine-color: rgba(167, 139, 250, 0.2);
  width: 100px;
  height: 100px;
  position: absolute;
  transform: scale(0.26);
  transform-origin: center;
  filter: drop-shadow(0 0 10px var(--shine-color));
}

#generateBtn .video-pegtop-loader svg {
  width: 100%;
  height: 100%;
}

#generateBtn .video-pegtop-loader #pegtopone {
  position: absolute;
  animation: flowe-one 1s linear infinite;
}

#generateBtn .video-pegtop-loader #pegtoptwo {
  position: absolute;
  opacity: 0;
  transform: scale(0) translateY(-200px) translateX(-100px);
  animation: flowe-two 1s linear infinite;
  animation-delay: 0.3s;
}

#generateBtn .video-pegtop-loader #pegtopthree {
  position: absolute;
  opacity: 0;
  transform: scale(0) translateY(-200px) translateX(100px);
  animation: flowe-three 1s linear infinite;
  animation-delay: 0.6s;
}

#generateBtn .video-pegtop-loader svg g path:first-child {
  fill: var(--fill-color);
}

@keyframes flowe-one {
  0% {
    transform: scale(0.5) translateY(-200px);
    opacity: 0;
  }
  25% {
    transform: scale(0.75) translateY(-100px);
    opacity: 1;
  }
  50% {
    transform: scale(1) translateY(0px);
    opacity: 1;
  }
  75% {
    transform: scale(0.5) translateY(50px);
    opacity: 1;
  }
  100% {
    transform: scale(0) translateY(100px);
    opacity: 0;
  }
}

@keyframes flowe-two {
  0% {
    transform: scale(0.5) rotateZ(-10deg) translateY(-200px) translateX(-100px);
    opacity: 0;
  }
  25% {
    transform: scale(1) rotateZ(-5deg) translateY(-100px) translateX(-50px);
    opacity: 1;
  }
  50% {
    transform: scale(1) rotateZ(0deg) translateY(0px) translateX(-25px);
    opacity: 1;
  }
  75% {
    transform: scale(0.5) rotateZ(5deg) translateY(50px) translateX(0px);
    opacity: 1;
  }
  100% {
    transform: scale(0) rotateZ(10deg) translateY(100px) translateX(25px);
    opacity: 0;
  }
}

@keyframes flowe-three {
  0% {
    transform: scale(0.5) rotateZ(10deg) translateY(-200px) translateX(100px);
    opacity: 0;
  }
  25% {
    transform: scale(1) rotateZ(5deg) translateY(-100px) translateX(50px);
    opacity: 1;
  }
  50% {
    transform: scale(1) rotateZ(0deg) translateY(0px) translateX(25px);
    opacity: 1;
  }
  75% {
    transform: scale(0.5) rotateZ(-5deg) translateY(50px) translateX(0px);
    opacity: 1;
  }
  100% {
    transform: scale(0) rotateZ(-10deg) translateY(100px) translateX(-25px);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME
   Overrides the default dark CSS variables when [data-theme="light"] is set.
   ═══════════════════════════════════════════════════════════════════════════ */

[data-theme="light"] {
    /* ── Backgrounds ──────────────────────────────── */
    --bg-primary:    #f4f4f8;
    --bg-secondary:  #ffffff;
    --bg-card:       rgba(255, 255, 255, 0.92);
    --bg-hover:      rgba(0, 0, 0, 0.04);
    --bg-input:      rgba(0, 0, 0, 0.05);
    --bg-elevated:   #ffffff;

    /* ── Borders ──────────────────────────────────── */
    --border:        rgba(0, 0, 0, 0.1);
    --border-hover:  rgba(0, 0, 0, 0.18);
    --border-focus:  rgba(139, 92, 246, 0.5);

    /* ── Text ─────────────────────────────────────── */
    --text-primary:   #1a1a2e;
    --text-secondary: #555570;
    --text-muted:     #8888a0;

    /* ── Accent (keep hue, adjust subtle/glow for light bg) ── */
    --accent-subtle: rgba(139, 92, 246, 0.08);
    --accent-glow:   rgba(139, 92, 246, 0.12);

    /* ── Shadows (softer on light) ────────────────── */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.15);
}

/* ── Auth Page gradient fix ──────────────────────────────────────────────── */
[data-theme="light"] .auth-page {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        var(--bg-primary);
}

/* ── Main content gradient fix ───────────────────────────────────────────── */
[data-theme="light"] .main-content {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(139, 92, 246, 0.04) 0%, transparent 60%),
        var(--bg-primary);
}

/* ── Story scene cards (were rgba(255,255,255,...) — invisible on white) ── */
[data-theme="light"] .story-scene-card {
    background: rgba(0, 0, 0, 0.015);
}
[data-theme="light"] .story-scene-card:hover {
    background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .scene-textarea:focus {
    background: rgba(0, 0, 0, 0.04);
}

/* ── Custom select trigger hover ─────────────────────────────────────────── */
[data-theme="light"] .custom-select-trigger:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

/* ── Dropdown shadow (softer on light) ───────────────────────────────────── */
[data-theme="light"] .custom-select-options {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ── Account link items ──────────────────────────────────────────────────── */
[data-theme="light"] .account-link-item {
    background: rgba(0, 0, 0, 0.015);
}

/* ── Queue items ─────────────────────────────────────────────────────────── */
[data-theme="light"] .queue-item {
    background: rgba(0, 0, 0, 0.015);
}
[data-theme="light"] .queue-item:hover {
    background: rgba(0, 0, 0, 0.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .queue-item-body {
    background: rgba(0, 0, 0, 0.04);
}

/* ── Platform select buttons ─────────────────────────────────────────────── */
[data-theme="light"] .platform-select-btn {
    background: rgba(0, 0, 0, 0.015);
}
[data-theme="light"] .platform-select-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* ── Modal video items ───────────────────────────────────────────────────── */
[data-theme="light"] .modal-video-item {
    background: rgba(0, 0, 0, 0.01);
}
[data-theme="light"] .modal-video-item:hover {
    background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .modal-video-list {
    background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .video-icon-wrapper {
    background: rgba(0, 0, 0, 0.05);
}

/* ── Scheduler dialog ────────────────────────────────────────────────────── */
[data-theme="light"] .scheduler-overlay {
    background: rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .scheduler-dialog {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .scheduler-dialog .textarea,
[data-theme="light"] .scheduler-dialog .input {
    background: rgba(0, 0, 0, 0.04);
    color-scheme: light;
}
[data-theme="light"] .scheduler-dialog .textarea:focus,
[data-theme="light"] .scheduler-dialog .input:focus {
    background: rgba(0, 0, 0, 0.06);
}

/* ── Pricing overlay ─────────────────────────────────────────────────────── */
[data-theme="light"] .pricing-overlay {
    background: rgba(0, 0, 0, 0.35);
}

/* ── Music play button ───────────────────────────────────────────────────── */
[data-theme="light"] .music-track-play-btn {
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .music-tab:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ── Cancel post button ──────────────────────────────────────────────────── */
[data-theme="light"] .btn-cancel-post {
    background: rgba(0, 0, 0, 0.04);
}

/* ── Music track cover border ────────────────────────────────────────────── */
[data-theme="light"] .music-track-card .music-track-cover {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ── Downloading overlay ─────────────────────────────────────────────────── */
[data-theme="light"] .music-track-card.downloading::after {
    background: rgba(255, 255, 255, 0.75);
    color: var(--accent);
}

/* ── Platform icon default bg ────────────────────────────────────────────── */
[data-theme="light"] .platform-icon {
    background: rgba(0, 0, 0, 0.04);
}

/* ── Btn spinner ─────────────────────────────────────────────────────────── */
[data-theme="light"] .btn-spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

/* ── Preview badge ───────────────────────────────────────────────────────── */
[data-theme="light"] .preview-badge {
    background: rgba(0, 0, 0, 0.55);
    color: #e0d0ff;
}

/* ── Step badges (inline styles) — override with specificity ─────────────── */
[data-theme="light"] .section-title span[id^="step"] {
    background: rgba(0, 0, 0, 0.08) !important;
    color: var(--text-primary) !important;
}

/* ── Toast warning text fix ──────────────────────────────────────────────── */
[data-theme="light"] .toast-warning {
    color: #1a1a2e;
}

/* ═══════════════════════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.theme-toggle {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(15deg) scale(1.08);
    box-shadow: 0 0 16px var(--accent-glow);
}

.theme-toggle:active {
    transform: rotate(15deg) scale(0.95);
}

.theme-toggle svg.lucide {
    width: 16px;
    height: 16px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle:hover svg.lucide {
    transform: rotate(20deg);
}

/* ── Floating theme toggle for login page ────────────────────────────────── */
.theme-toggle-float {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
}
