        @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Inter", sans-serif;
        }

        :root {
            --primary-color: #6366f1;
            --primary-dark: #4f46e5;
            --secondary-color: #ec4899;
            --accent-color: #06b6d4;
            --dark-bg: #0a0e27;
            --darker-bg: #050812;
            --card-bg: #1a1f3a;
            --card-hover: #252d47;
            --text-primary: #f8fafc;
            --text-secondary: #a0aec0;
            --border-color: #2d3748;
            --success-color: #10b981;
            --error-color: #ef4444;
            --warning-color: #f59e0b;
        }

        body {
            background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
            color: var(--text-primary);
            line-height: 1.6;
            min-height: 100vh;
        }

        /* Navigation */
        .navbar {
            background: rgba(10, 14, 39, 0.7);
            backdrop-filter: blur(20px);
            padding: 1.2rem 0;
            position: fixed;
            top: 0;
            width: 100%;
            z-index: 1000;
            border-bottom: 1px solid rgba(99, 102, 241, 0.15);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        }

        .nav-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 2rem;
        }

        .navbar h2 {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            font-size: 1.5rem;
            letter-spacing: -0.5px;
        }

        .nav-links {
            display: flex;
            gap: 2.5rem;
        }

        .nav-links a {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.95rem;
            font-weight: 500;
            transition: all 0.3s ease;
            position: relative;
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: -6px;
            left: 0;
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
            transition: width 0.3s ease;
        }

        .nav-links a:hover {
            color: var(--text-primary);
        }

        .nav-links a:hover::after {
            width: 100%;
        }

        /* Header Section */
        .image-generator {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #0f172a 0%, #1a1f3a 100%);
            position: relative;
            overflow: hidden;
            padding-top: 100px;
        }

        .image-generator::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
            pointer-events: none;
        }

        .image-generator::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(0deg, rgba(10, 14, 39, 0.3) 0%, transparent 50%);
        }

        .content {
            position: relative;
            text-align: center;
            max-width: 900px;
            padding: 0 2rem;
            z-index: 2;
        }

        .content h1 {
            font-size: 3.8rem;
            font-weight: 800;
            margin-bottom: 1.2rem;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            line-height: 1.1;
            letter-spacing: -1px;
        }

        .content p {
            font-size: 1.15rem;
            color: var(--text-secondary);
            margin-bottom: 3rem;
            font-weight: 400;
        }

        /* Form Styling */
        .generate-form {
            background: linear-gradient(135deg, rgba(26, 31, 58, 0.6), rgba(37, 45, 71, 0.4));
            padding: 2.5rem;
            border-radius: 16px;
            border: 1px solid rgba(99, 102, 241, 0.2);
            backdrop-filter: blur(10px);
            margin-bottom: 2rem;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
        }

        .input-container {
            position: relative;
            margin-bottom: 1.5rem;
        }

        .prompt-input {
            width: 100%;
            padding: 1rem 1.5rem;
            font-size: 1rem;
            background: rgba(10, 14, 39, 0.5);
            border: 2px solid var(--border-color);
            border-radius: 12px;
            color: var(--text-primary);
            transition: all 0.3s ease;
            resize: vertical;
            min-height: 70px;
        }

        .prompt-input::placeholder {
            color: rgba(160, 174, 192, 0.6);
        }

        .prompt-input:focus {
            outline: none;
            border-color: var(--primary-color);
            background: rgba(10, 14, 39, 0.7);
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
        }

        .char-count {
            position: absolute;
            right: 15px;
            bottom: 15px;
            font-size: 0.8rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .controls {
            display: grid;
            grid-template-columns: 1fr 1fr 2fr;
            gap: 1.2rem;
            align-items: center;
        }

        .style-selector, .size-selector {
            padding: 1rem;
            background: rgba(10, 14, 39, 0.5);
            border: 2px solid var(--border-color);
            border-radius: 10px;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .style-selector:hover, .size-selector:hover {
            border-color: var(--primary-color);
            background: rgba(10, 14, 39, 0.7);
        }

        .style-selector:focus, .size-selector:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
        }

        .generate-btn {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            border: none;
            padding: 1rem 2.5rem;
            border-radius: 10px;
            color: white;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.6rem;
            box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
        }

        .generate-btn:hover:not(:disabled) {
            transform: translateY(-3px);
            box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4);
        }

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

        .generate-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        /* Quick Prompts */
        .quick-prompts {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            align-items: center;
            justify-content: center;
            margin-top: 2.5rem;
        }

        .quick-prompts span {
            color: var(--text-secondary);
            font-size: 0.9rem;
            font-weight: 500;
        }

        .prompt-tag {
            background: rgba(26, 31, 58, 0.6);
            border: 1px solid rgba(99, 102, 241, 0.2);
            color: var(--text-primary);
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .prompt-tag:hover {
            background: var(--primary-color);
            border-color: var(--primary-color);
            transform: translateY(-2px);
        }

        /* Gallery */
        .image-gallery {
            padding: 5rem 2rem;
            max-width: 1400px;
            margin: 0 auto;
        }

        .gallery-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 3rem;
        }

        .gallery-header h2 {
            font-size: 2.2rem;
            color: var(--text-primary);
            font-weight: 700;
        }

        .gallery-controls {
            display: flex;
            gap: 1rem;
        }

        .clear-gallery, .download-all {
            background: rgba(26, 31, 58, 0.6);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
            padding: 0.7rem 1.5rem;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.6rem;
            font-weight: 500;
        }

        .clear-gallery:hover {
            background: var(--error-color);
            border-color: var(--error-color);
            transform: translateY(-2px);
        }

        .download-all:hover {
            background: var(--success-color);
            border-color: var(--success-color);
            transform: translateY(-2px);
        }

        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 2rem;
        }

        .img-card {
            background: var(--card-bg);
            border-radius: 12px;
            overflow: hidden;
            border: 1px solid var(--border-color);
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            position: relative;
        }

        .img-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 25px 50px rgba(99, 102, 241, 0.2);
            border-color: rgba(99, 102, 241, 0.3);
        }

        .img-card img {
            width: 100%;
            height: 280px;
            object-fit: cover;
            transition: transform 0.4s ease;
        }

        .img-card:hover img {
            transform: scale(1.05);
        }

        .img-card.loading {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 280px;
            background: rgba(26, 31, 58, 0.5);
        }

        .loading-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }

        .loading-content p {
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
            font-weight: 500;
        }

        .progress-bar {
            width: 180px;
            height: 5px;
            background: rgba(99, 102, 241, 0.1);
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
            animation: progress 2s ease-in-out infinite;
            border-radius: 3px;
        }

        @keyframes progress {
            0% { width: 0%; }
            50% { width: 70%; }
            100% { width: 100%; }
        }

        .card-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(10, 14, 39, 0.95) 100%);
            padding: 1.5rem;
            transform: translateY(100%);
            transition: transform 0.4s ease;
        }

        .img-card:hover .card-overlay {
            transform: translateY(0);
        }

        .card-prompt {
            color: var(--text-primary);
            font-size: 0.9rem;
            margin-bottom: 1rem;
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            font-weight: 500;
        }

        .card-actions {
            display: flex;
            gap: 0.6rem;
            justify-content: center;
        }

        .action-btn {
            background: var(--primary-color);
            border: none;
            color: white;
            padding: 0.6rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
        }

        .action-btn:hover {
            background: var(--secondary-color);
            transform: translateY(-2px);
        }

        .gallery-empty {
            text-align: center;
            padding: 5rem 2rem;
            color: var(--text-secondary);
            grid-column: 1 / -1;
        }

        .gallery-empty i {
            font-size: 4.5rem;
            margin-bottom: 1.5rem;
            opacity: 0.4;
        }

        /* Settings Panel */
        .settings-panel {
            position: fixed;
            top: 0;
            right: -400px;
            width: 400px;
            height: 100vh;
            background: linear-gradient(180deg, var(--card-bg) 0%, var(--dark-bg) 100%);
            border-left: 1px solid var(--border-color);
            transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            z-index: 1001;
            padding: 2rem;
            overflow-y: auto;
            box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
        }

        .settings-panel.active {
            right: 0;
        }

        .close-settings {
            position: absolute;
            top: 1.5rem;
            right: 1.5rem;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
        }

        .close-settings:hover {
            color: var(--error-color);
            background: rgba(239, 68, 68, 0.1);
        }

        .settings-content h3 {
            margin-bottom: 2.5rem;
            color: var(--text-primary);
            font-size: 1.3rem;
            font-weight: 700;
        }

        .setting-group {
            margin-bottom: 2rem;
        }

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

        .setting-group input, .setting-group select {
            width: 100%;
            padding: 0.9rem;
            background: rgba(10, 14, 39, 0.5);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-primary);
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .setting-group input:focus, .setting-group select:focus {
            outline: none;
            border-color: var(--primary-color);
            background: rgba(10, 14, 39, 0.7);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
        }

        #save-key {
            width: 100%;
            padding: 1rem;
            margin-top: 1.5rem;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            border: none;
            border-radius: 8px;
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 1rem;
        }

        #save-key:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
        }

        #save-key:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* Notifications */
        .notification {
            position: fixed;
            top: 100px;
            right: 2rem;
            background: var(--card-bg);
            border: 2px solid;
            padding: 1.2rem 1.5rem;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 0.8rem;
            z-index: 2000;
            opacity: 0;
            transform: translateX(400px);
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            max-width: 400px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
            font-weight: 500;
        }

        .notification.show {
            opacity: 1;
            transform: translateX(0);
        }

        .notification.error {
            border-color: var(--error-color);
            color: var(--error-color);
        }

        .notification.success {
            border-color: var(--success-color);
            color: var(--success-color);
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .content h1 {
                font-size: 2.2rem;
            }
            
            .content p {
                font-size: 1rem;
            }
            
            .controls {
                grid-template-columns: 1fr;
            }
            
            .gallery-header {
                flex-direction: column;
                gap: 1.5rem;
                align-items: flex-start;
            }
            
            .nav-container {
                padding: 0 1rem;
            }
            
            .nav-links {
                display: none;
            }
            
            .settings-panel {
                width: 100%;
                right: -100%;
            }
            
            .gallery-grid {
                grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
                gap: 1.5rem;
            }
            
            .generate-form {
                padding: 1.5rem;
            }
        }