@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
    --primary-color: #673ab7;
    --accent-color: #7c4dff;
    --text-color: #333;
    --light-text-color: #f5f5f5;
    --border-color: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.main-container {
    width: 100%;
    max-width: 700px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    padding: 30px;
    text-align: center;
}

.app-header h1 { margin: 0; font-size: 2rem; color: var(--primary-color); }
.app-header p { margin: 5px 0 25px; color: #555; font-size: 1rem; }

.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border: 1px solid #ddd;
    border-radius: 12px;
    resize: none;
    background: rgba(255, 255, 255, 0.8);
    transition: box-shadow 0.3s;
}

textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.3);
}

button#generateButton {
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    background-image: linear-gradient(45deg, var(--accent-color), var(--primary-color));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

button#generateButton:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(103, 58, 183, 0.4);
}

button#generateButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result-section {
    min-height: 300px;
    border: 2px dashed #ccc;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    transition: border-color 0.3s;
}

.placeholder { color: #aaa; }
.placeholder i { font-size: 3rem; margin-bottom: 10px; }

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.image-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.image-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.download-button {
    text-decoration: none;
    padding: 12px 25px;
    background: #28a745;
    color: white;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}
.download-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}