/* I. BIẾN MÀU SẮC & THIẾT LẬP CHUNG */
:root {
    --accent-orange: #ff7675;
    --accent-red: #d63031;
    --text-main: #2d3436;
    --text-gray: #636e72;
    --text-cyan: #0984e3;
    --status-new: #00b894;
    --status-ma: #fdcb6e;
    --grid-color: rgba(255, 255, 255, 0.5); 
    --glass-bg: rgba(255, 255, 255, 0.85); 
    --glass-border: rgba(255, 255, 255, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; color: var(--text-main); font-family: 'Inter', sans-serif; overflow-x: hidden; }

body {
    background: linear-gradient(-45deg, #e0c3fc, #8ec5fc, #ffecd2, #fcb69f);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    background-attachment: fixed;
    z-index: -1;
    pointer-events: none;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.2); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.8); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-cyan); }

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* CHƯƠNG 1 — HERO SECTION */
.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding: 60px 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; width: 100%; align-items: center; }

.hero-info { 
    z-index: 10; 
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 45px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}

.hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.no-wrap { white-space: nowrap; }

.hero-subtitle {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-cyan);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.hero-desc {
    font-size: 0.95rem;
    color: #4a4a4a;
    font-weight: 500;
    font-style: italic; 
    max-width: 650px;
    line-height: 1.7;
}

.hero-desc p { margin-bottom: 16px; text-align: left; }
.hero-desc p:last-child { margin-bottom: 0; }

.hero-map-container {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    overflow: hidden;
}

.hero-map-spacer { width: 100%; padding-top: 122.22%; }

.hero-map-img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain;
    filter: invert(1) hue-rotate(200deg) brightness(1.1) opacity(0.7);
    -webkit-filter: invert(1) hue-rotate(200deg) brightness(1.1) opacity(0.7);
    z-index: 1;
    pointer-events: none;
}

#dynamic-dots-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
}

.map-dot {
    position: absolute;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--text-cyan), #00b894);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 30;
    box-shadow: 0 6px 15px rgba(9, 132, 227, 0.4);
    border: 3px solid white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-dot:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 10px 25px rgba(0, 184, 148, 0.5);
    background: linear-gradient(135deg, var(--accent-orange), #ff9ff3);
}

.map-tooltip {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(9, 132, 227, 0.2);
    padding: 15px 20px;
    border-radius: 12px;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.2s ease;
    max-width: 320px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.map-tooltip h4 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    color: var(--text-cyan);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.map-tooltip p {
    font-size: 0.85rem;
    color: var(--accent-orange);
    font-weight: 600;
    margin-bottom: 8px;
}

.map-tooltip .tooltip-loc { font-size: 0.9rem; color: var(--text-main); line-height: 1.5; font-weight: 500; }

.scroll-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--text-main);
    cursor: pointer;
    z-index: 15;
    transition: color 0.3s ease;
    font-weight: 700;
}
.scroll-hint:hover { color: var(--text-cyan); }
.scroll-hint svg { width: 24px; height: 24px; fill: currentColor; margin-top: 8px; animation: bounce 2s infinite; }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* KHỐI THỐNG KÊ (STATS SECTION) NAY ĐƯỢC CHUYỂN LÊN ĐÂY */
.stats-section {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px 20px;
    margin: 20px auto 50px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    position: relative;
    z-index: 20;
}

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; text-align: center; }
.stat-card { padding: 10px; border-right: 1px dashed rgba(45, 52, 54, 0.2); }
.stat-card:last-child { border-right: none; }

.stat-number {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 4vw, 4.5rem);
    line-height: 1;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-cyan) 0%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-main); }

