:root {
    /* Design System Variables — Emerald Green Theme */
    --bg-slate-900: #0d1a12;
    --bg-slate-950: #060f09;
    --text-slate-50: #f0fdf4;
    --text-slate-400: #86a894;

    /* Accent: Emerald Green */
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --teal-400: #2dd4bf;
    --amber-500: #f59e0b;
    --rose-500: #f43f5e;

    /* Semantic Variables */
    --bg: var(--bg-slate-900);
    --surface-base: var(--bg-slate-950);
    --surface-raised: var(--bg-slate-900);
    --text-primary: var(--text-slate-50);
    --text-secondary: var(--text-slate-400);

    /* Main accent is now green */
    --accent-purple: var(--emerald-500);
    --accent-purple-glow: rgba(16, 185, 129, 0.15);
    --accent-hover: var(--emerald-600);
    --accent-sky: var(--teal-400);

    --border-subtle: #1a3328;
    --border-hover: #2d5040;

    --success: var(--emerald-500);
    --warning: var(--amber-500);
    --danger: var(--rose-500);
    --like-color: #34d399;
    --dislike-color: #f43f5e;

    --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    --sans-display: var(--font-sans);
    --sans-text: var(--font-sans);
    --mono: var(--font-mono);

    --radius-bento: 12px;
    --radius-inner: 8px;
    --radius-control: 6px;
    --radius-badge: 999px;

    --transition-snappy: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slide: all 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-default: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 10px 15px -3px rgba(16, 185, 129, 0.2), 0 4px 6px -4px rgba(16, 185, 129, 0.2);
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--sans-text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    padding: 40px 24px 60px 24px;
    overflow-y: scroll;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: var(--radius-badge);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--emerald-600);
}

/* Spotlight Top Ambient Glow */
.spotlight-banner {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 400px;
    background-image: radial-gradient(circle at top, rgba(16, 185, 129, 0.12) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* Sticky Navigation Bar */
.nav-bar {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-bento);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    color: var(--emerald-400);
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.45));
}


.logo-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.logo-text h1 {
    font-family: var(--sans-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.version-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: var(--radius-badge);
}

.status-panel {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    transition: var(--transition-snappy);
}

.status-online::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-busy::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 6px var(--warning);
}

.status-offline::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

/* Main Workspace Layout */
.workspace-layout {
    display: grid;
    grid-template-columns: minmax(380px, 1.15fr) minmax(340px, 0.85fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .workspace-layout {
        grid-template-columns: 1fr;
    }
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Bento Card Styles */
.bento-card {
    background-color: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-bento);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition-snappy);
}

.bento-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.header-title h2 {
    font-family: var(--sans-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-header .icon {
    color: var(--text-secondary);
}

.bento-card:hover .card-header .icon {
    color: var(--emerald-400);
}

.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Micro Badge */
.micro-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--emerald-400);
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 3px 8px;
    border-radius: var(--radius-badge);
}


/* Form Styles */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

textarea {
    width: 100%;
    height: 180px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-inner);
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: var(--sans-text);
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: var(--transition-snappy);
}

textarea:focus {
    border-color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.02);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}


/* Config Pane */
.config-pane {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-inner);
    padding: 18px;
}

.config-pane h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

select, input[type="number"] {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-control);
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: var(--sans-text);
    font-size: 13px;
    outline: none;
    transition: var(--transition-snappy);
}

select:focus, input[type="number"]:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

/* Button UI Controls */
.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    font-family: var(--sans-text);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-control);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-snappy);
    white-space: nowrap;
}


