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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-input: #171717;
    --bg-hover: #222222;
    --border-color: #2a2a2a;
    --border-light: #333333;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #707070;
    --accent-primary: #38bdf8;
    --accent-secondary: #7dd3fc;
    --accent-hover: #0ea5e9;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 60px; /* Space for fixed navbar */
    scroll-behavior: smooth;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 60px);
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

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

.brand-logo {
    max-height: 50px;
    max-width: 200px;
    height: auto;
    width: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6))
            drop-shadow(0 0 16px rgba(56, 189, 248, 0.4));
    animation: logo-glow 3s ease-in-out infinite;
}

@keyframes logo-glow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6))
                drop-shadow(0 0 16px rgba(56, 189, 248, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.8))
                drop-shadow(0 0 24px rgba(56, 189, 248, 0.5));
    }
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.workflow-name {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.nav-btn.primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-btn.secondary {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-btn.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6678, #3d4758);
    transform: translateY(-1px);
}

.nav-btn.abort {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.nav-btn.abort:hover:not(:disabled) {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    transform: translateY(-1px);
}

.nav-btn.clear-queue {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.nav-btn.clear-queue:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-btn .btn-icon {
    font-size: 1rem;
}

.queue-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.queue-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.logout-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.logout-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.admin-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

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

/* Side Menu */
.side-menu {
    position: fixed;
    top: 60px;
    left: -320px;
    width: 320px;
    height: calc(100vh - 60px);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: visible;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
}

.side-menu.open {
    left: 0;
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.side-menu-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-menu {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-menu:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.workflow-list {
    padding: 12px;
}

.workflow-category {
    margin: 16px 0 8px 0;
}

.workflow-category:first-child {
    margin-top: 0;
}

.category-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-icon {
    font-size: 0.875rem;
    color: var(--accent-primary);
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    position: relative;
    transition: color 0.2s ease;
}

.info-icon:hover {
    color: var(--accent-secondary);
}

.info-icon::after {
    content: attr(data-tooltip);
    position: fixed;
    left: 340px;
    top: var(--tooltip-top, 50%);
    transform: translateY(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: normal;
    width: 260px;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 1100;
    line-height: 1.4;
}

.info-icon::before {
    content: '';
    position: fixed;
    left: 334px;
    top: var(--tooltip-top, 50%);
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid var(--bg-secondary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1100;
}

.info-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

.info-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

.workflow-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.workflow-item:hover:not(.disabled) {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.workflow-item.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.workflow-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.workflow-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.workflow-item.active .workflow-icon {
    background: rgba(255, 255, 255, 0.1);
}

.workflow-info {
    flex: 1;
}

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

.workflow-item.active .workflow-title {
    color: #ffffff;
}

.workflow-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.workflow-item.active .workflow-desc {
    color: rgba(255, 255, 255, 0.8);
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Menu Sections */
.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.menu-section {
    padding: 12px;
}

.menu-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    padding: 0 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.menu-item-icon {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-modal.hidden {
    display: none;
}

.settings-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.settings-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid var(--border-color);
}

.primary-btn,
.secondary-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

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

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.secondary-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: start;
}

@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 420px 1fr;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Control Panel */
.control-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.section {
    margin-bottom: 24px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-label {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-left: 12px;
}

.value-display {
    color: var(--accent-secondary);
    font-weight: 700;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Prompt Input */
.prompt-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    resize: vertical;
    min-height: 140px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-tertiary);
}

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

/* Image Upload */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-upload-area {
    position: relative;
    width: 100%;
    min-height: 200px;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.image-upload-area.drag-over {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    border-style: solid;
}

.upload-placeholder {
    text-align: center;
    padding: 20px;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.upload-placeholder p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

#reference-image-preview {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

.remove-image-btn {
    background: var(--error);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-image-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Select Input */
.select-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b0b0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    will-change: background-color, border-color;
}

.select-input:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-light);
}

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

/* Slider */
.slider {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px var(--accent-glow);
}

/* Toggle Button */
.toggle-btn {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

#toggle-icon {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
}

#toggle-icon.rotated {
    transform: rotate(90deg);
}

/* Advanced Settings */
.advanced-settings {
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 1;
}

.advanced-settings.hidden {
    grid-template-rows: 0fr;
    opacity: 0;
}

.advanced-settings > * {
    min-height: 0;
}

/* Collapsible LoRA Content */
.lora-content {
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 1;
}

.lora-content.hidden {
    grid-template-rows: 0fr;
    opacity: 0;
}

.lora-content > * {
    min-height: 0;
}

/* Collapsible History Content */
.history-content {
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 1;
}

.history-content.hidden {
    grid-template-rows: 0fr;
    opacity: 0;
}

.history-content > * {
    min-height: 0;
}

/* Dimension Inputs */
.dimension-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.dimension-group {
    display: flex;
    flex-direction: column;
}

.dimension-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Preset Buttons */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.preset-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.preset-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
}

/* Text Input */
.text-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.text-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-tertiary);
}

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

/* Number Input */
.number-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.number-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-tertiary);
}

/* LoRA Slots */
.lora-slot {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lora-slot:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.lora-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.lora-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

#lightning-mode-section {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.05), rgba(79, 70, 229, 0.05));
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.lora-slot-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lora-slot-content .select-input:disabled,
.lora-slot-content .slider:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lora-category {
    font-weight: 600;
}

.lora-select {
    margin-bottom: 4px;
}

/* Seed Controls */
.seed-controls {
    display: flex;
    gap: 8px;
}

.seed-controls .number-input {
    flex: 1;
}

.icon-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: rotate(15deg) scale(1.05);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border: none;
    border-radius: 12px;
    padding: 18px;
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.generate-btn:hover:not(:disabled)::before {
    left: 100%;
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    width: 100%;
}

.button-group .generate-btn {
    flex: 1;
}

.generate-btn.primary {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
}

.generate-btn.secondary {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.generate-btn.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6678, #3d4758);
}

/* Batch Controls */
.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Queue Status */
.queue-status {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.queue-info {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}

.queue-info span {
    color: var(--accent-primary);
    font-weight: 700;
}

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

.queue-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 4px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.queue-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.queue-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.queue-action-btn.cancel-btn {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
}

.queue-action-btn.cancel-btn:hover {
    background: linear-gradient(135deg, #fc8181, #e53e3e);
    transform: translateY(-1px);
}

.queue-action-btn.clear-btn {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.queue-action-btn.clear-btn:hover {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    transform: translateY(-1px);
}

.queue-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Status Display */
.status-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.status-display.hidden {
    display: none;
}

.status-icon {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.status-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cancel-generation-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cancel-generation-btn:hover {
    background: linear-gradient(135deg, #fc8181, #e53e3e);
    transform: scale(1.1);
}

/* Generation Controls */
.generation-controls {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.generation-controls.hidden {
    display: none;
}

.control-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-btn .btn-icon {
    font-size: 1.25rem;
}

.control-btn.abort-btn {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
}

.control-btn.abort-btn:hover {
    background: linear-gradient(135deg, #fc8181, #e53e3e);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.control-btn.clear-queue-btn-main {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.control-btn.clear-queue-btn-main:hover {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Preview Panel */
/* Right Panel - Contains Preview, LoRAs, and History */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Preview Section */
.preview-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow-lg);
}

.preview-container {
    background: var(--bg-primary);
    border-radius: 12px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.preview-placeholder p {
    font-size: 1.125rem;
    font-weight: 500;
}

.preview-container img {
    max-width: 100%;
    max-height: 800px;
    width: auto;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Image Actions */
.image-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.image-actions.hidden {
    display: none;
}

.action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.action-btn span {
    font-size: 1.25rem;
}

/* LoRA Section in Right Panel */
.lora-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.lora-section-header {
    margin-bottom: 20px;
}

.lora-section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.lora-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

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

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    text-align: center;
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

.stat-value {
    color: var(--accent-secondary);
    font-weight: 700;
    font-size: 1.125rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    z-index: 1001;
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: -50px;
    right: -50px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: var(--text-primary);
    font-size: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: rotate(90deg);
}

.modal-content img {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* Progress Bar */
.progress-container {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* History Section */
.history-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.history-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.history-item {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.history-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.history-item-info {
    padding: 12px;
}

.history-item-prompt {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    margin-bottom: 8px;
}

.history-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item:hover .history-item-actions {
    opacity: 1;
}

.history-action-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.history-action-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

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

/* ========================
   MODERN ANIMATIONS & EFFECTS
   ======================== */

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(124, 58, 237, 0.6), 0 0 60px rgba(124, 58, 237, 0.3);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Slide In From Top */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In From Bottom */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In From Left */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Breathing Animation */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.03);
        opacity: 0.9;
    }
}

/* Apply entrance animations */
.top-nav {
    animation: slideInFromTop 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-menu.active {
    animation: slideInFromLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.container {
    animation: fadeIn 0.5s ease-out;
}

/* Enhanced Button Hover Effects */
.nav-btn,
.generate-btn,
.primary-btn,
.secondary-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::before,
.generate-btn::before,
.primary-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.nav-btn:hover::before,
.generate-btn:hover::before,
.primary-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Card Hover Effects */
.lora-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lora-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(124, 58, 237, 0.3);
}

.lora-card:active {
    transform: translateY(-2px);
}

/* Input Focus Glow */
.text-input:focus,
.prompt-input:focus,
.select-input:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3), 0 4px 12px rgba(124, 58, 237, 0.2);
    animation: glow 2s infinite;
}

/* Slider Glow */
.slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.2), 0 0 20px rgba(124, 58, 237, 0.4);
}

/* Workflow Item Hover */
.workflow-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.workflow-item:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(168, 85, 247, 0.1));
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.workflow-item.active {
    animation: pulse 2s infinite;
}

/* Enhanced Status Display */
#status-display {
    animation: slideInFromBottom 0.3s ease-out;
}

/* Progress Bar Animation */
.progress-fill {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

/* Spinner Rotation */
.spinner {
    animation: rotate 1s linear infinite;
}

/* Queue Dot Pulse */
.queue-dot {
    animation: pulse 2s infinite, breathe 3s infinite;
}

/* Modal Entrance */
.modal:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image Preview Entrance */
#preview-container img {
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Generate Button Pulsing when Ready */
.generate-btn:not(:disabled) {
    animation: breathe 3s infinite;
}

/* Settings Modal Glassmorphism */
.settings-modal {
    backdrop-filter: blur(10px);
}

.settings-content {
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Enhanced Shadows */
.control-panel,
.preview-panel,
.lora-section {
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: box-shadow 0.3s ease;
}

.control-panel:hover,
.preview-panel:hover,
.lora-section:hover {
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(124, 58, 237, 0.2);
}

/* Navbar Glow on Scroll */
.top-nav {
    transition: box-shadow 0.3s ease;
}

/* Menu Toggle Animation */
.menu-toggle:hover .hamburger:nth-child(1) {
    transform: translateX(-3px);
}

.menu-toggle:hover .hamburger:nth-child(3) {
    transform: translateX(3px);
}

/* Image Actions Slide In */
.image-actions {
    animation: slideInFromBottom 0.4s ease-out;
}

/* History Item Entrance */
.history-item {
    animation: scaleIn 0.3s ease-out;
}

.history-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(124, 58, 237, 0.4);
}

/* Enhanced Button Active State */
.nav-btn:active,
.generate-btn:active,
.primary-btn:active {
    transform: scale(0.95);
}

/* Section Label Accent Line */
.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-primary);
    transition: height 0.3s ease;
}

.section:hover .section-label::before {
    height: 100%;
}

/* Gradient Text Animation */
.brand-name {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary), var(--accent-secondary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease infinite;
}

/* Loading State Shimmer */
.select-input option[value=""]:only-child {
    background: linear-gradient(
        90deg,
        var(--bg-input) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-input) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Inpaint Mask Editor */
.inpaint-editor-container {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.inpaint-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tool-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.tool-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.tool-btn.active {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.tool-separator {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

.tool-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.tool-slider {
    width: 100px;
    height: 4px;
}

.canvas-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#inpaint-canvas {
    display: none;
    max-width: 100%;
    max-height: 600px;
    cursor: crosshair;
    border-radius: 8px;
}

#inpaint-canvas.active {
    display: block;
}

.canvas-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.canvas-placeholder p {
    margin: 0;
    font-size: 1rem;
}

.inpaint-hint {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.inpaint-hint strong {
    color: var(--text-primary);
}
