:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #4b5563;
    --background-color: #f3f4f6;
    --card-background: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

#user-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    font-weight: 500;
    color: var(--text-secondary);
}

.generation-count {
    background-color: #e0e7ff;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Sections */
section {
    margin-bottom: 3rem;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Development Background Section */
.development-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #bbf7d0;
}

.development-section h2 {
    color: #166534;
    margin-bottom: 1rem;
}

.dev-content {
    max-width: 800px;
    margin: 0 auto;
}

.dev-list {
    list-style-type: none;
    margin-bottom: 1.5rem;
}

.dev-list li {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #15803d;
}

.dev-description {
    color: #14532d;
    font-style: italic;
    border-top: 1px solid #86efac;
    padding-top: 1rem;
}

/* Sample Title Section */
.sample-title-section {
    text-align: center;
    margin-bottom: 2rem;
}

.sample-title-section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    display: inline-block;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Hero Section */
.hero-section {
    background: #ffffff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hero-images-comparison {
    display: flex;
    gap: 2rem;
    width: 100%;
}

.hero-image-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-image-wrapper h3 {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.hero-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1; /* Keep square */
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    cursor: pointer; /* Add pointer cursor */
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Change to cover to fill square */
    display: block;
}

.hero-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    text-align: center;
    padding: 1rem;
}

.hero-placeholder p {
    color: var(--text-secondary);
    font-weight: 500;
}

.hero-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 20;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 30px;
    height: 30px;
    -webkit-animation: spin 1s linear infinite; /* Safari */
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

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

.hero-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero-prompt-example {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 600px;
}

.hero-prompt-example h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.prompt-content {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    background-color: #ffffff;
    padding: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
    line-height: 1.5;
}

.prompt-content p {
    margin-bottom: 0.25rem;
}

.prompt-content strong {
    color: var(--primary-color);
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4338ca 100%);
    border-radius: 1rem;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.cta-content h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #e0e7ff;
}

.cta-button {
    font-size: 1.25rem;
    padding: 1rem 2.5rem;
    background-color: white;
    color: var(--primary-color);
    font-weight: 600;
}

.cta-button:hover {
    background-color: #f3f4f6;
    color: var(--primary-hover);
}

.cta-login-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.cta-login-form .form-input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
}

/* Login Form Styles */
.login-form {
    display: flex;
    gap: 0.5rem;
}

.form-input {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    min-width: 200px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    ring: 2px solid var(--primary-color);
}


/* Drop Zone */
#drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2rem;
    background-color: #f9fafb;
}

#drop-zone:hover, #drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: #e0e7ff;
}

#preview-image {
    max-width: 100%;
    max-height: 400px;
    margin-top: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

label {
    font-weight: 500;
    color: var(--text-secondary);
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
}

textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

.btn.primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.btn.secondary {
    background-color: white;
    color: var(--text-secondary);
    border: 1px solid #d1d5db;
}

.btn.secondary:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

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

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

/* Gallery Grid */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.selected-count {
    font-weight: 500;
    color: var(--primary-color);
    margin-left: 0.5rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-item {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    position: relative;
}

.grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.image-pair {
    display: flex;
    height: 200px;
}

.image-pair img {
    width: 50%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.image-pair img:hover {
    opacity: 0.9;
}

.item-info {
    padding: 1rem;
}

.item-language {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.item-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.btn-delete {
    width: 100%;
    padding: 0.5rem;
    background-color: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-delete:hover {
    background-color: #fecaca;
}

.bulk-select-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    transform: scale(1.5);
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    padding: 2px;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 100;
    animation: slideIn 0.3s ease-out;
}

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

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

.toast.info {
    background-color: var(--secondary-color);
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
}

#modal-image {
    max-width: 100%;
    max-height: 85vh;
    display: block;
}

/* Queue Modal */
.queue-modal-content {
    max-width: 400px;
    text-align: center;
    padding: 2rem;
}

#queue-message {
    margin: 1.5rem 0;
    font-size: 1.1rem;
    white-space: pre-line;
}

/* Queue List Modal */
.queue-list-modal-content {
    width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

#queue-list-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.queue-stats {
    display: flex;
    justify-content: space-between;
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.stat-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.stat-value.pending { color: #f59e0b; }
.stat-value.processing { color: #3b82f6; }
.stat-value.completed { color: #10b981; }
.stat-value.failed { color: #ef4444; }

.queue-items {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.queue-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: white;
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item:hover {
    background-color: #f9fafb;
}

.queue-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.queue-id {
    font-family: monospace;
    color: var(--text-secondary);
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending { background-color: #fef3c7; color: #d97706; }
.status-processing { background-color: #dbeafe; color: #2563eb; }
.status-completed { background-color: #d1fae5; color: #059669; }
.status-failed { background-color: #fee2e2; color: #dc2626; }

.queue-info-row {
    display: flex;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.info-label {
    width: 120px;
    color: var(--text-secondary);
}

.info-value {
    flex: 1;
}

.error-text {
    color: #dc2626;
}

.no-items {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Footer */
footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: center;
}

.footer-content a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

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

/* Loading Indicator */
#loading-indicator {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
}

#sentinel {
    height: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #app {
        padding: 1rem;
    }

    /* Header adjustments for mobile */
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    #user-container {
        width: 100%;
        justify-content: center;
    }

    #login-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .form-input {
        width: 100%;
        min-width: 0;
    }

    /* Hero section adjustments */
    .hero-images-comparison {
        flex-direction: column;
    }

    /* Gallery grid adjustments */
    .grid-container {
        grid-template-columns: 1fr;
    }

    /* CTA section adjustments */
    .cta-content h2 {
        font-size: 1.5rem;
    }

    .cta-content p {
        font-size: 1rem;
    }

    .cta-button {
        width: 100%;
    }

    .cta-login-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .btn {
        width: 100%;
    }

    /* Adjust queue list modal for small screens */
    .queue-list-modal-content {
        width: 95vw;
        height: 90vh;
        padding: 1rem;
    }

    .queue-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stat-item {
        width: 45%;
    }
}

