:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(99, 102, 241, 0.15);
    --glass-glow: rgba(99, 102, 241, 0.05);
    
    --text-main: #f8fafc;
    --text-sec: #94a3b8;
    
    --neon-cyan: #00f2fe;
    --neon-purple: #4f46e5;
    
    --input-bg: rgba(15, 23, 42, 0.8);
    --pill-bg: rgba(15, 23, 42, 0.5);
    --pill-border: rgba(255, 255, 255, 0.1);

    --gradient: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    --font-ui: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

[data-theme="light"] {
    --bg-color: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(79, 70, 229, 0.2);
    --glass-glow: rgba(79, 70, 229, 0.08);
    
    --text-main: #0f172a;
    --text-sec: #475569;
    
    --neon-cyan: #0ea5e9;
    --neon-purple: #6366f1;
    
    --input-bg: #ffffff;
    --pill-bg: #e2e8f0;
    --pill-border: rgba(0, 0, 0, 0.1);
    
    --gradient: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Background Effects */
#canvas-3d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: radial-gradient(circle at center, #111827 0%, #000000 100%);
    pointer-events: none;
}

.bg-grid {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: 50px 50px;
    background-image: linear-gradient(to right, rgba(99, 102, 241, 0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    z-index: -2;
    pointer-events: none;
}

/* Utils */
.hidden { display: none !important; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-5 { margin-top: 5rem; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.opacity-50 { opacity: 0.5; }
.text-secondary { color: var(--text-sec); }
.full-width { width: 100%; }

.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1), inset 0 0 20px var(--glass-glow);
    padding: 2.5rem;
    transition: background 0.3s, border-color 0.3s;
}

@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
    }
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.3s;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
}

.pulse-glow { color: var(--neon-purple); }

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

.nav-links a {
    color: var(--text-sec);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--neon-purple); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.usage-badge {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: var(--neon-purple);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}
.btn-icon:hover { color: var(--neon-cyan); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--neon-purple);
}

.user-profile #logout-btn {
    background: none;
    border: none;
    color: var(--text-sec);
    cursor: pointer;
}
.user-profile #logout-btn:hover { color: #f43f5e; }

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    padding-top: 100px;
}

.page-container {
    max-width: 800px;
    min-height: 70vh;
    padding-top: 140px;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0 4rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 100px;
    color: var(--neon-purple);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.hero p {
    color: var(--text-sec);
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Generator Form */
.generator-section {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 5rem;
}

.card-header { margin-bottom: 2rem; }

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

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

input[type="text"] {
    width: 100%;
    padding: 1rem 1.2rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
}

/* Custom Pills for Options instead of Select */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.pill-group input[type="radio"] {
    display: none; /* Hide standard radio buttons */
}

.pill-group label {
    margin-bottom: 0;
    padding: 0.8rem 1.2rem;
    background: var(--pill-bg);
    border: 1px solid var(--pill-border);
    border-radius: 100px;
    color: var(--text-sec);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pill-group label:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--neon-purple);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Checked state styling for labels */
.pill-group input[type="radio"]:checked + label {
    background: var(--neon-purple);
    color: white;
    border-color: var(--neon-purple);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

/* Button */
.btn-glow {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    color: #fff;
    padding: 1.2rem;
    border-radius: 10px;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--text-sec);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-ui);
    font-weight: 600;
}

.btn-ghost:hover {
    background: rgba(100,100,100,0.1);
}

/* Ads */
/* Ad Wrapper for Better Mobile Experience */
.ad-card-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    overflow: hidden;
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
}

.ad-label-top {
    font-size: 0.7rem;
    color: var(--text-sec);
    text-align: center;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.ad-container-inner {
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .ad-card-wrapper {
        padding: 1rem;
        margin: 1.5rem 0;
    }
}

/* Loading */
.loading-container { text-align: center; margin: 4rem 0; }
.cyber-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid transparent;
    border-top-color: var(--neon-cyan);
    border-right-color: var(--neon-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.section-heading {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media(min-width: 800px) {
    .results-grid { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
}

.platform-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.output-block { margin-bottom: 1.5rem; }

.label {
    display: inline-block;
    color: var(--text-sec);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.content-box {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1.2rem;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
}

.content-box::-webkit-scrollbar { width: 6px; }
.content-box::-webkit-scrollbar-track { background: transparent; }
.content-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
[data-theme="dark"] .content-box::-webkit-scrollbar-thumb { background: #334155; }

/* Sub Page Content / Unified features */
.page-content p {
    color: var(--text-sec);
    line-height: 1.8;
}
.page-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.features-section, .about-section, .contact-section, .donate-section {
    margin-bottom: 5rem;
}

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

.feature-card { padding: 2.5rem; }
.feature-icon {
    font-size: 2rem;
    color: var(--neon-purple);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}
.feature-card p {
    color: var(--text-sec);
}

.support-email {
    display: inline-block;
    color: var(--neon-purple);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1.2rem;
    font-weight: 600;
}
.support-email:hover { color: var(--neon-cyan); }

.hover-scale { transition: transform 0.3s ease; }
.hover-scale:hover { transform: scale(1.05); }

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    border-bottom: none; border-left: none; border-right: none;
    border-radius: 0;
}

@media (max-width: 768px) {
    .footer {
        padding: 2rem 1rem;
    }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s;
}
.modal-overlay.hidden {
    opacity: 0; pointer-events: none;
}

.modal-content {
    max-width: 400px;
    width: 90%;
    text-align: center;
    background: var(--card-bg);
}

.border-glow {
    border: 1px solid rgba(79, 70, 229, 0.5);
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.2);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(150,150,150,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient);
    transition: width 0.3s ease;
}

/* Sidebar Ads */
.sidebar-ad {
    position: fixed;
    top: 100px;
    z-index: 10;
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ad-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-sec);
    letter-spacing: 1px;
}

.left-sidebar { left: 20px; }
.right-sidebar { right: 20px; }

@media (min-width: 1400px) {
    .sidebar-ad { display: flex; }
}

@media (max-width: 1399px) {
    .sidebar-ad { display: none !important; }
}

@media(max-width: 768px) {
    .navbar { 
        flex-direction: column; 
        padding: 0.8rem 1rem; 
        gap: 0.8rem; 
        position: relative; /* Avoid overlapping hero too much if needed, or keep fixed */
    }
    .logo { font-size: 1.3rem; }
    .nav-links { 
        gap: 0.8rem; 
        font-size: 0.8rem; 
        flex-wrap: wrap; 
        justify-content: center; 
        width: 100%; 
        order: 3;
    }
    .nav-right {
        width: 100%;
        justify-content: center;
        gap: 0.8rem;
    }
    .usage-badge { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
    
    main {
        padding-top: 20px; /* Offset because navbar is now relative or taller */
    }
}

/* Idea Generator Items */
.ideas-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.idea-item-card {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border-left: 4px solid var(--neon-purple);
}

.idea-item-card:hover {
    transform: translateX(5px);
    background: rgba(79, 70, 229, 0.05);
    border-color: var(--neon-purple);
}

.idea-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.idea-number {
    background: var(--neon-purple);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.idea-item-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.idea-explanation {
    color: var(--text-sec);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.btn-copy-idea {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: var(--neon-purple);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy-idea:hover {
    background: var(--neon-purple);
    color: white;
}
