/* ═══════════════════════════════════════════════════════════════
   COLORIZED CALVIN — 1970s Album Cover Aesthetic
   Inspired by soul, funk, and psychedelic rock album art
   ═══════════════════════════════════════════════════════════════ */

/* CSS Variables - Shared */
:root {
    /* Typography */
    --font-display: 'Righteous', cursive;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Borders & Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
}

/* ═══════════════════════════════════════════════════════════════
   DARK THEME (Default)
   ═══════════════════════════════════════════════════════════════ */
html, [data-theme="dark"] {
    /* Primary palette — moody, rich tones */
    --burnt-orange: #E07B39;
    --sunset-orange: #FF7A4D;
    --mustard: #F0C040;
    --golden: #E5B84C;
    --avocado: #8AAD48;
    --olive: #9AA060;
    --chocolate: #1A1412;
    --espresso: #0D0A09;
    --cream: #F5EBE0;
    --paper: #2A2320;
    --terracotta: #D96666;

    /* Accent colors */
    --teal-70s: #20B2AA;
    --rust: #C06030;
    --wine: #8B3A44;

    /* Dark mode specific */
    --bg-primary: #121010;
    --bg-secondary: #1E1A18;
    --bg-card: #252120;
    --bg-elevated: #2E2825;
    --text-primary: #F5EBE0;
    --text-secondary: #B8A99A;
    --text-muted: #7A6E64;
    --border-color: #3D3530;

    /* Gradients */
    --sunset-gradient: linear-gradient(180deg, #FF7A4D 0%, #E07B39 35%, #F0C040 70%, #E5B84C 100%);
    --warm-gradient: linear-gradient(135deg, #E07B39 0%, #F0C040 50%, #8AAD48 100%);
    --paper-gradient: linear-gradient(180deg, #1E1A18 0%, #121010 100%);
    --header-gradient: linear-gradient(180deg, #2E2825 0%, #1E1A18 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(255, 122, 77, 0.2);

    /* Borders */
    --border-thin: 2px solid var(--border-color);
    --border-thick: 4px solid var(--border-color);
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
    /* Primary palette — warm, earthy tones */
    --burnt-orange: #D2691E;
    --sunset-orange: #FF6B35;
    --mustard: #E1AD01;
    --golden: #DAA520;
    --avocado: #6B8E23;
    --olive: #808000;
    --chocolate: #3D1C02;
    --espresso: #2D1810;
    --cream: #FFF8DC;
    --paper: #F5E6D3;
    --terracotta: #CD5C5C;

    /* Accent colors */
    --teal-70s: #008B8B;
    --rust: #A0522D;
    --wine: #722F37;

    /* Light mode specific */
    --bg-primary: #FFF8DC;
    --bg-secondary: #F5E6D3;
    --bg-card: #FFF8DC;
    --bg-elevated: #FFFFFF;
    --text-primary: #2D1810;
    --text-secondary: #5C4033;
    --text-muted: #8B7355;
    --border-color: #3D1C02;

    /* Gradients */
    --sunset-gradient: linear-gradient(180deg, #FF6B35 0%, #F7931E 35%, #E1AD01 70%, #DAA520 100%);
    --warm-gradient: linear-gradient(135deg, #D2691E 0%, #E1AD01 50%, #6B8E23 100%);
    --paper-gradient: linear-gradient(180deg, #FFF8DC 0%, #F5E6D3 100%);
    --header-gradient: var(--sunset-gradient);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(61, 28, 2, 0.15);
    --shadow-md: 0 4px 20px rgba(61, 28, 2, 0.2);
    --shadow-lg: 0 8px 40px rgba(61, 28, 2, 0.25);
    --shadow-glow: 0 0 40px rgba(255, 107, 53, 0.3);

    /* Borders */
    --border-thin: 2px solid var(--chocolate);
    --border-thick: 4px solid var(--chocolate);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Grain overlay for vintage texture */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.site-header {
    background: var(--header-gradient);
    padding: var(--space-md) 0;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 100;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--chocolate);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--cream);
}

.logo-icon {
    font-size: 2rem;
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 var(--chocolate);
}

.main-nav {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--cream);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover {
    border-color: var(--cream);
    background: rgba(255, 255, 255, 0.1);
}

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

.main-content {
    min-height: calc(100vh - 200px);
    padding: var(--space-2xl) 0;
}

/* Page title */
.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    margin-bottom: var(--space-lg);
    background: var(--sunset-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.page-subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════════
   UPLOAD ZONE
   ═══════════════════════════════════════════════════════════════ */

.upload-zone {
    background: var(--bg-card);
    border: 4px dashed var(--burnt-orange);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--warm-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    opacity: 0.1;
}

.upload-zone:hover {
    border-color: var(--sunset-orange);
    transform: scale(1.01);
    box-shadow: var(--shadow-glow);
}

.upload-zone.dragover {
    border-style: solid;
    border-color: var(--avocado);
    background: rgba(107, 142, 35, 0.1);
}

.upload-zone > * {
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    display: block;
}

.upload-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.upload-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.upload-formats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-md);
}

.format-badge {
    background: var(--chocolate);
    color: var(--cream);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hidden file input */
.upload-input {
    display: none;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1rem;
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--sunset-gradient);
    color: var(--cream);
    box-shadow: var(--shadow-md), 0 4px 0 var(--chocolate);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 6px 0 var(--chocolate);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: var(--shadow-sm), 0 2px 0 var(--chocolate);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: var(--border-thick);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--burnt-orange);
    color: var(--cream);
}

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

.btn-ghost:hover {
    border-color: var(--burnt-orange);
    color: var(--burnt-orange);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   IMAGE GALLERY
   ═══════════════════════════════════════════════════════════════ */

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.image-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: var(--border-thick);
    transition: all 0.3s ease;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.image-card-preview {
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    background: var(--chocolate);
}

.image-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-card:hover .image-card-preview img {
    transform: scale(1.05);
}

.image-card-status {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-uploaded {
    background: var(--mustard);
    color: var(--espresso);
}

.status-colorizing {
    background: var(--teal-70s);
    color: var(--cream);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-colorized {
    background: var(--avocado);
    color: var(--cream);
}

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

.image-card-body {
    padding: var(--space-md);
}

.image-card-name {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-card-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.image-card-actions .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS INDICATOR
   ═══════════════════════════════════════════════════════════════ */

.progress-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: var(--border-thick);
    text-align: center;
}

.progress-bar-track {
    background: var(--paper);
    border-radius: var(--radius-full);
    height: 24px;
    overflow: hidden;
    border: 2px solid var(--chocolate);
    margin: var(--space-lg) 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--sunset-gradient);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-message {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
}

.progress-percent {
    font-size: 2rem;
    font-weight: 700;
    color: var(--sunset-orange);
    margin-top: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════
   IMAGE VIEW PAGE
   ═══════════════════════════════════════════════════════════════ */

.image-view {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-2xl);
    align-items: start;
}

@media (max-width: 900px) {
    .image-view {
        grid-template-columns: 1fr;
    }
}

.image-display {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: var(--border-thick);
}

.image-display img {
    width: 100%;
    height: auto;
    display: block;
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.image-comparison-panel {
    position: relative;
}

.image-comparison-label {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    background: var(--chocolate);
    color: var(--cream);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: 0.85rem;
}

/* Edit Panel */
.edit-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: var(--border-thick);
}

.edit-panel-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.edit-textarea::placeholder {
    color: var(--text-muted);
}

.edit-textarea:focus {
    outline: none;
    border-color: var(--burnt-orange);
    box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.2);
}

/* History */
.edit-history {
    margin-top: var(--space-xl);
    border-top: 2px dashed var(--burnt-orange);
    padding-top: var(--space-lg);
}

.history-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--burnt-orange);
    margin-bottom: var(--space-md);
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.history-item {
    background: var(--bg-elevated);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
}

.history-number {
    background: var(--chocolate);
    color: var(--cream);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   VAULT PAGES
   ═══════════════════════════════════════════════════════════════ */

.vault-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.vault-name {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.vault-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--avocado);
    color: var(--cream);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
}

.vault-badge.viewer {
    background: var(--teal-70s);
}

/* Auth Form */
.auth-container {
    max-width: 450px;
    margin: var(--space-3xl) auto;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    border: var(--border-thick);
    text-align: center;
}

.auth-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.auth-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.form-input {
    width: 100%;
    padding: var(--space-md);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: center;
    background: var(--bg-elevated);
    color: var(--text-primary);
}

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

.form-input:focus {
    outline: none;
    border-color: var(--burnt-orange);
    box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.2);
}

.auth-error {
    color: var(--terracotta);
    font-weight: 500;
    padding: var(--space-sm);
    background: rgba(205, 92, 92, 0.1);
    border-radius: var(--radius-sm);
}

/* Password display */
.password-display {
    background: var(--bg-elevated);
    border: var(--border-thin);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin: var(--space-md) 0;
}

.password-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.password-value {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    display: inline-block;
    user-select: all;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.site-footer {
    background: var(--chocolate);
    color: var(--cream);
    padding: var(--space-xl) 0;
    text-align: center;
    margin-top: auto;
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-icon {
    margin: 0 var(--space-sm);
    color: var(--mustard);
}

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

#toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--chocolate);
    color: var(--cream);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

.toast.success {
    background: var(--avocado);
}

.toast.error {
    background: var(--terracotta);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════
   HTMX STATES
   ═══════════════════════════════════════════════════════════════ */

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-flex;
}

.htmx-request.htmx-indicator {
    display: inline-flex;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: var(--space-md);
    }

    .upload-zone {
        padding: var(--space-xl);
    }

    .upload-icon {
        font-size: 3rem;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--space-md);
    }
}

/* ═══════════════════════════════════════════════════════════════
   DECORATIVE ELEMENTS
   ═══════════════════════════════════════════════════════════════ */

.starburst {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--mustard);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    opacity: 0.1;
    z-index: 0;
}

.circle-deco {
    position: absolute;
    border-radius: 50%;
    border: 4px solid var(--burnt-orange);
    opacity: 0.1;
}

/* ═══════════════════════════════════════════════════════════════
   BATCH COLORIZATION
   ═══════════════════════════════════════════════════════════════ */

/* Batch actions bar on home page */
.batch-actions {
    background: var(--bg-card);
    border: var(--border-thick);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-xl);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: var(--space-lg);
    z-index: 50;
}

.batch-actions-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.batch-count {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
}

.batch-count span {
    color: var(--burnt-orange);
    font-size: 1.5rem;
}

.batch-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.1rem;
}

/* Batch page options */
.batch-options {
    margin-bottom: var(--space-xl);
}

.batch-option-card {
    background: var(--bg-card);
    border: var(--border-thick);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.batch-option-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.batch-option-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

/* Batch action bar */
.batch-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    background: var(--bg-card);
    border: var(--border-thick);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    position: sticky;
    top: var(--space-lg);
    z-index: 50;
}

.batch-selection {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--burnt-orange);
    cursor: pointer;
}

