@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
    
:root {
    --light-bg: #1a1a2e;
    --container-bg: #1f1f38;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --border-color: #3c8ce7;
    --success-color: #38c172;
    --subtle-text: #a0a0a0;
}

.stylish-widget {
    background-color: var(--container-bg);
    color: var(--text-color);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 800px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease-in-out;
    box-sizing: border-box;
    position: relative;
}

.stylish-widget:hover {
    box-shadow: 0 15px 40px rgba(60, 140, 231, 0.2);
}

.widget-header h2 {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--heading-color);
    text-align: center;
}

.widget-header p {
    color: var(--subtle-text);
    font-size: 0.9em;
    margin-bottom: 20px;
    text-align: center;
}

.tab-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #3b3b58;
}

.tab-button {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--subtle-text);
    border: none;
    background: none;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button.active {
    color: var(--heading-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--heading-color);
}

.input-group textarea,
.input-group select,
.input-group input[type="number"] {
    width: 100%;
    padding: 12px;
    background-color: #252540;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.9em;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.input-group textarea:focus,
.input-group select:focus,
.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
}

.select-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.prompt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.prompt-buttons button {
    background-color: #3b3b58;
    color: var(--text-color);
    padding: 10px 16px;
    border: none;
    border-radius: 25px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prompt-buttons button:hover {
    background-color: #4f4f7a;
    transform: translateY(-2px);
}

.generate-btn, .copy-btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-size: 200% 200%;
    animation: gradientAnimation 10s ease infinite;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.copy-btn {
    background: linear-gradient(45deg, #6ee7b7, #34d399);
    font-size: 1em;
    padding: 12px 20px;
    margin-top: 15px;
    display: none;
}

.generate-btn:hover, .copy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.result-container {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

.placeholder-text {
    color: var(--subtle-text);
    font-size: 1em;
    line-height: 1.6;
}

#imageResult {
    display: none;
    width: 100%;
    text-align: center;
}

#imageEmbed {
    max-width: 100%;
    max-height: 500px;
    border-radius: 12px;
    margin: 20px auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: block;
    border: 1px solid var(--border-color);
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.download-btn {
    background-color: var(--success-color);
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    margin-top: 15px;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.download-btn:hover {
    background-color: #2f9d5c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.loading-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.spinner {
    border: 4px solid #3b3b58;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    font-style: italic;
    font-size: 1em;
    color: var(--subtle-text);
}

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

@media (min-width: 768px) {
    .stylish-widget {
        padding: 30px;
    }
    .widget-header h2 {
        font-size: 2em;
    }
    .widget-header p {
        font-size: 1em;
    }
    .select-group {
        grid-template-columns: repeat(2, 1fr);
    }
    .prompt-buttons button {
        padding: 12px 20px;
        font-size: 0.9em;
    }
}

@media (min-width: 1024px) {
    .select-group {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    }
}