/* Modern Premium Design System for SuperScaler */

:root {
    /* Color Palette */
    --bg-dark-base: hsl(230, 25%, 8%);
    --bg-dark-surface: hsl(230, 24%, 12%);
    --bg-dark-card: rgba(22, 24, 38, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.16);
    
    --text-primary: hsl(0, 0%, 96%);
    --text-secondary: hsl(225, 12%, 70%);
    --text-muted: hsl(225, 10%, 48%);
    
    --primary-gradient: linear-gradient(135deg, hsl(263, 85%, 64%) 0%, hsl(242, 85%, 60%) 100%);
    --secondary-gradient: linear-gradient(135deg, hsl(190, 90%, 50%) 0%, hsl(210, 85%, 55%) 100%);
    --accent-glow: 0 8px 32px rgba(124, 58, 237, 0.25);
    
    --primary-color: hsl(263, 85%, 64%);
    --primary-hover: hsl(263, 85%, 70%);
    --accent-color: hsl(190, 90%, 50%);
    --danger-color: hsl(0, 85%, 60%);
    
    /* Box Shadows & Blurs */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    --blur-normal: blur(16px);
    --blur-heavy: blur(24px);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark-base);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark-base);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-dark-surface);
    border-radius: 4px;
    border: 2px solid var(--bg-dark-base);
}
::-webkit-scrollbar-thumb:hover {
    background: hsl(230, 20%, 25%);
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 1.5rem;
    gap: 1rem;
}

/* Header with integrated navigation */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: var(--accent-glow);
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text h1 span {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.2;
    margin: 0;
}

/* Header Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
    padding: 0 0.5rem;
}

.header-nav .snav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.header-nav .snav-link:hover {
    color: var(--primary-color);
    background: rgba(124, 58, 237, 0.06);
}

.header-nav .snav-highlight {
    color: hsl(45, 100%, 55%) !important;
    font-weight: 600;
}

.header-nav .snav-highlight:hover {
    color: hsl(45, 100%, 70%) !important;
}

.header-actions {
    flex-shrink: 0;
}

/* Main */
.app-main {
    flex: 1;
    position: relative;
    min-height: 0; /* Important for flex child height limiting */
}

/* Upload Section */
.upload-section {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone {
    width: 100%;
    max-width: 720px;
    aspect-ratio: 16/10;
    border: 2px dashed rgba(124, 58, 237, 0.3);
    background: var(--bg-dark-card);
    backdrop-filter: var(--blur-normal);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.15), var(--shadow-lg);
    transform: translateY(-2px);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem;
    pointer-events: none; /* Let inputs handle clicks */
    z-index: 2;
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: var(--transition-normal);
}

.drop-zone:hover .upload-icon-wrapper {
    background: rgba(124, 58, 237, 0.15);
    transform: scale(1.05);
}

.drop-zone h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
}

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

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.96); }
}
.animate-pulse {
    animation: pulse 3s infinite ease-in-out;
}

/* Workspace Layout */
.workspace-section {
    height: 100%;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    height: 100%;
}

/* Sidebar and Cards */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 4px;
    max-height: 100%;
}

.control-card {
    background: var(--bg-dark-card);
    backdrop-filter: var(--blur-normal);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.control-card:hover {
    border-color: var(--border-color-hover);
}

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

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* File Info Details */
.file-summary {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.file-thumbnail-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-thumbnail-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.detail-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-dim, .detail-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Presets & Scale Inputs */
.presets-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    cursor: pointer;
}

.preset-btn input {
    display: none;
}

.preset-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    height: 38px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    user-select: none;
}

.preset-btn:hover span {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.03);
}

.preset-btn input:checked + span {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Custom Dimensions */
.custom-dims-group {
    max-height: 100px;
    opacity: 1;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.custom-dims-group.disabled {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    margin-bottom: -1rem;
}

.dim-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.input-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-field.half {
    max-width: 50%;
}

.input-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.input-field input, .select-input {
    background: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    height: 38px;
    border-radius: 8px;
    padding: 0 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    outline: none;
    width: 100%;
}

.input-field input:focus, .select-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.aspect-ratio-lock {
    background: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.aspect-ratio-lock:hover {
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.aspect-ratio-lock.active {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(6, 182, 212, 0.05);
}

.target-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.target-info .highlight {
    color: var(--accent-color);
    font-weight: 600;
}

/* Algo cards */
.algo-selection {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.algo-option {
    cursor: pointer;
}

.algo-option input {
    display: none;
}

.algo-card {
    border: 1px solid var(--border-color);
    background: var(--bg-dark-surface);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    transition: var(--transition-fast);
}

.algo-option:hover .algo-card {
    border-color: var(--border-color-hover);
    background: rgba(255,255,255,0.02);
}

.algo-option input:checked + .algo-card {
    border-color: var(--primary-color);
    background: rgba(124, 58, 237, 0.04);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.06);
}

.algo-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.algo-option input:checked + .algo-card .algo-name {
    color: var(--primary-color);
}

.algo-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Sliders */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-dark-surface);
    outline: none;
    transition: opacity .2s;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
    transition: var(--transition-fast);
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-hover);
}

/* Toggle switch */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    transition: .3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(124, 58, 237, 0.2);
    border-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: var(--primary-color);
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    user-select: none;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 1.5rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-normal);
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.35);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.35);
    filter: brightness(1.05);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-fast);
}