.batch-action-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Batch progress */
.batch-progress {
    background: var(--bg-card);
    border: var(--border-thick);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.batch-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.batch-progress-header h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
}

.batch-progress-stats {
    font-family: var(--font-display);
    color: var(--burnt-orange);
    font-size: 1.25rem;
}

.batch-status-message {
    text-align: center;
    color: var(--text-secondary);
    margin-top: var(--space-md);
}

/* Batch results */
.batch-results {
    background: linear-gradient(135deg, var(--avocado) 0%, var(--teal-70s) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.batch-results-header h3 {
    font-family: var(--font-display);
    color: var(--cream);
    font-size: 1.75rem;
    margin-bottom: var(--space-lg);
}

.batch-results-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.batch-results-actions .btn {
    background: var(--cream);
    color: var(--chocolate);
}

.batch-results-actions .btn-primary {
    background: var(--sunset-gradient);
    color: var(--cream);
}

/* Batch grid */
.batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.batch-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-secondary);
}

.batch-loading .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--space-md);
    border-width: 4px;
    border-top-color: var(--burnt-orange);
}

/* Batch item */
.batch-item {
    background: var(--bg-card);
    border: var(--border-thick);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.batch-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.batch-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-bottom: 2px solid var(--border-color);
}

.batch-item-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    background: var(--mustard);
    color: var(--espresso);
}

