@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #0ea5e9;
    --primary-light: #38bdf8;
    --primary-glow: rgba(14, 165, 233, 0.3);
    --secondary: #6366f1;
    --bg-dark: #020617;
    --bg-surface: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-brand: linear-gradient(135deg, var(--primary), var(--secondary));
}

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

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

/* Background Effects */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    mix-blend-mode: screen;
}

.blob-1 {
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: var(--primary);
    animation: float 20s infinite alternate;
}

.blob-2 {
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--secondary);
    animation: float 25s infinite alternate-reverse;
}

@keyframes float {
    from {
        transform: translate(0, 0) rotate(0deg);
    }

    to {
        transform: translate(100px, 100px) rotate(180deg);
    }
}

/* Navigation System */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.02em;
    z-index: 1001;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-light);
}

.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    z-index: 1100;
    transition: var(--transition);
}

.mobile-menu-btn:hover,
.mobile-menu-btn.active {
    background: var(--primary);
    color: #000;
}

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Section 1: Hệ Nước (Light Green Theme) */
.section-nuoc {
    background: radial-gradient(circle at top right, rgba(34, 197, 94, 0.08), transparent),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent);
    border-bottom: 1px solid rgba(34, 197, 94, 0.1);
}

.card-nuoc {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(34, 197, 94, 0.1);
}

.card-nuoc:hover {
    border-color: #22c55e;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 197, 94, 0.2);
}

.icon-nuoc {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}

.btn-nuoc {
    border-color: rgba(34, 197, 94, 0.2);
}

.card-nuoc:hover .btn-nuoc {
    background: linear-gradient(135deg, #22c55e, #10b881);
    color: #000;
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

/* Section 2: Hệ Dung Môi (Blue Theme) */
.section-dung-moi {
    background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.08), transparent);
}

/* Typography Adjustments */
h1 {
    font-size: clamp(2.2rem, 10vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    font-size: clamp(1rem, 4vw, 1.15rem);
    max-width: 700px;
    margin: 0 auto 3rem;
    padding: 0 20px;
}

/* Hero container */
header.container {
    padding-top: 100px;
    padding-bottom: 60px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.pb-0 {
    padding-bottom: 0 !important;
}

/* Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

/* Card Style */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 40px;
    text-align: left;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-light);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 30px var(--primary-glow);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    color: var(--primary-light);
    transition: var(--transition);
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--gradient-brand);
    color: #fff;
    border-color: transparent;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.card p {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 32px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
    border-radius: 16px;
    gap: 10px;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    width: fit-content;
}

.btn i {
    width: 18px;
    height: 18px;
}

.card:hover .btn {
    background: var(--gradient-brand);
    color: #000;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

footer {
    padding: 100px 0 60px;
    text-align: center;
    color: var(--text-dim);
    font-size: 1rem;
}

/* Mobile Adjustments */
@media (max-width: 968px) {
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    nav { 
        padding: 0.8rem 0;
        position: sticky;
        top: 0;
        width: 100%;
        background: rgba(2, 6, 23, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .nav-container {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0 16px;
    }

    .logo {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
    }
    
    .mobile-menu-btn {
        display: none !important; /* All tabs visible, menu not needed */
    }
    
    .nav-links {
        position: static;
        width: 100%;
        height: auto;
        background: transparent;
        backdrop-filter: none;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 0.8rem;
        box-shadow: none;
        padding: 0 4px 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 10px, black calc(100% - 10px), transparent);
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    .nav-links a {
        font-size: 0.85rem;
        font-weight: 500;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--glass-border);
        border-radius: 100px;
        color: var(--text-dim);
    }

    .nav-links a.active {
        background: var(--gradient-brand);
        color: #000;
        border-color: transparent;
        font-weight: 600;
        box-shadow: 0 4px 12px var(--primary-glow);
    }

    header.container { padding-top: 40px; padding-bottom: 20px; }
    h1 { font-size: 2.2rem; }
    section { padding: 40px 0; }
    .section-title { font-size: 1.8rem; margin-bottom: 24px; }
    
    .resource-grid { grid-template-columns: 1fr; gap: 16px; }
    .card { padding: 24px; border-radius: 24px; }
    .card h3 { font-size: 1.25rem; margin-bottom: 8px; }
    .btn { width: 100%; border-radius: 12px; }
}

/* Active touch feedback */
.card:active {
    transform: scale(0.98);
    transition: 0.1s;
}