:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --text-color: #2d3436;
    --light-gray: #dfe6e9;
    --background-color: #f9f9f9;
    --error-color: #d63031;
    --success-color: #00b894;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

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

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

header p {
    color: #636e72;
    font-size: 1.1rem;
}

.upload-section {
    margin-bottom: 30px;
}

.drop-area {
    border: 2px dashed var(--secondary-color);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background-color: rgba(162, 155, 254, 0.05);
    transition: all 0.3s ease;
    position: relative;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.drop-area.active {
    border-color: var(--primary-color);
    background-color: rgba(108, 92, 231, 0.1);
}

.drop-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.drop-message svg {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.upload-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background-color: #5f4dd0;
    transform: translateY(-2px);
}

.requirements {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #636e72;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#imagePreview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(45, 52, 54, 0.7);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.prompt-section h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.prompt-input-container {
    display: flex;
    gap: 10px;
}

#promptInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--light-gray);
    border-radius: 5px;
    font-size: 1rem;
    transition: border 0.3s ease;
}

#promptInput:focus {
    border-color: var(--primary-color);
    outline: none;
}

.generate-button-container {
    text-align: center;
    margin: 30px 0;
}

.generate-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.generate-btn:hover {
    background-color: #5f4dd0;
    transform: translateY(-2px);
}

.loading-section {
    text-align: center;
    margin: 40px 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(162, 155, 254, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1.5s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.loading-time {
    color: #636e72;
}

.results-section {
    margin-top: 40px;
}

.results-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.result-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(45, 52, 54, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.new-generation-btn {
    display: block;
    margin: 0 auto;
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

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

footer {
    margin-top: 60px;
    text-align: center;
    color: #636e72;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .prompt-input-container {
        flex-direction: column;
    }
    
    .generate-btn {
        width: 100%;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}