:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 40%);
}

/* Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; padding: 12px 28px; border-radius: 50px; text-decoration: none;
    font-weight: 600; border: none; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px var(--primary-glow); }
.hidden { display: none !important; }

/* Header */
header {
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid var(--glass-border);
}
nav { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: white; text-decoration: none; }
.logo img { height: 32px; border-radius: 6px; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--text-muted); text-decoration: none; transition: color 0.3s; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active-link { color: var(--primary); }

/* Hero Section */
.hero { text-align: center; padding: 60px 0 30px; }
.hero h1 { 
    font-size: 3rem; margin-bottom: 15px; letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}
.hero p { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 30px; }

/* Search Bar */
.search-wrapper { max-width: 700px; margin: 0 auto 30px; position: relative; }
.search-input {
    width: 100%; padding: 16px 25px; border-radius: 50px; border: 1px solid var(--glass-border);
    background: var(--bg-card); color: white; font-size: 1rem; outline: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); transition: border-color 0.3s, box-shadow 0.3s;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }

/* --- SMART CATEGORY FILTERS (The Fix) --- */
.filters { 
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin: 20px 0 30px; 
}

.filter-tag {
    padding: 8px 18px; 
    background: rgba(255,255,255,0.05); 
    border-radius: 20px;
    font-size: 0.9rem; 
    cursor: pointer; 
    border: 1px solid var(--glass-border); 
    transition: all 0.2s;
    white-space: nowrap; /* Prevents text breaking inside button */
}
.filter-tag:hover { background: rgba(255,255,255,0.1); }
.filter-tag.active { 
    background: var(--primary); 
    border-color: var(--primary); 
    color: white; 
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* --- RESPONSIVE GRID --- */
.prompt-grid {
    display: grid; 
    /* Desktop: Auto fit columns */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 25px; 
    padding: 20px 0 40px;
}

.prompt-card {
    background: var(--bg-card); 
    border: 1px solid var(--glass-border); 
    border-radius: 16px;
    padding: 24px; 
    transition: transform 0.2s, border-color 0.2s; 
    display: flex; 
    flex-direction: column;
    height: 100%;
}

.prompt-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.card-cat { 
    font-size: 0.75rem; color: var(--secondary); text-transform: uppercase; 
    letter-spacing: 1px; font-weight: 700; margin-bottom: 12px; 
}
.card-title { 
    font-size: 1.15rem; margin-bottom: 12px; font-weight: 600; line-height: 1.4;
    color: #fff;
}
.card-text { 
    color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; flex-grow: 1; 
    line-height: 1.6;
    /* Limit text to 4 lines */
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; 
}
.copy-btn {
    width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05); color: white; cursor: pointer; transition: background 0.2s;
    font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.copy-btn:hover { background: rgba(255,255,255,0.1); }

/* Founder Section */
.founder-section { background: rgba(0,0,0,0.2); padding: 80px 0; margin-top: 60px; border-top: 1px solid var(--glass-border); }
.founder-content { display: flex; align-items: center; gap: 40px; }
.founder-img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); }
.founder-info h2 { font-size: 2rem; margin-bottom: 10px; }
.founder-role { color: var(--primary); font-weight: 600; margin-bottom: 15px; display: block; letter-spacing: 1px; font-size: 0.9rem;}

/* Footer */
footer { padding: 50px 0; border-top: 1px solid var(--glass-border); margin-top: 50px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; flex-wrap: wrap;}
.footer-links a { color: var(--text-muted); text-decoration: none; }

/* --- MOBILE OPTIMIZATION (The Magic) --- */
@media (max-width: 768px) {
    /* 1. Hero Adjustments */
    .hero { padding: 40px 0 20px; }
    .hero h1 { font-size: 2.2rem; }
    
    /* 2. Scrollable Filters (Netflix Style) */
    .filters {
        justify-content: flex-start; /* Align left */
        flex-wrap: nowrap; /* Don't stack buttons */
        overflow-x: auto; /* Allow horizontal scroll */
        padding-bottom: 15px; /* Space for scrollbar */
        padding-left: 5px; /* Visual padding */
        
        /* Hide Scrollbar for cleaner look */
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
        
        /* Smooth Scrolling */
        -webkit-overflow-scrolling: touch;
        
        /* Fade effect on right side to indicate more content */
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
    }
    
    /* Hide scrollbar Webkit */
    .filters::-webkit-scrollbar { display: none; }

    .filter-tag {
        flex: 0 0 auto; /* Prevent buttons from shrinking */
        padding: 8px 16px;
    }

    /* 3. Grid Adjustments */
    .prompt-grid {
        grid-template-columns: 1fr; /* 1 Column on Mobile */
        gap: 20px;
    }

    /* 4. Founder Section */
    .founder-content { flex-direction: column; text-align: center; gap: 20px; }
    
    /* 5. Navigation */
    .nav-links { display: none; } /* Consider adding a hamburger menu later */
    
    /* 6. General Padding */
    .container { padding: 0 15px; }
}

/* Tablet Tweaks */
@media (min-width: 769px) and (max-width: 1024px) {
    .prompt-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 Columns on Tablet */
    }
}
