:root {
    --bg-dark: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --neon-green: #00ffa3;
    --neon-red: #ff4d4d;
    --neon-blue: #00d2ff;
    --text-main: #ffffff;
    --text-muted: #888888;
    --font-heading: 'Space Mono', monospace;
    --font-body: 'Outfit', sans-serif;
}

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

/* Mouse Follower */
#cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 255, 163, 0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    mix-blend-mode: screen;
    transition: width 0.2s, height 0.2s;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Effects */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            linear-gradient(var(--glass-border) 1px, transparent 1px),
            linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

.background-glob {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 255, 163, 0.08) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    animation: float 10s ease-in-out infinite;
}

/* Typography & Header */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

h1.glitch {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    position: relative;
    text-transform: uppercase;
}

h1.glitch::before,
h1.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

h1.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--neon-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

h1.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--neon-blue);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(100px, 9999px, 83px, 0);
    }

    20% {
        clip: rect(32px, 9999px, 8px, 0);
    }

    40% {
        clip: rect(74px, 9999px, 20px, 0);
    }

    60% {
        clip: rect(11px, 9999px, 53px, 0);
    }

    80% {
        clip: rect(39px, 9999px, 78px, 0);
    }

    100% {
        clip: rect(62px, 9999px, 12px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(57px, 9999px, 86px, 0);
    }

    20% {
        clip: rect(33px, 9999px, 16px, 0);
    }

    40% {
        clip: rect(5px, 9999px, 34px, 0);
    }

    60% {
        clip: rect(87px, 9999px, 24px, 0);
    }

    80% {
        clip: rect(20px, 9999px, 51px, 0);
    }

    100% {
        clip: rect(6px, 9999px, 26px, 0);
    }
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Search Interface */
.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-container input {
    width: 100%;
    padding: 1.2rem 3rem 1.2rem 1.5rem;
    padding-right: 4rem;
    /* Fix for long placeholders */
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1.1rem;
    outline: none;
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-container:focus-within {
    border-color: var(--neon-green);
    box-shadow: 0 0 20px rgba(0, 255, 163, 0.1);
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
}

.filter-btn.active {
    background: rgba(0, 255, 163, 0.1);
    border-color: var(--neon-green);
    color: var(--neon-green);
}

/* Stats */
/* Stats & Chart */
.stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.chart-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
}

.pie-chart {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    /* Center inner circle */
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.pie-chart svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: visible;
}

.pie-segment {
    cursor: pointer;
    transform-origin: 100px 100px;
    transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.pie-segment:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.chart-center {
    width: 80%;
    height: 80%;
    background: var(--bg-dark);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    z-index: 2;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.chart-center:hover {
    transform: scale(1.05);
    background: rgba(0, 255, 163, 0.05);
}

.chart-center span {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.chart-center small {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.stats-legend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.legend-text {
    display: flex;
    flex-direction: column;
}

.l-count {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.l-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Dot Colors using vars */
.text-green-bg {
    background: var(--neon-green);
    color: var(--neon-green);
}

.text-amber-bg {
    background: #ffb700;
    color: #ffb700;
}

.text-red-bg {
    background: var(--neon-red);
    color: var(--neon-red);
}

.text-blue-bg {
    background: var(--neon-blue);
    color: var(--neon-blue);
}

.text-green {
    color: var(--neon-green);
}

.text-red {
    color: var(--neon-red);
}

.text-blue {
    color: var(--neon-blue);
}

.text-amber {
    color: #ffb700;
}

/* Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Product Card */
/* Animations */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;

    /* Animation defaults */
    opacity: 0;
    animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--glass-border);
    z-index: 2;
}

.card-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.card-category:hover {
    background: var(--neon-green);
    color: #000;
}

.highlight {
    background: var(--neon-green);
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
}

.product-card.status-pass {
    border-left: 4px solid var(--neon-green);
}

.product-card.status-fail {
    border-left: 4px solid var(--neon-red);
}

.product-card.status-not-healthy {
    border-left: 4px solid #ffb700;
    /* Amber/Orange */
}

/* ... */

.status-pass .status-indicator {
    color: var(--neon-green);
}

.status-fail .status-indicator {
    color: var(--neon-red);
}

.status-not-healthy .status-indicator {
    color: #ffb700;
}

.view-btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    color: var(--text-main);
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Loader */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-muted);
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 20px);
    }
}

/* Mobile */
@media (max-width: 768px) {
    h1.glitch {
        font-size: 2.5rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    border: 1px solid var(--neon-red);
    /* Highlight warning */
    box-shadow: 0 0 30px rgba(255, 77, 77, 0.1);
}

.modal-header h2 {
    font-family: var(--font-heading);
    color: var(--neon-red);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
    text-transform: uppercase;
}

.modal-body p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-main);
}

.modal-body strong {
    color: var(--neon-blue);
}

.modal-divider {
    border: 0;
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

.modal-body h3 {
    font-family: var(--font-heading);
    color: var(--neon-green);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.source-list {
    list-style: none;
    margin-bottom: 2rem;
}

.source-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-muted);
}

.source-list li::before {
    content: "•";
    color: var(--neon-green);
    position: absolute;
    left: 0;
}

.modal-footer {
    text-align: center;
}

.modal-footer button {
    background: var(--neon-green);
    color: #000;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-heading);
}

.modal-footer button:hover {
    background: #00cc83;
    color: #000;
}
