 :root {
            --primary: #8b5cf6;
            --primary-dark: #7c3aed;
            --primary-light: #a78bfa;
            --secondary: #f0abfc;
            --accent: #f59e0b;
            --light: #f8fafc;
            --dark: #1e293b;
            --gray: #64748b;
            --success: #10b981;
            --danger: #ef4444;
            --radius: 16px;
            --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
            --gradient: linear-gradient(135deg, var(--primary), var(--primary-light));
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            color: var(--light);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
        }

        header {
            text-align: center;
            padding: 40px 20px 30px;
            margin-bottom: 30px;
        }

        .premium-badge {
            display: inline-block;
            background: linear-gradient(90deg, var(--accent), #f59e0b);
            color: var(--dark);
            padding: 8px 24px;
            border-radius: 50px;
            font-weight: 700;
            font-size: 0.9rem;
            margin-bottom: 20px;
            box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
            letter-spacing: 0.5px;
        }

        h1 {
            font-size: 3.2rem;
            background: linear-gradient(90deg, var(--primary-light), var(--secondary));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            margin-bottom: 15px;
            font-weight: 800;
        }

        .subtitle {
            font-size: 1.2rem;
            color: #cbd5e1;
            max-width: 700px;
            margin: 0 auto;
            line-height: 1.6;
        }

        .main-app {
            display: grid;
            grid-template-columns: 1fr 1.2fr;
            gap: 30px;
            margin-bottom: 40px;
        }

        @media (max-width: 1024px) {
            .main-app {
                grid-template-columns: 1fr;
                gap: 25px;
            }
        }

        .card {
            background: rgba(30, 41, 59, 0.8);
            backdrop-filter: blur(10px);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 30px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            transition: transform 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-lg);
        }

        .card-header {
            display: flex;
            align-items: center;
            margin-bottom: 25px;
            padding-bottom: 20px;
            border-bottom: 2px solid rgba(139, 92, 246, 0.3);
        }

        .card-icon {
            width: 56px;
            height: 56px;
            background: var(--gradient);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 18px;
            color: white;
            font-size: 1.8rem;
        }

        .card-title {
            font-size: 1.8rem;
            font-weight: 700;
            color: white;
        }

        .input-group {
            margin-bottom: 25px;
        }

        label {
            display: block;
            font-weight: 600;
            margin-bottom: 12px;
            color: #e2e8f0;
            font-size: 1.1rem;
        }

        textarea {
            width: 100%;
            min-height: 140px;
            padding: 20px;
            background: rgba(15, 23, 42, 0.7);
            border: 2px solid rgba(139, 92, 246, 0.2);
            border-radius: var(--radius);
            color: white;
            font-size: 1.1rem;
            resize: vertical;
            transition: all 0.3s;
            line-height: 1.5;
        }

        textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
        }

        textarea::placeholder {
            color: #94a3b8;
        }

        .controls-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 25px;
        }

        .control-group {
            margin-bottom: 5px;
        }

        select, input[type="range"] {
            width: 100%;
            padding: 14px 18px;
            background: rgba(15, 23, 42, 0.7);
            border: 2px solid rgba(139, 92, 246, 0.2);
            border-radius: var(--radius);
            color: white;
            font-size: 1rem;
            cursor: pointer;
        }

        select:focus, input[type="range"]:focus {
            outline: none;
            border-color: var(--primary);
        }

        option {
            background: #1e293b;
            color: white;
        }

        .range-value {
            display: block;
            text-align: center;
            font-weight: 600;
            margin-top: 8px;
            color: var(--primary-light);
            font-size: 1.1rem;
        }

        .style-presets {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-top: 15px;
        }

        .style-btn {
            padding: 10px 18px;
            background: rgba(139, 92, 246, 0.1);
            border: 2px solid rgba(139, 92, 246, 0.3);
            border-radius: 50px;
            color: #cbd5e1;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .style-btn:hover {
            background: rgba(139, 92, 246, 0.2);
            color: white;
        }

        .style-btn.active {
            background: var(--gradient);
            color: white;
            border-color: var(--primary);
        }

        .btn {
            padding: 18px 30px;
            background: var(--gradient);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-size: 1.2rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            width: 100%;
            margin-top: 10px;
            letter-spacing: 0.5px;
        }

        .btn:hover:not(:disabled) {
            transform: translateY(-3px);
            box-shadow: 0 15px 30px rgba(139, 92, 246, 0.3);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .btn-secondary {
            background: rgba(100, 116, 139, 0.2);
            border: 2px solid rgba(100, 116, 139, 0.4);
        }

        .btn-secondary:hover:not(:disabled) {
            background: rgba(100, 116, 139, 0.3);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        }

        .image-container {
            width: 100%;
            min-height: 500px;
            background: rgba(15, 23, 42, 0.7);
            border-radius: var(--radius);
            border: 2px dashed rgba(139, 92, 246, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
            margin-bottom: 25px;
        }

        #generatedImage {
            max-width: 100%;
            max-height: 500px;
            border-radius: var(--radius);
            display: none;
        }

        .placeholder-content {
            text-align: center;
            padding: 40px;
            color: #94a3b8;
        }

        .placeholder-icon {
            font-size: 4rem;
            margin-bottom: 20px;
            color: rgba(139, 92, 246, 0.3);
        }

        .loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(15, 23, 42, 0.95);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 10;
            border-radius: var(--radius);
            display: none;
        }

        .loading-spinner {
            width: 70px;
            height: 70px;
            border: 5px solid rgba(139, 92, 246, 0.2);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 25px;
        }

        .loading-text {
            font-size: 1.3rem;
            color: var(--primary-light);
            font-weight: 600;
        }

        .loading-details {
            margin-top: 15px;
            color: #cbd5e1;
            text-align: center;
            max-width: 300px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .image-actions {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .action-btn {
            padding: 15px;
            background: rgba(30, 41, 59, 0.8);
            border: 2px solid rgba(139, 92, 246, 0.2);
            border-radius: var(--radius);
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .action-btn:hover {
            background: rgba(139, 92, 246, 0.2);
            transform: translateY(-2px);
        }

        .gallery-container {
            margin-top: 40px;
        }

        .gallery-title {
            font-size: 1.8rem;
            margin-bottom: 25px;
            color: white;
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 25px;
        }

        .gallery-item {
            background: rgba(30, 41, 59, 0.8);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: transform 0.3s;
        }

        .gallery-item:hover {
            transform: translateY(-8px);
            box-shadow: var(--shadow-lg);
        }

        .gallery-img {
            width: 100%;
            height: 200px;
            object-fit: cover;
        }

        .gallery-prompt {
            padding: 20px;
            font-size: 0.95rem;
            color: #cbd5e1;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            margin-top: 50px;
            margin-bottom: 50px;
        }

        .feature-card {
            background: rgba(30, 41, 59, 0.8);
            border-radius: var(--radius);
            padding: 30px;
            box-shadow: var(--shadow);
            border: 1px solid rgba(139, 92, 246, 0.2);
        }

        .feature-icon {
            width: 70px;
            height: 70px;
            background: var(--gradient);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 25px;
            color: white;
            font-size: 2rem;
        }

        .feature-title {
            font-size: 1.5rem;
            margin-bottom: 15px;
            color: white;
        }

        .feature-desc {
            color: #cbd5e1;
            line-height: 1.6;
        }

        footer {
            text-align: center;
            padding: 40px 20px;
            margin-top: 50px;
            color: #94a3b8;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            font-size: 0.95rem;
        }

        .notification {
            position: fixed;
            top: 30px;
            right: 30px;
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(10px);
            padding: 20px 25px;
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            gap: 15px;
            z-index: 1000;
            transform: translateX(150%);
            transition: transform 0.4s ease;
            border-left: 5px solid var(--success);
            max-width: 400px;
        }

        .notification.show {
            transform: translateX(0);
        }

        .notification-icon {
            width: 40px;
            height: 40px;
            background: var(--success);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.2rem;
        }

        .notification.error {
            border-left-color: var(--danger);
        }

        .notification.error .notification-icon {
            background: var(--danger);
        }

        @media (max-width: 768px) {
            h1 {
                font-size: 2.5rem;
            }
            
            .main-app {
                padding: 0 10px;
            }
            
            .card {
                padding: 20px;
            }
            
            .image-container {
                min-height: 400px;
            }
            
            .notification {
                top: 20px;
                right: 20px;
                left: 20px;
                transform: translateY(-150%);
                max-width: none;
            }
            
            .notification.show {
                transform: translateY(0);
            }
        }

        /* Progress bar */
        .progress-container {
            width: 100%;
            height: 8px;
            background: rgba(139, 92, 246, 0.1);
            border-radius: 10px;
            margin-top: 15px;
            overflow: hidden;
            display: none;
        }

        .progress-bar {
            height: 100%;
            background: var(--gradient);
            border-radius: 10px;
            width: 0%;
            transition: width 0.3s;
        }

        /* Model selector */
        .model-selector {
            display: flex;
            gap: 15px;
            margin-top: 15px;
            flex-wrap: wrap;
        }

        .model-btn {
            padding: 12px 20px;
            background: rgba(15, 23, 42, 0.7);
            border: 2px solid rgba(139, 92, 246, 0.3);
            border-radius: var(--radius);
            color: #cbd5e1;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            flex: 1;
            min-width: 120px;
            text-align: center;
        }

        .model-btn:hover {
            background: rgba(139, 92, 246, 0.1);
            color: white;
        }

        .model-btn.active {
            background: rgba(139, 92, 246, 0.2);
            border-color: var(--primary);
            color: white;
        }