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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.upload-section, .output-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

h3 {
    color: #555;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.image-upload-area {
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-generate {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2em;
    padding: 16px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-generate:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.image-preview {
    margin-top: 20px;
    min-height: 200px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

.image-preview.empty {
    background: #f9f9f9;
}

.prompt-section {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.loading {
    text-align: center;
    margin-top: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.output-gallery {
    min-height: 400px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
}

.placeholder-text {
    text-align: center;
    color: #999;
    padding: 100px 20px;
    font-size: 1.1em;
}

.output-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.output-item h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.output-item .timestamp {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.output-item .prompt-used {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-style: italic;
}

.output-item .result {
    line-height: 1.6;
    color: #333;
}

.output-item img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.error-message {
    background: #ffe6e6;
    color: #cc0000;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

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