.primary-btn {
    background: linear-gradient(135deg, var(--emerald-500) 0%, var(--emerald-600) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.primary-btn:hover {
    background: linear-gradient(135deg, var(--emerald-400) 0%, var(--emerald-500) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

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


.secondary-btn {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

/* Queue Container */
.queue-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 380px;
}

.queue-header-row {
    display: flex;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--sans-text);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: 520px;
}


.queue-row {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-snappy);
    flex-shrink: 0;
    position: relative; /* necessary for progress bar absolute positioning at bottom */
}

.queue-row:hover {
    background: rgba(255, 255, 255, 0.01);
}

.queue-row.generating {
    background: rgba(16, 185, 129, 0.04);
    border-left: 2px solid var(--emerald-500);
}

.col-num { width: 36px; font-weight: 600; color: var(--text-secondary); }
.col-prompt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 12px; font-size: 13px; }
.col-status { width: 110px; }
.col-time { width: 60px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 12px; font-family: var(--mono); }

/* Badges for status */
.q-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-badge);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-pending { background: rgba(255, 255, 255, 0.04); color: var(--text-secondary); }
.badge-generating { background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); animation: breath 2s infinite ease-in-out; }
.badge-completed { background: rgba(52, 211, 153, 0.12); color: var(--emerald-400); }
.badge-failed { background: rgba(244, 63, 94, 0.1); color: var(--danger); }
.badge-skipped { background: rgba(245, 158, 11, 0.1); color: var(--warning); }


/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 36px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* System Logs Panel */
.logs-panel {
    flex: 1;
}

.log-container {
    padding: 12px;
}

.log-window {
    background-color: #020306;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-inner);
    padding: 14px;
    height: 180px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.log-entry {
    word-break: break-all;
    white-space: pre-wrap;
}

.log-entry .log-time {
    color: #4b5563;
    margin-right: 8px;
    font-weight: 500;
}

.log-entry.system { color: #52a8ff; }
.log-entry.queue { color: #b794f4; }
.log-entry.active { color: #f6ad55; }
.log-entry.server { color: var(--success); }
.log-entry.error { color: var(--danger); }

.btn-clear-logs {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-badge);
    transition: var(--transition-snappy);
    padding: 0;
}

.btn-clear-logs:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* Queue Header Controls & Status badges */
.header-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    width: 32px;
    height: 32px;
    cursor: pointer;
    border-radius: var(--radius-badge);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-snappy);
    padding: 0;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.ctrl-btn.danger:hover {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger);
    border-color: rgba(244, 67, 54, 0.2);
}

.badge-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-badge);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
}

.badge-idle {
    background: rgba(148, 163, 184, 0.04);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

.badge-running {
    background: rgba(76, 173, 107, 0.08);
    color: var(--success);
    border-color: rgba(76, 173, 107, 0.15);
    animation: breath 2s infinite ease-in-out;
}

.badge-paused {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.15);
}

/* Gallery Bento Section */
.gallery-section {
    margin-top: 24px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
}

.gallery-card {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-inner);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    transition: var(--transition-snappy);
    position: relative;
}

.gallery-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-glow);
}

.img-wrapper {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    background: #010206;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-snappy);
}

.gallery-card:hover .img-wrapper img {
    transform: scale(1.04);
}

.card-meta {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.card-prompt {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    height: 2.8em;
}

.card-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--sans-text);
}

/* Lightbox View Overlay */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 2, 18, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox-content {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-bento);
    max-width: 960px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 2.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-snappy);
    z-index: 10;
}

.lightbox-close:hover {
    color: var(--text-primary);
}

.lightbox-body {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
}

@media (max-width: 768px) {
    .lightbox-body {
        grid-template-columns: 1fr;
    }
}

.lightbox-image-container {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    position: relative;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-snappy);
    z-index: 5;
    outline: none;
}

.lightbox-nav-btn:hover {
    background: rgba(16, 185, 129, 0.85);
    color: #fff;
    border-color: var(--emerald-500);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}


.lightbox-nav-btn:disabled {
    opacity: 0.15;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
    border-color: transparent;
    color: var(--text-secondary);
    box-shadow: none;
}

.lightbox-nav-btn.prev-btn {
    left: 16px;
}

.lightbox-nav-btn.next-btn {
    right: 16px;
}