.btn-text:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.w-full {
    width: 100%;
}

.hidden-btn {
    display: none;
}

/* Selector box */
.format-quality-row {
    display: flex;
    gap: 0.75rem;
}

/* Viewer Panel */
.viewer-panel {
    background: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
}

/* Viewer Toolbar */
.viewer-toolbar {
    height: 52px;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(22, 24, 38, 0.4);
    backdrop-filter: blur(10px);
    z-index: 5;
}

.toolbar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge {
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark-base);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-color-hover);
    background: rgba(255,255,255,0.03);
}

#zoom-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 44px;
    text-align: center;
}

/* Viewer Container & Interactive Slider */
.viewer-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: 
        radial-gradient(var(--border-color) 1px, transparent 1px),
        radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-color: var(--bg-dark-base);
    cursor: grab;
}

.viewer-container:active {
    cursor: grabbing;
}

.zoom-wrapper {
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.05s ease-out; /* Slight damping for mouse wheel */
    will-change: transform;
}

.comparison-slider {
    position: relative;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    user-select: none;
}

.slider-side {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.side-before {
    position: relative; /* Bases the size */
    z-index: 1;
}

.side-after {
    z-index: 2;
    clip-path: inset(0 0 0 var(--slider-pos, 50%));
}

.comparison-slider canvas {
    display: block;
    max-width: none; /* Let JS set precise canvas sizes */
}

/* Labels on sides */
.side-label {
    position: absolute;
    top: 12px;
    padding: 0.35rem 0.65rem;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 4;
    pointer-events: none;
}

.label-before {
    left: 12px;
}

.label-after {
    right: 12px;
}

/* Handle bar */
.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--slider-pos, 50%);
    width: 2px;
    background: white;
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    pointer-events: auto;
}

.handle-line {
    flex: 1;
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
}

.handle-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    color: #1e2030;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin: 8px 0;
    transition: transform 0.15s ease;
}

.slider-handle:hover .handle-button {
    transform: scale(1.1);
}

/* Processing Overlay */
.progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 19, 0.7);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity var(--transition-normal);
}

.progress-box {
    background: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    padding: 2.25rem;
    border-radius: 24px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-lg);
}

.spinner-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
}

.progress-spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(124, 58, 237, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

.progress-glow {
    position: absolute;
    inset: -8px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.25) 0%, transparent 70%);
    filter: blur(8px);
    animation: pulse-glow 2s infinite ease-in-out;
}

.progress-box h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.progress-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: width 0.15s ease-out;
}

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

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

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
[data-theme="light"] {
    --bg-dark-base: hsl(220, 20%, 96%);
    --bg-dark-surface: hsl(220, 18%, 92%);
    --bg-dark-card: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-hover: rgba(0, 0, 0, 0.18);
    --text-primary: hsl(220, 25%, 12%);
    --text-secondary: hsl(220, 15%, 40%);
    --text-muted: hsl(220, 10%, 60%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
    --accent-glow: 0 8px 32px rgba(124, 58, 237, 0.12);
}
[data-theme="light"] .viewer-container {
    background-image:
        radial-gradient(rgba(0,0,0,0.08) 1px, transparent 1px),
        radial-gradient(rgba(0,0,0,0.08) 1px, transparent 1px);
    background-color: var(--bg-dark-base);
}
[data-theme="light"] body {
    background-color: var(--bg-dark-base);
    color: var(--text-primary);
}
[data-theme="light"] .video-element {
    background: #ddd;
}
[data-theme="light"] .drop-zone {
    background: var(--bg-dark-card);
}
[data-theme="light"] .drop-zone::before {
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.04) 0%, transparent 70%);
}

