:root {
    --bg-dark: #0f172a;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-glow: rgba(56, 189, 248, 0.5);
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    padding-top: 80px; /* Space for fixed navbar */
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: #38bdf8;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0 auto;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-light);
}

.donate-link {
    color: #ff4757 !important;
}
.donate-link:hover {
    filter: brightness(1.2);
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-actions { display: none; }
}

/* Dynamic Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    filter: blur(60px);
    animation: pulse 10s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 4rem 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInDown 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

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

.product-card {
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    background: var(--primary-glow);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0;
    top: -50px;
    right: -50px;
    transition: opacity 0.4s ease;
}

.product-card:hover .card-glow {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 1;
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.icon-wrapper svg {
    width: 32px;
    height: 32px;
    color: white;
}

.product-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.product-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.btn {
    display: inline-block;
    font-weight: 600;
    color: #38bdf8;
    position: relative;
    transition: all 0.3s ease;
}

.btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #38bdf8;
    transition: width 0.3s ease;
}

.product-card:hover .btn::after {
    width: 100%;
}

.footer {
    text-align: center;
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    animation: fadeIn 2s ease;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .title { font-size: 2.2rem; }
    .container { padding: 3rem 1.5rem; }
}


/* ===== Navigation Toggles (Theme & Language) ===== */
.pill-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 20px;
    padding: 2px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.pill-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 18px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1.4;
}

.pill-option.active {
    background: #38bdf8;
    color: #0f172a;
}

.icon-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
.icon-toggle:hover {
    border-color: #38bdf8;
    color: #38bdf8;
}

[data-theme="light"] {
    --bg-dark: #f8fafc;
    --text-light: #0f172a;
    --text-muted: #475569;
    --card-bg: rgba(241, 245, 249, 0.85);
    --border-color: rgba(0, 0, 0, 0.08);
    --primary-glow: rgba(56, 189, 248, 0.15);
}

[data-theme="light"] .navbar {
    background: rgba(248, 250, 252, 0.8);
}
[data-theme="light"] .btn-nav {
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .btn-nav:hover {
    background: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .pill-toggle {
    background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .pill-option.active {
    color: #ffffff;
    background: #0284c7;
}
[data-theme="light"] .icon-toggle {
    background: rgba(0, 0, 0, 0.05);
}


/* ===== Navigation Toggles (Theme & Language) ===== */
.pill-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 20px;
    padding: 2px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.pill-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 18px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1.4;
}

.pill-option.active {
    background: #38bdf8;
    color: #0f172a;
}

.icon-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
.icon-toggle:hover {
    border-color: #38bdf8;
    color: #38bdf8;
}

[data-theme="light"] {
    --bg-dark: #f8fafc;
    --text-light: #0f172a;
    --text-muted: #475569;
    --card-bg: rgba(241, 245, 249, 0.85);
    --border-color: rgba(0, 0, 0, 0.08);
    --primary-glow: rgba(56, 189, 248, 0.15);
}

[data-theme="light"] .navbar {
    background: rgba(248, 250, 252, 0.8);
}
[data-theme="light"] .btn-nav {
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .btn-nav:hover {
    background: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .pill-toggle {
    background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .pill-option.active {
    color: #ffffff;
    background: #0284c7;
}
[data-theme="light"] .icon-toggle {
    background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .product-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .btn-nav { display: none; }
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Product Dropdown Styles */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    padding: 8px 0;
    margin-top: 12px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 1000;
}

[data-theme="light"] .dropdown-menu {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: rgba(15, 23, 42, 0.95);
    border-top: none;
}

[data-theme="light"] .dropdown-menu::before {
    border-bottom-color: rgba(248, 250, 252, 0.95);
}

.dropdown-menu a {
    display: block !important;
    padding: 10px 20px !important;
    margin: 0 !important;
    color: var(--text-muted) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    color: var(--text-light) !important;
    background: rgba(255,255,255,0.06) !important;
    padding-left: 24px !important;
}

[data-theme="light"] .dropdown-menu a:hover {
    background: rgba(0,0,0,0.04) !important;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu::after {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
}

/* Mobile Responsive Override */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border-color);
        margin: 0;
    }
    
    [data-theme="light"] .nav-links {
        background: rgba(248, 250, 252, 0.98);
    }

    .nav-links.show {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .btn-nav {
        display: none !important;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        background: rgba(255, 255, 255, 0.03);
        border: none;
        box-shadow: none;
        margin: 4px 0;
        border-radius: 8px;
        min-width: auto;
        padding-top: 0;
    }
    
    [data-theme="light"] .dropdown-menu {
        background: rgba(0, 0, 0, 0.02);
    }

    .dropdown-menu::before {
        display: none;
    }

    .dropdown-menu a {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
}
