/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --secondary-gradient: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --bg-dark: #0F0F1A;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-purple: #8B5CF6;
    --accent-pink: #EC4899;
    --accent-blue: #3B82F6;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Light Theme */
[data-theme="light"] {
    --bg-dark: #F5F3FF;
    --bg-card: rgba(139, 92, 246, 0.04);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #1E1B4B;
    --text-secondary: rgba(30, 27, 75, 0.7);
    --text-muted: rgba(30, 27, 75, 0.45);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
}

[data-theme="light"] .gradient-bg {
    opacity: 0.3;
}

[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(139, 92, 246, 0.12);
}

[data-theme="light"] .prompt-input,
[data-theme="light"] .negative-input,
[data-theme="light"] .style-select {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

[data-theme="light"] .prompt-input::placeholder,
[data-theme="light"] .negative-input::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .header {
    background: rgba(245, 243, 255, 0.82);
    border-bottom-color: rgba(139, 92, 246, 0.15);
}

[data-theme="light"] .nav-link:hover {
    background: rgba(139, 92, 246, 0.08);
}

[data-theme="light"] .nav-link.active {
    background: rgba(139, 92, 246, 0.12);
}

[data-theme="light"] .hero-subtitle {
    color: var(--text-secondary);
}

[data-theme="light"] .feature-card {
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .feature-icon-wrapper {
    background: rgba(139, 92, 246, 0.12);
}

[data-theme="light"] .result-placeholder {
    background: rgba(139, 92, 246, 0.03);
    border-color: rgba(139, 92, 246, 0.1);
}

[data-theme="light"] .placeholder-text {
    color: var(--text-secondary);
}

[data-theme="light"] .footer {
    border-top-color: rgba(139, 92, 246, 0.1);
}

[data-theme="light"] .modal-close {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .suggestion-chips .chip:not(:hover) {
    background: rgba(139, 92, 246, 0.08);
}

[data-theme="light"] .gallery-empty {
    color: var(--text-muted);
}

[data-theme="light"] .clear-history-btn {
    background: rgba(239, 68, 68, 0.08);
}

[data-theme="light"] .about-section,
[data-theme="light"] .gallery-section {
    border-top-color: rgba(139, 92, 246, 0.1);
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3 {
    color: var(--text-primary);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Gradient Background */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 60%),
        var(--bg-dark);
    animation: gradientPulse 8s ease-in-out infinite;
}

@keyframes gradientPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Glass Effect */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

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

.nav-link.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.2);
}

/* Hero Section */
.hero {
    padding: 60px 0 40px;
    text-align: center;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Generator Section */
.generator-section {
    padding: 20px 0 60px;
}

.generator-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.generator-card {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.prompt-input {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all var(--transition-fast);
}

.prompt-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

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

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

.input-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.enhance-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 100px;
    color: var(--accent-purple);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.enhance-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--accent-purple);
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

.enhance-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.enhance-icon {
    font-size: 0.9rem;
    transition: transform var(--transition-fast);
}

.enhance-btn:hover:not(:disabled) .enhance-icon {
    transform: scale(1.2) rotate(15deg);
}

.enhance-loader {
    display: none;
}

.enhance-btn.loading .enhance-icon,
.enhance-btn.loading .enhance-text {
    visibility: hidden;
}

.enhance-btn.loading .enhance-loader {
    display: flex;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Enhanced flash animation on textarea */
@keyframes enhancedFlash {
    0% {
        border-color: var(--accent-purple);
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
    }

    50% {
        border-color: var(--accent-pink);
        box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3);
    }

    100% {
        border-color: var(--border-color);
        box-shadow: none;
    }
}

.prompt-input.enhanced-flash {
    animation: enhancedFlash 1s ease;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Options Row */
.options-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}




.style-select {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.style-select:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.style-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Suggestions */
.suggestions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 14px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 100px;
    color: var(--accent-purple);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--accent-purple);
    transform: translateY(-1px);
}

/* Generate Button */
.generate-btn {
    position: relative;
    width: 100%;
    padding: 16px 28px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-normal);
    overflow: hidden;
}

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

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

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