.lightbox-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-meta {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.lightbox-meta h3 {
    font-family: var(--sans-display);
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-item strong {
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item p {
    font-size: 13px;
    line-height: 1.6;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.download-btn {
    margin-top: auto;
}

/* Animations */
@keyframes breath {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.gallery-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.gallery-filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-right: auto; /* push action buttons to the right */
}


/* Parameter Descriptions */
.field-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-top: 4px;
}

/* Language Switcher */
.lang-toggle-btn {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    margin-right: 12px;
    transition: var(--transition-snappy);
    outline: none;
}

.lang-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.github-repo-btn {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    margin-right: 10px;
    transition: var(--transition-snappy);
    outline: none;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.github-repo-btn:hover {
    background: rgba(52, 211, 153, 0.08);
    color: var(--emerald-400);
    border-color: rgba(52, 211, 153, 0.35);
}

/* Restart Server Button */
.restart-server-btn {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    margin-right: 10px;
    transition: var(--transition-snappy);
    outline: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.restart-server-btn:hover {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.35);
}

.restart-server-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.restart-server-btn.restarting svg {
    animation: spin 1s linear infinite;
}

/* Stop Server Button */
.stop-server-btn {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    margin-right: 10px;
    transition: var(--transition-snappy);
    outline: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stop-server-btn:hover {
    background: rgba(244, 63, 94, 0.08);
    color: var(--danger);
    border-color: rgba(244, 63, 94, 0.35);
}

.stop-server-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

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


/* Prompt History Section */
.prompt-history-section {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-inner);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 140px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-clear-history {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--transition-snappy);
    padding: 2px;
}

.btn-clear-history:hover {
    color: var(--danger);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.history-item {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 10px;
    color: var(--text-primary);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: var(--transition-snappy);
    text-align: left;
    flex-shrink: 0;
}

.history-item:hover {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--emerald-400);
}


.history-empty {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px 0;
    font-style: italic;
}

/* Queue Progress Bar Component */
.queue-progress-container {
    padding: 16px 24px 8px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.005);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.progress-label {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-value {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--emerald-400);
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-badge);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-600) 0%, var(--emerald-400) 100%);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
    width: 0%;
    border-radius: var(--radius-badge);
    transition: width 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Lightbox Actions Container */
.lightbox-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    width: 100%;
}

.lightbox-actions .btn {
    flex: 1;
    margin: 0;
    padding: 10px 12px;
    font-size: 12px;
}

/* Gallery Group Card Styling */
.gallery-group-card {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-inner);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    transition: var(--transition-snappy);
    grid-column: span 1;
}

.gallery-group-card:hover {
    border-color: var(--emerald-600);
    box-shadow: var(--shadow-glow);
}

.gallery-group-card.multi-versions {
    grid-column: span 2;
}

.group-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.group-prompt {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.btn-regenerate-group {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: var(--transition-snappy);
    padding: 0;
}

.btn-regenerate-group:hover {
    color: var(--emerald-400);
    background: rgba(52, 211, 153, 0.1);
}


.group-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.1);
    flex: 1;
}

.group-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: #010206;
    cursor: pointer;
    transition: var(--transition-snappy);
}

.group-image-item:hover {
    transform: scale(1.02);
    border-color: var(--emerald-500);
}

.group-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-meta-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity 200ms ease;
}

.group-image-item:hover .image-meta-overlay {
    opacity: 1;
}

.image-seed-badge {
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--mono);
}

.btn-regenerate-single {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    transition: var(--transition-snappy);
    padding: 0;
}

.btn-regenerate-single:hover {
    color: var(--emerald-400);
    background: rgba(255, 255, 255, 0.1);
}

/* Total Timer Display */
.total-timer {
    font-size: 11px;
    font-weight: 700;
    color: var(--emerald-400);
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
    font-family: var(--mono);
    display: inline-block;
}


/* Right Side Logs Drawer */
.logs-drawer {
    position: fixed;
    top: 0;
    right: -380px; /* Hidden off-screen by default */
    width: 380px;
    height: 100vh;
    background: rgba(2, 6, 23, 0.98);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    z-index: 900;
    transition: right 400ms cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.logs-drawer.expanded {
    right: 0;
}


.drawer-handle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 100px;
    background: rgba(2, 6, 23, 0.98);
    border: 1px solid var(--border-subtle);
    border-right: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-snappy);
    z-index: 901;
}


.drawer-handle:hover {
    color: var(--text-primary);
    background: var(--surface-raised);
}

