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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f4f7f9 0%, #e8f0f6 100%);
}

header {
    background: linear-gradient(90deg, #2c3e50, #3498db);
    color: #ecf0f1;
    text-align: center;
    padding: 2rem;
}

header h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

main {
    min-width: 180vh;
    flex: 1;
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.input-section, .output-section {
    width: 48%;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

textarea {
    width: 100%;
    height: 200px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    resize: vertical;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

textarea:focus {
    border-color: #3498db;
    outline: none;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

button {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

select {
    border: 2px solid #3498db;
    padding: 0.7rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: #ecf0f1;
}

select:hover {
    border-color: #2980b9;
}

#result {
    background-color: white;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

#result:hover {
    transform: scale(1.02);
}

#generatedImage {
    max-width: 100%;
    max-height: 100%;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

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

#error {
    background-color: #ffebee;
    border-left: 4px solid #e74c3c;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    color: #e74c3c;
    text-align: center;
}

footer {  
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(90deg, #2c3e50, #3498db);
    color: #ecf0f1;
    margin-top: 2rem;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    .input-section, .output-section {
        width: 100%;
        margin-bottom: 2rem;
    }
}