/* CHƯƠNG 2 — FILTER DASHBOARD */
.filter-dashboard {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 0;
    z-index: 100;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.filter-container { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }
.filter-left { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; width: 100%; }

.filter-pill {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid transparent;
    color: var(--text-gray);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.filter-pill:hover, .filter-pill.active {
    background: var(--text-cyan);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(9, 132, 227, 0.3);
}

.counter-badge {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.2rem;
    color: var(--text-cyan);
    border-left: 2px solid rgba(9, 132, 227, 0.3);
    padding-left: 15px;
    font-weight: 800;
}

.filter-logos { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: 100%; padding: 5px 0; }

.filter-logo-wrapper {
    width: 130px;
    height: 52px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    flex-shrink: 0;
}

.filter-logo-wrapper:hover, .filter-logo-wrapper.active {
    border-color: var(--accent-orange);
    box-shadow: 0 6px 15px rgba(255, 118, 117, 0.25);
    transform: translateY(-3px);
    background: #ffffff;
}

.filter-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply; 
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.3s ease;
}

.filter-logo-wrapper:hover .filter-logo-img, 
.filter-logo-wrapper.active .filter-logo-img {
    filter: grayscale(0%) opacity(1);
}

.filter-logo-wrapper[data-filter-group="Tập Đoàn SIG"] .filter-logo-img { transform: scale(1.8); }
.filter-logo-wrapper[data-filter-group="Tập đoàn Becamex"] .filter-logo-img { transform: scale(1.5); }

/* CHƯƠNG 3 — CARD GRID */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-bottom: 80px; }

.project-card {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: rgba(255, 255, 255, 1);
}

.project-card.filtered-out { display: none; }

.visual-hub {
    position: relative;
    height: 100%;
    min-height: 280px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.5); 
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }

.status-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 5;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.status-new-bg { background-color: var(--status-new); color: #fff; }
.status-ma-bg { background-color: var(--status-ma); color: #000; }

@media (hover: hover) { .project-card:hover .project-img { transform: scale(1.05); } }

.info-hub { padding: 25px; display: flex; flex-direction: column; justify-content: space-between; position: relative; pointer-events: none; }
.info-hub .detail-btn { pointer-events: auto; } 

.rank-badge {
    background: rgba(9, 132, 227, 0.1);
    color: var(--text-cyan);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 4px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 15px;
    text-transform: uppercase;
    color: var(--text-main);
}

.meta-list { margin-bottom: 15px; font-size: 0.9rem; }
.meta-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text-main); font-weight: 600; }
.meta-item svg { width: 16px; height: 16px; fill: var(--text-cyan); flex-shrink: 0; }

.history-box {
    border-left: 3px solid var(--accent-orange);
    padding-left: 15px;
    margin-bottom: 20px;
    min-height: 60px;
    background: linear-gradient(90deg, rgba(255, 118, 117, 0.08) 0%, transparent 100%);
    padding-top: 8px;
    padding-bottom: 8px;
    border-radius: 0 8px 8px 0;
}