.batch-item-status.status-queued {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.batch-item-status.status-processing {
    background: var(--teal-70s);
    color: var(--cream);
    animation: pulse 1.5s ease-in-out infinite;
}

.batch-item-status.status-complete {
    background: var(--avocado);
    color: var(--cream);
}

.batch-item-status.status-error {
    background: var(--terracotta);
    color: var(--cream);
}

.batch-item-preview {
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden;
    background: var(--chocolate);
}

.batch-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.batch-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45, 24, 16, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-item-overlay .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    border-top-color: var(--cream);
}

.batch-item-info {
    padding: var(--space-sm) var(--space-md);
}

.batch-item-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: var(--space-xs);
}

.batch-item-prompt {
    margin-top: var(--space-sm);
}

.prompt-input {
    width: 100%;
    padding: var(--space-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-body);
    background: var(--bg-elevated);
    color: var(--text-primary);
}

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

.prompt-input:focus {
    outline: none;
    border-color: var(--burnt-orange);
}

.batch-item-link {
    display: block;
    text-align: center;
    padding: var(--space-sm);
    background: var(--chocolate);
    color: var(--cream);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.85rem;
    transition: background 0.3s ease;
}

.batch-item-link:hover {
    background: var(--burnt-orange);
}

/* Responsive batch */
@media (max-width: 768px) {
    .batch-actions-inner,
    .batch-action-bar {
        flex-direction: column;
        text-align: center;
    }

    .batch-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-md);
    }
}

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

.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: var(--space-xs) var(--space-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.theme-toggle-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle-icon {
    transform: rotate(15deg);
}

.theme-toggle-label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hide label on mobile */
@media (max-width: 768px) {
    .theme-toggle-label {
        display: none;
    }
}