.drawer-header {
    height: 60px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.drawer-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.drawer-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.drawer-header h3 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.drawer-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-toggle-drawer {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: var(--transition-snappy);
    padding: 0;
}

.btn-toggle-drawer:hover {
    color: var(--text-primary);
}

/* Drawer Chevron Icon */
.logs-drawer .chevron-icon {
    transform: rotate(-90deg); /* point left by default */
    transition: transform var(--transition-snappy);
}

.logs-drawer.expanded .chevron-icon {
    transform: rotate(90deg); /* point right when expanded */
}

.drawer-body {
    flex: 1;
    padding: 24px;
    background: #020306;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-body .log-window {
    flex: 1;
    height: 100%;
    border: none;
    padding: 0;
    box-shadow: none;
    background: transparent;
    overflow-y: auto;
}

/* Prompt Extras (Prefix / Suffix) */
.prompt-extras-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-field-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field-inline label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-field-inline input[type="text"] {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-control);
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: var(--sans-text);
    font-size: 13px;
    outline: none;
    transition: var(--transition-snappy);
}

.input-field-inline input[type="text"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}


/* Collapsible Settings Header */
.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.config-pane .chevron-icon {
    transform: rotate(0);
    transition: transform var(--transition-snappy);
    color: var(--text-secondary);
}

.config-pane.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.config-pane.collapsed .config-grid {
    display: none;
}

.config-pane:not(.collapsed) .config-header {
    margin-bottom: 14px;
}

/* Toast System */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    background: rgba(6, 15, 9, 0.95);
    border: 1px solid var(--emerald-700);
    border-radius: var(--radius-badge);
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    backdrop-filter: blur(8px);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast.success {
    border-color: var(--emerald-500);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.2);
}

.toast.success svg {
    color: var(--emerald-400);
}

/* ============================================================
   Like / Dislike Rating System
   ============================================================ */
.image-rating-bar {
    display: flex;
    gap: 4px;
    position: absolute;
    top: 6px;
    right: 6px;
    opacity: 0;
    transition: opacity 180ms ease;
    z-index: 5;
}

.group-image-item:hover .image-rating-bar {
    opacity: 1;
}

/* Always show rating indicator when already rated */
.group-image-item.rated-like .image-rating-bar,
.group-image-item.rated-dislike .image-rating-bar {
    opacity: 1;
}

.btn-rate {
    background: rgba(6, 15, 9, 0.75);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    backdrop-filter: blur(4px);
    transition: var(--transition-snappy);
    padding: 0;
}

.btn-rate:hover {
    transform: scale(1.15);
    border-color: rgba(255,255,255,0.25);
}

.btn-rate.btn-like:hover,
.btn-rate.btn-like.active {
    background: rgba(52, 211, 153, 0.25);
    border-color: var(--like-color);
    color: var(--like-color);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.35);
}

.btn-rate.btn-dislike:hover,
.btn-rate.btn-dislike.active {
    background: rgba(244, 63, 94, 0.2);
    border-color: var(--dislike-color);
    color: var(--dislike-color);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

/* Faded/hidden state for disliked images */
.group-image-item.rated-dislike {
    opacity: 0.25;
    filter: saturate(0.2);
    transition: opacity 300ms ease, filter 300ms ease;
}

.group-image-item.rated-dislike:hover {
    opacity: 0.85;
    filter: saturate(0.8);
}

/* ============================================================
   Gallery Filter Bar
   ============================================================ */


.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-badge);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-snappy);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

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

.filter-btn.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(52, 211, 153, 0.4);
    color: var(--emerald-400);
}

.filter-btn.filter-dislike.active {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--dislike-color);
}

/* Row action buttons in queue */
.col-actions {
    width: 76px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.row-action-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-snappy);
    padding: 0;
    flex-shrink: 0;
}

.row-action-btn:hover {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--emerald-400);
}

.row-action-btn.danger:hover {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.25);
    color: var(--danger);
}

.model-loading-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--emerald-400);
    margin-top: 8px;
    font-weight: 500;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-control);
    animation: pulseGlow 2s infinite ease-in-out;
}

.model-loading-area .spinner {
    display: inline-block;
    animation: spin 2s linear infinite;
    font-size: 13px;
}

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.15); }
    50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.25); border-color: rgba(16, 185, 129, 0.35); }
}

.row-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.row-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-500) 0%, var(--emerald-400) 100%);
    box-shadow: 0 0 8px var(--emerald-400);
    width: 0%;
    transition: width 0.3s ease;
}
