:root {
    /* Dark Theme (Default) */
    --primary-bg: #030816;
    --accent-color: #00d2ff;
    --secondary-accent: #9d50bb;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-refraction: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 40%, transparent 60%, rgba(255, 255, 255, 0.1));
    --glass-hover-bg: rgba(255, 255, 255, 0.06);
    --text-white: #f8f9fa;
    --text-muted: #94a3b8;
    --nav-bg: rgba(3, 8, 22, 0.7);
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --transition-speed: 0.5s;
    scroll-behavior: smooth;
}

[data-theme="light"] {
    /* Light Theme */
    --primary-bg: #f5f7fa;
    --accent-color: #007bff;
    --secondary-accent: #6610f2;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-hover-bg: rgba(255, 255, 255, 1);
    --text-white: #2d3436;
    --text-muted: #636e72;
    --nav-bg: rgba(245, 247, 250, 0.8);
    --card-shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Outfit', 'Hind Siliguri', sans-serif;
    color: var(--text-white);
    background-color: var(--primary-bg);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Animated Mesh Background */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: var(--primary-bg);
    transition: background-color var(--transition-speed);
}

.mesh-ball {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.4;
    animation: move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

[data-theme="light"] .mesh-ball {
    opacity: 0.2;
}

.ball-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.ball-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-accent) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.ball-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ff0080 0%, transparent 70%);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
    opacity: 0.2;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, 100px) scale(1.1);
    }

    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Noise Texture Over Background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)"/></svg>');
    opacity: 0.02;
    pointer-events: none;
    z-index: 1000;
}

/* Navbar Style */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.2rem 0;
    transition: all 0.4s;
}

.navbar.scrolled {
    padding: 0.8rem 0;
    background: var(--primary-bg);
    opacity: 0.95;
}

.navbar-brand {
    font-weight: 700;
    color: var(--text-white) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
}

.navbar-brand span:last-child {
    background: linear-gradient(to right, var(--text-white), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    color: var(--text-white) !important;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: var(--glass-hover-bg);
    transform: rotate(15deg);
}

/* Card Style Improvements */
.plugin-card {
    --x: 50%;
    --y: 50%;
    --spotlight-color: rgba(255, 255, 255, 0.05);
    background:
        radial-gradient(800px circle at var(--x) var(--y), var(--spotlight-color), transparent 40%),
        var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 48px;
    height: 100%;
    transition: transform var(--transition-speed) cubic-bezier(0.23, 1, 0.32, 1), background 0.4s, border-color 0.4s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.plugin-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-refraction);
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
}

.plugin-card::after {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(45deg,
            transparent 45%,
            rgba(255, 255, 255, 0.05) 50%,
            transparent 55%);
    transition: all 0.6s;
    pointer-events: none;
    z-index: 2;
}

.plugin-card:hover::after {
    top: -50%;
    left: -50%;
}

.plugin-card:hover {
    transform: translateY(-15px) scale(1.01);
    --spotlight-color: rgba(255, 255, 255, 0.08);
    background: radial-gradient(800px circle at var(--x) var(--y), var(--spotlight-color), transparent 40%), var(--glass-hover-bg);
    border-color: rgba(0, 210, 255, 0.4);
    box-shadow: 0 40px 80px var(--card-shadow), 0 0 30px rgba(0, 210, 255, 0.1);
}

[data-theme="light"] .plugin-card:hover {
    --spotlight-color: rgba(0, 123, 255, 0.12);
    background: radial-gradient(800px circle at var(--x) var(--y), var(--spotlight-color), transparent 40%), var(--glass-hover-bg);
}

.plugin-icon {
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    color: var(--accent-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.22rem;
    margin-bottom: 30px;
    border: 1px solid var(--glass-border);
    transition: transform 0.5s;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.05);
}

.plugin-card:hover .plugin-icon {
    transform: rotateY(360deg) scale(1.1);
    color: #fff;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

/* Typography Refinement */
.hero-section h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 25px;
    background: linear-gradient(135deg, var(--text-white) 30%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    letter-spacing: -2px;
}

.hero-section p {
    color: var(--text-muted) !important;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 50px;
    letter-spacing: -1px;
}

.plugin-card p {
    color: var(--text-muted);
}

/* Button & Badge Refinement */
.btn-view {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    font-weight: 600;
    padding: 14px 35px;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.4s;
    display: inline-block;
    border: 1px solid var(--glass-border);
    text-align: center;
    backdrop-filter: blur(10px);
}

[data-theme="light"] .btn-view {
    background: rgba(0, 0, 0, 0.05);
}

.btn-view:hover {
    background: var(--text-white);
    color: var(--primary-bg);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--card-shadow);
    border-color: var(--text-white);
}

.badge-category {
    background: linear-gradient(to right, rgba(0, 210, 255, 0.1), rgba(157, 80, 187, 0.1));
    color: var(--accent-color);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Scroll to Top */
#scrollToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

#scrollToTop.show {
    opacity: 1;
    visibility: visible;
}

#scrollToTop:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 3rem;
        letter-spacing: -1px;
    }

    .plugin-card {
        padding: 35px;
    }
}