:root {
    --bg-color: #0f111a;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-secondary: #ec4899;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Background Animated Orbs */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(139,92,246,0.4) 0%, rgba(0,0,0,0) 70%);
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(236,72,153,0.3) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -5s;
}

.orb-3 {
    top: 30%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(56,189,248,0.2) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 10%) scale(1.1); }
    100% { transform: translate(-5%, 5%) scale(0.9); }
}

.container {
    max-width: 900px;
    width: 100%;
    padding: 4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Header */
.header {
    text-align: center;
    margin-top: 1rem;
}

.title {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title .highlight {
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Generator Form */
.generator-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.generate-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.1rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.input-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.options-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.half-width {
    flex: 1;
    min-width: 250px;
}

.custom-select {
    position: relative;
    width: 100%;
}

.style-select {
    width: 100%;
    appearance: none;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.style-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.style-select option {
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding: 1rem;
}

.custom-select::after {
    content: "▼";
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.8rem;
}

.generate-btn {
    position: relative;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 16px;
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.5);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Button Loading Spinner */
.loader-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    right: 2rem;
}

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

/* Result Area */
.result-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.result-wrapper.show {
    opacity: 1;
    transform: translateY(0);
}

.image-container {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    position: relative;
}

.generated-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; filter: blur(10px); }
    to { opacity: 1; filter: blur(0); }
}

/* Download Button */
.action-buttons {
    display: flex;
    width: 100%;
    justify-content: center;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Error Message */
.error-message {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 1rem 1.5rem;
    text-align: left;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title { font-size: 3rem; }
    .container { padding: 2rem 1rem; }
    .glass-panel { padding: 1.5rem; }
}