.btn-text {
    transition: opacity var(--transition-fast);
}

.btn-icon {
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast);
}

.generate-btn:hover:not(:disabled) .btn-icon {
    transform: rotate(90deg);
}

.btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.generate-btn.loading .btn-text,
.generate-btn.loading .btn-icon {
    opacity: 0;
}

.generate-btn.loading .btn-loader {
    opacity: 1;
}

.loader-text {
    color: white;
    font-weight: 500;
    margin-left: 12px;
    font-size: 0.95rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Result Container */
.result-container {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-align: center;
    transition: all var(--transition-normal);
}

.result-placeholder:hover {
    border-color: var(--accent-purple);
    color: var(--text-secondary);
}

.placeholder-icon {
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 1rem;
}

.placeholder-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.7;
}

.result-image-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: var(--shadow-lg);
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-slow);
}

.image-container:hover img {
    transform: scale(1.02);
}

.image-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
}

.image-container:hover .image-overlay {
    opacity: 1;
    transform: translateY(0);
}

.overlay-btn {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.overlay-btn:hover {
    background: rgba(139, 92, 246, 0.9);
    border-color: transparent;
    transform: scale(1.1);
}

.image-info {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.prompt-display {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.image-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Gallery Section */
.gallery-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

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

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

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-normal);
    aspect-ratio: 1;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-prompt {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.clear-history-btn {
    display: block;
    margin: 32px auto 0;
    padding: 12px 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clear-history-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
}

/* About Section */
.about-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px;
    text-align: center;
    transition: all var(--transition-normal);
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

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

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.footer-note {
    font-size: 0.8rem;
    opacity: 0.7;
}

.footer-link {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-pink);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: transparent;
}

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

.toast {
    padding: 16px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 4.7s;
    max-width: 400px;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .generator-section .container {
        grid-template-columns: 1fr;
    }

    .result-container {
        min-height: 400px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        height: 64px;
    }

    .nav {
        display: none;
    }

    .hero {
        padding: 40px 0 30px;
    }

    .generator-card {
        padding: 24px;
    }

    .options-row {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

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

    .modal-close {
        top: 16px;
        right: 16px;
        background: rgba(0, 0, 0, 0.5);
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .generator-card {
        padding: 20px;
    }

    .ratio-buttons {
        justify-content: center;
    }

    .ratio-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .image-overlay {
        opacity: 1;
        transform: none;
        top: auto;
        bottom: 16px;
        right: 16px;
    }
}

/* Loading Animation for Image */
.image-loading {
    position: relative;
    overflow: hidden;
}

.image-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

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

    100% {
        transform: translateX(100%);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Selection */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}

/* ─── Theme Toggle ───────────────────────────────────────────────────────── */

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 1rem;
    line-height: 1;
    margin-left: 8px;
}

.theme-toggle:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
    transform: rotate(20deg);
}

.theme-icon.sun {
    display: none;
}

.theme-icon.moon {
    display: inline;
}

[data-theme="light"] .theme-icon.sun {
    display: inline;
}

[data-theme="light"] .theme-icon.moon {
    display: none;
}

/* ─── Negative Prompt ────────────────────────────────────────────────────── */

.negative-prompt-section {
    margin-top: 8px;
}

.negative-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 0;
    transition: color var(--transition-fast);
}

.negative-toggle:hover {
    color: var(--text-secondary);
}

.negative-toggle svg {
    transition: transform var(--transition-fast);
}

.negative-toggle.open svg {
    transform: rotate(45deg);
}

.toggle-hint {
    font-size: 0.75rem;
    opacity: 0.6;
}

.negative-prompt-body {
    margin-top: 8px;
    animation: slideDown 0.2s ease;
}

.negative-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    transition: border-color var(--transition-fast);
}

.negative-input:focus {
    outline: none;
    border-color: rgba(239, 68, 68, 0.5);
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* ─── Copy Button (inherits overlay-btn) ─────────────────────────────────── */

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.8);
}