/* Footer styling */
.app-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* Image Queue (Batch Processing) Styles */
.queue-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    max-height: 200px;
    padding-right: 2px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.4rem;
}

.queue-list:empty::before {
    content: "File vide. Ajoutez des images.";
    display: block;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-dark-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    user-select: none;
}

.queue-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

.queue-item.active {
    border-color: var(--primary-color);
    background: rgba(124, 58, 237, 0.06);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.1);
}

.queue-item-thumb {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    background: var(--bg-dark-base);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.queue-item-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.queue-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.queue-item-name {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.queue-item-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.queue-item-status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.queue-item-status-icon.pending {
    background: var(--text-muted);
}

.queue-item-status-icon.processing {
    background: var(--accent-color);
    box-shadow: 0 0 6px var(--accent-color);
    animation: pulse 1.5s infinite ease-in-out;
}

.queue-item-status-icon.done {
    background: hsl(142, 70%, 45%);
    box-shadow: 0 0 6px hsl(142, 70%, 45%);
}

.queue-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.queue-item-remove:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Drag handle for queue reordering */
.queue-item .drag-handle {
    cursor: grab;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 0.15rem;
    border-radius: 4px;
    transition: var(--transition-fast);
    flex-shrink: 0;
    opacity: 0.4;
}
.queue-item:hover .drag-handle {
    opacity: 1;
}
.queue-item.dragging {
    opacity: 0.4;
    border-style: dashed;
}
.queue-item.drag-over {
    border-color: var(--primary-color);
    background: rgba(124, 58, 237, 0.08);
}

.queue-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-sm {
    height: 32px;
    padding: 0 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.queue-global-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
}

.queue-footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem;
    margin-top: 0.25rem;
}

.danger-text {
    color: var(--danger-color) !important;
}

.danger-text:hover {
    color: hsl(0, 85%, 65%) !important;
    text-decoration: underline;
}

.btn.disabled, .btn:disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

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

/* Responsiveness settings */
@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 500px;
    }
    .app-container {
        height: auto;
        max-height: none;
        overflow-y: auto;
    }
    .viewer-panel {
        height: 500px;
    }
    .sidebar {
        max-height: none;
    }
}

/* Mode Navigation Tabs */
.app-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.35rem;
    border-radius: 14px;
    align-self: center;
    margin-bottom: 0.25rem;
    backdrop-filter: var(--blur-normal);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.tab-btn.active {
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: var(--accent-glow);
}

/* Video specific tweaks */
.video-icon-wrapper {
    background: var(--secondary-gradient) !important;
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.2) !important;
}

.video-element {
    max-height: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Preset Button Active States */
.presets-row .preset-btn input:checked + span {
    background: var(--primary-gradient) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: var(--accent-glow);
}

.presets-row .preset-btn span:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color-hover);
}

.presets-row .preset-btn input:checked + span:hover {
    background: var(--primary-gradient) !important;
}

/* ============================================
   AD SLOTS - Premium Monetization System
   ============================================ */

.ad-slot {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.ad-slot.hidden-ad {
    display: none !important;
}

.ad-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 4px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
}

.ad-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 80px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.012) 10px,
        rgba(255, 255, 255, 0.012) 20px
    );
}

.ad-placeholder-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    font-style: italic;
    max-width: 200px;
}

/* Sidebar Ad */
.ad-sidebar {
    margin-top: 0.75rem;
}

.ad-sidebar .ad-box {
    min-height: 120px;
    flex-direction: column;
    gap: 0.6rem;
}

/* Bottom Banner Ad */
.ad-banner {
    margin: 0 1.5rem 0.5rem 1.5rem;
    flex-shrink: 0;
}

.ad-banner .ad-box {
    min-height: 56px;
}

/* ============================================
   PREMIUM BUTTON & BADGE
   ============================================ */

/* Theme toggle button in header */
#btn-theme {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    margin-right: 0.25rem;
}
#btn-theme:hover {
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.btn-premium {
    position: relative;
    overflow: hidden;
    font-family: inherit;
    font-size: 0.82rem;
    border-radius: 8px;
    flex-shrink: 0;
    animation: shimmer-gold 3s ease infinite;
    background-size: 200% auto;
    background: linear-gradient(135deg, hsl(45, 100%, 50%) 0%, hsl(35, 100%, 50%) 100%);
    color: #000;
    border: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 6px 12px;
    height: auto;
    cursor: pointer;
    transition: all 0.2s ease;
}