.history-text { font-family: 'Inter', sans-serif; font-size: 0.9rem; line-height: 1.6; color: #333; }

.detail-btn {
    background: var(--text-cyan);
    border: none;
    color: #ffffff;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(9, 132, 227, 0.3);
    position: relative;
    z-index: 10;
}

.detail-btn:hover { background: #076aba; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(9, 132, 227, 0.4); }

/* CREDITS SECTION */
.credits {
    text-align: center;
    padding: 40px 20px 60px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.8;
}

/* MODAL OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container-box {
    position: relative;
    width: 90%;
    max-width: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-wrapper {
    background: #ffffff; 
    border: 1px solid var(--glass-border);
    width: 100%;
    height: 80vh; 
    border-radius: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    transform: translateZ(0) scale(0.95);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    isolation: isolate; 
}

.modal-overlay.active .modal-wrapper { transform: translateZ(0) scale(1); }

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid #dfe6e9;
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1010;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.modal-nav-btn:hover { background: var(--text-cyan); color: #ffffff; border-color: var(--text-cyan); }
.modal-nav-prev { left: -70px; }
.modal-nav-next { right: -70px; }

.modal-close-btn {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255,255,255,0.9);
    border: none;
    color: var(--text-main);
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.modal-close-btn:hover { background: var(--accent-red); color: #ffffff; }

.modal-left {
    position: relative;
    height: 100%;
    background: #f8f9fa; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-big-img { width: 100%; height: 100%; object-fit: cover; }

.modal-right {
    padding: 60px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
}

.modal-rank-badge {
    background: #e1f0ff;
    color: var(--text-cyan);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.modal-project-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 30px;
    text-transform: uppercase;
    color: var(--text-main);
}

.modal-meta-list { display: flex; flex-direction: column; gap: 15px; margin-bottom: 35px; }

.modal-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.5;
}

.modal-meta-item svg { width: 22px; height: 22px; fill: var(--text-cyan); flex-shrink: 0; margin-top: 1px; }

.modal-history-box { border-left: 4px solid var(--accent-orange); padding-left: 20px; margin-top: 10px; }

.modal-history-text { font-family: 'Inter', sans-serif; font-size: 1.05rem; line-height: 1.7; color: #4a4a4a; }

.modal-group-logo { max-height: 40px; max-width: 120px; object-fit: contain; margin-bottom: 15px; }

/* ĐIỀU CHỈNH GIAO DIỆN HIỂN THỊ KHỔ VUÔNG TRÊN MOBILE */
@media (max-width: 992px) {
    .hero { min-height: auto; padding: 40px 0; }
    .scroll-hint { position: relative; bottom: auto; margin-top: 30px; }

    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-map-container { width: 100%; max-width: 500px; margin-top: 20px; }
    .hero-desc { margin: 0 auto; text-align: left; }
    .filter-dashboard { margin-bottom: 25px; padding: 10px 0; }
    .filter-container { flex-direction: column; align-items: stretch; overflow: hidden; width: 100%; gap: 10px; }
    
    .filter-left, .filter-logos { 
        width: 100%;
        flex-wrap: nowrap; 
        overflow-x: auto; 
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; 
        justify-content: flex-start;
        padding-bottom: 5px;
    }
    .filter-left::-webkit-scrollbar, .filter-logos::-webkit-scrollbar { display: none; }
    
    .filter-pill, .filter-logo-wrapper { flex-shrink: 0; }
    .filter-logo-wrapper { width: 110px; height: 42px; padding: 6px; }
    
    .counter-badge { 
        border-left: none; padding-left: 0; 
        padding-top: 10px; border-top: 1px dashed rgba(9,132,227,0.2); 
        width: 100%; text-align: left; margin: 0; font-size: 1rem;
    }
    
    .projects-grid { grid-template-columns: 1fr; gap: 20px; padding: 0; }
    .project-card { grid-template-columns: 1fr; }
    
    .visual-hub { 
        height: auto; 
        min-height: auto;
        aspect-ratio: 1 / 1; 
        background-color: #f8f9fa;
    }
    .project-img { 
        width: 100%; 
        height: 100%; 
        object-fit: contain; 
    }
    
    .stats-section { margin: 30px auto 40px; border-radius: 20px; padding: 25px 15px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .stat-card { border-right: none; border-bottom: 1px dashed rgba(45,52,54,0.2); padding: 15px 10px; }
    .stat-card:nth-child(3), .stat-card:nth-child(4) { border-bottom: none; }
    .stat-number { font-size: 2.2rem; }
    
    .credits { font-size: 1rem; padding: 30px 20px 50px; }

    /* Modal Bottom Sheet */
    .modal-container-box { width: 100%; height: 100%; align-items: flex-end; margin: 0; max-width: 100%; }
    .modal-wrapper { 
        grid-template-columns: 1fr; 
        grid-template-rows: auto 1fr; 
        height: 92vh; 
        border-radius: 24px 24px 0 0; 
        width: 100%;
    }
    .modal-left { 
        height: auto; 
        width: 100%; 
        aspect-ratio: 1 / 1; 
        background-color: #f8f9fa;
        align-items: flex-start; 
    }
    .modal-big-img { 
        width: 100%; 
        height: 100%; 
        object-fit: contain; 
    }
    
    .modal-right { 
        padding: 30px 20px; 
        border-radius: 24px 24px 0 0; 
        margin-top: -25px; 
        background: #ffffff; 
        z-index: 5; 
        position: relative;
        box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
    }
    
    .modal-project-name { font-size: 1.8rem; margin-bottom: 20px; }
    .modal-meta-item, .modal-history-text { font-size: 0.95rem; }
    
    .modal-nav-btn { 
        top: 50vw; 
        width: 40px; height: 40px; 
        background: rgba(255,255,255,0.8);
        box-shadow: 0 4px 15px rgba(0,0,0,0.15); 
        border: none;
        transform: translateY(-50%);
    }
    .modal-nav-prev { left: 15px; }
    .modal-nav-next { right: 15px; }
    
    .modal-close-btn { 
        top: 15px; right: 15px; 
        width: 36px; height: 36px; 
        background: rgba(0,0,0,0.4); 
        color: white; 
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
}