* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --dark: #0f172a;
    --gray: #64748b;
    --light-gray: #f1f5f9;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-dark: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 35px;
    width: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

.logo-text .highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: var(--gradient-dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99,102,241,0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.hero-stats {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 3rem;
    margin-top: 4rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
}

.stat-label {
    color: #cbd5e1;
    font-size: 0.875rem;
}

/* Featured Snippet */
.featured-snippet {
    padding: 5rem 2rem;
    background: var(--light-gray);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.badge {
    display: inline-block;
    background: var(--gradient);
    color: var(--white);
    padding: 0.25rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.snippet-card {
    background: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.snippet-card:hover {
    transform: translateY(-5px);
}

.snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--dark);
    border-bottom: 1px solid #1e293b;
}

.snippet-tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-postgres {
    background: #336791;
    color: white;
}

.tag-featured {
    background: var(--gradient);
    color: white;
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-block code {
    display: block;
}

.snippet-footer {
    padding: 1rem 1.5rem;
    background: var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.snippet-info {
    display: flex;
    gap: 1.5rem;
    color: var(--gray);
    font-size: 0.875rem;
}

.snippet-info i {
    margin-right: 0.25rem;
}

.btn-detail {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Categories Grid */
.categories {
    padding: 5rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.category-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.category-card i {
    font-size: 3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--gray);
    margin-bottom: 1rem;
}

.count {
    display: inline-block;
    background: var(--light-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
}

/* Newsletter */
.newsletter {
    background: var(--gradient-dark);
    padding: 4rem 2rem;
    color: var(--white);
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter-content p {
    margin-bottom: 2rem;
    color: #cbd5e1;
}

#newsletter-form {
    display: flex;
    gap: 1rem;
}

#newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
}

#newsletter-form button {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.3s;
}

#newsletter-form button:hover {
    opacity: 0.9;
}

/* Footer */
.footer {
    background: var(--dark);
    color: #94a3b8;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    font-size: 1.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #1e293b;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .snippet-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .snippet-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .snippet-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #newsletter-form {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card, .snippet-card {
    animation: fadeInUp 0.6s ease-out;
}