/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-padding-top: 180px;
    scroll-behavior: smooth;
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Floating Particles Background ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    flex-shrink: 0;
    flex-grow: 0;

    /* Create many particles with random sizes, colors, and positions */
    background-image:
        /* Brighter blue particles */
        radial-gradient(circle, rgba(37, 99, 235, 0.9) 2px, transparent 2px),
        radial-gradient(circle, rgba(37, 99, 235, 0.8) 3px, transparent 3px),
        radial-gradient(circle, rgba(37, 99, 235, 0.7) 4px, transparent 4px),
        /* Brighter purple particles */
        radial-gradient(circle, rgba(124, 58, 237, 0.85) 2.5px, transparent 2.5px),
        radial-gradient(circle, rgba(124, 58, 237, 0.75) 3.5px, transparent 3.5px),
        /* Mix colors */
        radial-gradient(circle, rgba(59, 130, 246, 0.8) 2.2px, transparent 2.2px),
        radial-gradient(circle, rgba(139, 92, 246, 0.75) 2.8px, transparent 2.8px),
        /* Additional particles */
        radial-gradient(circle, rgba(37, 99, 235, 0.7) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(124, 58, 237, 0.65) 2px, transparent 2px),
        radial-gradient(circle, rgba(59, 130, 246, 0.6) 1.8px, transparent 1.8px),
        radial-gradient(circle, rgba(139, 92, 246, 0.7) 2.3px, transparent 2.3px);

    /* Random spacing patterns */
    background-size:
        250px 300px,
        280px 250px,
        300px 280px,
        260px 320px,
        320px 270px,
        290px 310px,
        240px 290px,
        270px 260px,
        310px 240px,
        230px 330px,
        280px 280px;

    /* Initial positions - offset randomly */
    background-position:
        0 0,
        150px 100px,
        300px 200px,
        75px 300px,
        225px 50px,
        375px 150px,
        100px 250px,
        250px 350px,
        175px 75px,
        325px 225px,
        50px 175px;

    animation: particleFloat 25s linear infinite;
}

@keyframes particleFloat {
    0% {
        background-position:
            0 0,
            150px 100px,
            300px 200px,
            75px 300px,
            225px 50px,
            375px 150px,
            100px 250px,
            250px 350px,
            175px 75px,
            325px 225px,
            50px 175px;
    }
    100% {
        background-position:
            0 -400px,
            150px -300px,
            300px -200px,
            75px -100px,
            225px -350px,
            375px -250px,
            100px -150px,
            250px -50px,
            175px -325px,
            325px -175px,
            50px -225px;
    }
}

@keyframes dotFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-8px) translateX(4px);
    }
}

/* Add subtle gradient overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, rgba(124, 58, 237, 0.02) 100%);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

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

/* ===== Header ===== */
header {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.3) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.3);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease, background 0.3s ease;
}

header.hidden {
    transform: translateY(-100%);
}

header:hover {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px -5px rgba(37, 99, 235, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.nav-links a:hover::after {
    width: calc(100% - 32px);
}

/* ===== Main Content ===== */
main {
    flex: 1;
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Products Grid ===== */
.products-section {
    padding: 60px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.1), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

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

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.15);
    border-color: var(--primary-color);
}

.product-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    border-radius: 16px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-icon {
    transform: scale(1.1) rotate(5deg);
}

.product-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
}

.product-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.product-card:hover .tag:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* ===== Product Detail Page ===== */
.product-detail {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 40px;
}

.product-header {
    text-align: center;
    margin-bottom: 60px;
}

.product-detail-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    border-radius: 24px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.product-detail h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.product-detail .description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.product-detail-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
}

.product-detail-content h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.product-detail-content h3 {
    font-size: 1.125rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.product-detail-content ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.product-detail-content li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.product-detail-content p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.product-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    position: relative;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== Contact Page ===== */
.contact-page {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-page h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.contact-page p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.contact-email {
    display: inline-block;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 40px;
}

/* ===== Footer ===== */
footer {
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-detail h1 {
        font-size: 1.75rem;
    }

    .product-detail-content {
        padding: 25px;
    }

    nav {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        gap: 20px;
    }
}
