:root {
    /* Modern gradient color palette */
    --primary-color: #6366f1;
    --primary-hover: #5b21b6;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --accent-hover: #0891b2;
    
    /* Background with subtle gradient */
    --background-color: #f8fafc;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --background-alt: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    /* Glassmorphism card - improved contrast */
    --card-background: rgba(248, 250, 252, 0.85);
    --card-backdrop: blur(20px);
    --card-border: rgba(255, 255, 255, 0.4);
    
    /* Enhanced text colors - better contrast */
    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-accent: #6366f1;
    
    /* Modern shadows */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --glow: 0 0 30px rgba(28, 29, 70, 0.4), 0 0 60px rgba(28, 29, 70, 0.4);
    
    /* Typography improvements */
    --font-family: 'Inter', 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --heading-font: 'Inter', 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Improved spacing scale */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Modern border radius */
    --border-radius: 1rem;
    --border-radius-lg: 1.5rem;
    --border-radius-xl: 2rem;
}

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

body {
    font-family: var(--font-family);
    background: var(--background-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Add animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(2deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    background: var(--card-background);
    backdrop-filter: var(--card-backdrop);
    -webkit-backdrop-filter: var(--card-backdrop);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    user-select: none;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: var(--shadow-lg), var(--glow);
    border-color: var(--primary-color);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle__icon {
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle__icon {
    transform: rotate(15deg);
}

/* Dark theme styles */
[data-theme="dark"] {
    --background-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-background: rgba(30, 41, 59, 0.9);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --card-border: rgba(148, 163, 184, 0.3);
    --glow: 0 0 25px rgba(99, 102, 241, 0.5), 0 0 50px rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] body::before {
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%);
}

[data-theme="dark"] .idea-card::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
}

.container {
    max-width: 42rem;
    margin: 0 auto;
    padding: var(--spacing-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    animation: slideInFromTop 0.8s ease-out;
}

.header__title {
    font-family: var(--heading-font);
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4338ca 0%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    position: relative;
}

.header__title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #4338ca 0%, #0891b2 100%);
    border-radius: 2px;
    animation: expandLine 1s ease-out 0.5s both;
}

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

@keyframes expandLine {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

.header__subtitle {
    font-size: 1rem;
    color: var(--text-primary);
    max-width: 36rem;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.7;
    opacity: 0.9;
}

.idea-card {
    background: var(--card-background);
    backdrop-filter: var(--card-backdrop);
    -webkit-backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    width: 100%;
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideInFromBottom 0.8s ease-out 0.2s both;
}

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

.idea-card:hover::before {
    left: 100%;
}

.idea-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl), var(--glow);
}

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

.idea-card__prompt {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.4;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
}

.buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    box-shadow: var(--shadow);
}

.btn::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.4s ease;
}

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

.btn--primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn--primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-xl), var(--glow);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--accent-color) 100%);
}

.btn--primary:active {
    transform: translateY(-1px) scale(1.01);
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    color: var(--primary-color);
}

.footer {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.footer__text {
    margin-bottom: var(--spacing-xs);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.footer__text:hover {
    opacity: 0.8;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* CSS-only random idea display */
.ideas-container {
    position: relative;
}

.idea-item {
    display: none;
}

.idea-item:first-child {
    display: block;
}

/* Enhanced animation for idea changes */
.idea-item {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Add a pulse animation for the idea text */
.idea-card__prompt {
    animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        padding: var(--spacing-xl);
    }

    .header__title {
        font-size: 4.5rem;
    }

    .header__subtitle {
        font-size: 0.95rem;
    }

    .idea-card__prompt {
        font-size: 2rem;
    }

    .buttons {
        gap: var(--spacing-md);
    }

    .btn {
        padding: 1.25rem 2.5rem;
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .header__title {
        font-size: 2.75rem;
    }

    .header__subtitle {
        font-size: 0.9rem;
    }

    .idea-card {
        padding: var(--spacing-xl);
        margin: var(--spacing-sm);
    }

    .idea-card__prompt {
        font-size: 1.5rem;
    }

    .buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 1.5rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

/* Automatic dark mode support (fallback) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --background-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        --card-background: rgba(30, 41, 59, 0.9);
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --card-border: rgba(148, 163, 184, 0.3);
    }
    
    :root:not([data-theme]) body::before {
        background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                    radial-gradient(circle at 40% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%);
    }
}
