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

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --glow: rgba(99, 102, 241, 0.5);
    --transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
    background: radial-gradient(circle at 20% 50%, var(--primary) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, var(--secondary) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, var(--accent) 0%, transparent 50%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(5deg); }
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
    opacity: 0.3;
    box-shadow: 0 0 10px var(--accent);
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-100px) translateX(50px); }
    50% { transform: translateY(-200px) translateX(-30px); }
    75% { transform: translateY(-100px) translateX(-70px); }
}

.container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Header Section */
header {
    text-align: center;
    margin-bottom: 6rem;
    animation: fadeInDown 1s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 4rem;
    animation: rotate3d 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--accent));
}

@keyframes rotate3d {
    0%, 100% { transform: rotateY(0deg) rotateX(0deg); }
    50% { transform: rotateY(180deg) rotateX(10deg); }
}

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: gradientFlow 3s ease infinite;
    background-size: 200% 200%;
}

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

.subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 300;
}

/* Theme Input Section */
.theme-input-section {
    background: var(--bg-card);
    border-radius: 30px;
    padding: 3rem;
    margin-bottom: 4rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 100px var(--glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 1s ease 0.3s both;
    backdrop-filter: blur(10px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

#themeInput {
    flex: 1;
    min-width: 300px;
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

#themeInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--glow);
    transform: translateY(-2px);
}

#themeInput::placeholder {
    color: var(--text-secondary);
}

.btn-primary {
    padding: 1.5rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.6);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-2px) scale(1.02);
}

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

/* Theme Tags */
.theme-tags {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.theme-tag {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.theme-tag::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary);
    transition: width 0.4s, height 0.4s, top 0.4s, left 0.4s;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.theme-tag:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--glow);
    border-color: var(--primary);
    color: white;
}

.theme-tag:hover::before {
    width: 300px;
    height: 300px;
}

/* Features Grid */
.features-section {
    margin-top: 5rem;
    animation: fadeInUp 1s ease 0.6s both;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Space Grotesk', sans-serif;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: var(--bg-card);
    border-radius: 25px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.5s;
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4),
                0 0 80px var(--glow);
}

.feature-card:hover::before {
    opacity: 0.1;
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px var(--primary));
    position: relative;
    z-index: 1;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.feature-card:hover .feature-icon {
    animation: spin 0.8s ease;
}

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

.feature-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
}

/* Gallery Section */
.gallery-section {
    margin-top: 5rem;
    animation: fadeInUp 1s ease 0.9s both;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    opacity: 0;
    transition: opacity 0.5s;
}

.gallery-item:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 20px 40px var(--glow);
}

.gallery-item:hover::before {
    opacity: 0.8;
}

.gallery-item span {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}

/* Loading State */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spinLoader {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Theme Classes */
body.cyberpunk {
    --primary: #ff006e;
    --secondary: #00f5ff;
    --accent: #ffbe0b;
    --bg-main: #0a0e27;
    --bg-card: #1a1f3a;
    --text-primary: #00f5ff;
    --glow: rgba(0, 245, 255, 0.6);
}

body.nature {
    --primary: #2d6a4f;
    --secondary: #52b788;
    --accent: #ffd60a;
    --bg-main: #081c15;
    --bg-card: #1b4332;
    --text-primary: #d8f3dc;
    --glow: rgba(82, 183, 136, 0.4);
}

body.ocean {
    --primary: #0077b6;
    --secondary: #00b4d8;
    --accent: #ff6d00;
    --bg-main: #03045e;
    --bg-card: #023e8a;
    --text-primary: #caf0f8;
    --glow: rgba(0, 180, 216, 0.5);
}

body.sunset {
    --primary: #ff6b35;
    --secondary: #f7931e;
    --accent: #c1121f;
    --bg-main: #1a0b2e;
    --bg-card: #371b58;
    --text-primary: #ffe5ec;
    --glow: rgba(255, 107, 53, 0.5);
}

body.neon {
    --primary: #ff00ff;
    --secondary: #00ff00;
    --accent: #ffff00;
    --bg-main: #000000;
    --bg-card: #1a001a;
    --text-primary: #ffffff;
    --glow: rgba(255, 0, 255, 0.8);
}

/* Success Message */
.success-msg {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.5s ease;
    font-weight: 600;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

    .theme-input-section {
        padding: 2rem 1.5rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    #themeInput {
        min-width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}