body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
}

header {
    background-color: #fff;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    margin: 0;
    font-size: 2em;
    color: #1877f2;
}

main {
    padding: 20px;
}

.container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.upload-section,
.prompt-section,
.result-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    margin-top: 0;
    font-size: 1.5em;
    color: #1877f2;
    border-bottom: 2px solid #1877f2;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#image-upload {
    display: block;
    margin-bottom: 20px;
}

.image-preview,
.image-result {
    width: 100%;
    height: 300px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#uploaded-image,
#generated-image {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

#generated-prompt {
    font-style: italic;
    color: #666;
}

#generate-prompt-btn {
    background-color: #1877f2;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 10px;
}

#generate-prompt-btn:hover {
    background-color: #166fe5;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1877f2;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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

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