:root {
    --bg-color: #050505;
    --card-bg: #111113;
    --card-border: #1f1f23;
    --text-main: #fcfcfc;
    --text-muted: #9ca3af;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --hover-bg: #18181b;

    --group-ui: #10b981;
    --group-logic: #f59e0b;
    --group-design: #0ea5e9;
    --group-charts: #f97316;
    --group-backend: #ef4444;

    --gradient: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Pro Background */
.blob {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
    animation: float 15s infinite alternate ease-in-out;
}

.blob-1 { top: -200px; right: -100px; }
.blob-2 { bottom: -200px; left: -100px; animation-delay: -7s; background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(0, 0, 0, 0) 70%); }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.1); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem; /* Reduced padding */
}

/* Header & Hero */
.hero {
    text-align: center;
    margin-bottom: 2rem; /* Reduced margin */
}

.gradient-text {
    font-size: 3rem; /* Slightly smaller */
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    letter-spacing: -1.5px;
}

.hero p { color: var(--text-muted); font-size: 1rem; margin-bottom: 1.5rem; }

.header-links { margin-top: 1rem; }

.pulse-glow {
    box-shadow: 0 0 15px var(--accent-glow);
    border-radius: 8px;
    display: inline-block;
}

/* Insights - Minimized Chart */
.insights-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.insight-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.5rem;
    border-radius: 12px;
    max-width: 450px; /* Force it small */
    width: 100%;
}

.star-chart-img {
    width: 100%;
    border-radius: 6px;
    display: block;
}

/* Controls - Tighter Layout */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
    align-items: center;
}

.search-box {
    width: 100%;
    max-width: 650px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: 0.3s;
}

#searchInput {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 3.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.search-hint {
    position: absolute;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: translateY(-2px);
}

#searchInput:focus + .search-hint {
    opacity: 0;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.2s;
}

.filter-btn:hover { background: var(--hover-bg); color: #fff; }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Stats */
.stats-container { margin-bottom: 1.5rem; }
.result-count { font-size: 0.8rem; color: var(--text-muted); opacity: 0.7; }

/* Grid & Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-main);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    background: #161619;
}

.card-header { margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; }
.ps-id { font-family: monospace; font-size: 0.7rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px; }

.difficulty-badge { font-size: 0.65rem; font-weight: 800; padding: 2px 8px; border-radius: 4px; }

.group-ui-dom-interactivity { background: rgba(16, 185, 129, 0.1); color: var(--group-ui); }
.group-logic-based-javascript-problems { background: rgba(245, 158, 11, 0.1); color: var(--group-logic); }
.group-html-css-design-based { background: rgba(14, 165, 233, 0.1); color: var(--group-design); }
.group-data-visualization-charts { background: rgba(249, 115, 22, 0.1); color: var(--group-charts); }
.group-backend-database { background: rgba(239, 68, 68, 0.1); color: var(--group-backend); }

.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.5; }

.btn-open {
    margin-top: auto;
    background: var(--hover-bg);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    transition: 0.2s;
}

.card:hover .btn-open { background: var(--accent); border-color: var(--accent); }

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
}

.scroll-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

@media (max-width: 640px) {
    .container { padding: 1rem; }
    .gradient-text { font-size: 2rem; }
    .projects-grid { grid-template-columns: 1fr; }
}