@keyframes shimmer-gold {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.btn-premium:active {
    transform: translateY(0);
}

/* Premium Active Badge State */
.btn-premium.is-premium {
    background: linear-gradient(135deg, hsl(150, 70%, 40%) 0%, hsl(160, 70%, 35%) 100%) !important;
    color: #fff !important;
    animation: none;
    cursor: default;
    pointer-events: none;
}

/* ============================================
   PREMIUM MODAL
   ============================================ */

.modal-overlay {
    animation: fade-in-overlay 0.25s ease forwards;
}

@keyframes fade-in-overlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    animation: slide-up-modal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slide-up-modal {
    from { transform: translateY(30px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close-btn:hover {
    color: var(--text-primary) !important;
    transform: rotate(90deg);
    transition: transform 0.25s ease !important;
}

/* ============================================
   PREMIUM ACTIVE — hide all ads
   ============================================ */
body.is-premium .ad-slot {
    display: none !important;
}

body.is-premium .ad-banner {
    display: none !important;
}

/* ============================================
   FFMPEG.WASM Loading State
   ============================================ */
.ffmpeg-loading-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.ffmpeg-loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: pulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

/* (secondary-nav styles removed, now in header-nav above) */

/* ============================================
   MODAL — WIDE VARIANT & GENERAL OVERRIDES
   ============================================ */

.modal-wide {
    max-width: 640px !important;
    width: 100%;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
}

/* ============================================
   ACCORDION (FAQ / Support)
   ============================================ */

.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.accordion-item:hover {
    border-color: var(--border-color-hover);
}

.accordion-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    gap: 1rem;
    transition: background 0.2s ease;
}

.accordion-btn:hover {
    background: rgba(255, 255, 255, 0.04);
}

.accordion-btn.open {
    color: var(--primary-color);
    background: rgba(124, 58, 237, 0.06);
}

.acc-icon {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.accordion-btn.open .acc-icon {
    transform: rotate(45deg);
    color: var(--primary-color);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-content.open {
    max-height: 300px;
    padding: 0 1rem 1rem;
}

.accordion-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* ============================================
   STATUS PAGE
   ============================================ */

.status-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green  { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); animation: pulse 2s infinite; }
.dot-yellow { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.6); animation: pulse 2s infinite; }
.dot-red    { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); animation: pulse 2s infinite; }

.status-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.1rem;
}

.status-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.status-desc { font-size: 0.75rem; color: var(--text-muted); }

.status-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

.badge-green  { background: rgba(16, 185, 129, 0.12); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-yellow { background: rgba(245, 158, 11, 0.12);  color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-red    { background: rgba(239, 68, 68, 0.12);  color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ============================================
   SUPPORT STATS CARDS
   ============================================ */

.support-stat-card {
    padding: 1rem;
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 12px;
    text-align: center;
}

.support-stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.support-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================
   FUNDING / SHOP SECTION
   ============================================ */

.funding-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.funding-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    overflow: hidden;
}

.funding-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 99px;
    transition: width 1s ease;
}

.btn-support-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-support-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
}

.shop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 0.6rem;
    gap: 1rem;
}

.shop-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.shop-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.shop-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   FEATURE REQUEST — VOTE LIST
   ============================================ */

.features-vote-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.feature-vote-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.2s ease;
}

.feature-vote-item:hover {
    border-color: var(--border-color-hover);
}

.feature-vote-info {
    flex: 1;
}

.feature-vote-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.feature-vote-importance {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.btn-vote {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-vote:hover, .btn-vote.voted {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   LEGAL CONTENT
   ============================================ */

.legal-content {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color-hover) transparent;
}

.legal-content h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1.2rem 0 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}

.legal-content h4:first-child {
    margin-top: 0;
}

.legal-content p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ============================================
   FORM STYLES (shared across modals)
   ============================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

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

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 16px;
    padding-right: 2.2rem;
}

select.form-input option {
    background: hsl(230, 25%, 12%);
    color: var(--text-primary);
}

textarea.form-input {
    min-height: 80px;
}

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(14, 16, 28, 0.97);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    animation: slide-up-modal 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
}

.cookie-text {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.btn-cookie {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-cookie-accept {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}

.btn-cookie-accept:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-cookie-decline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color-hover);
}

.btn-cookie-customize {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-cookie-customize:hover {
    color: var(--text-secondary);
}

.cookie-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cookie-toggle-row:last-child {
    border-bottom: none;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(124, 58, 237, 0.3);
    border-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: var(--primary-color);
}

/* ============================================
   APP FOOTER
   ============================================ */

.app-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    flex-shrink: 0;
}

.footer-legal-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.1rem 0.3rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Ensure app-container fills full height with flex */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.workspace-container {
    flex: 1;
}
