/* I. BIẾN MÀU SẮC & THIẾT LẬP CHUNG */
:root {
    --bg-main: #0a0e1a;
    --bg-card: #1a2340;
    --accent-orange: #f5a623;
    --accent-red: #e63946;
    --text-white: #ffffff;
    --text-gray: #a8b2c8;
    --text-cyan: #00d4ff;
    --status-done: #22c55e;
    --status-pending: #f59e0b;
    --grid-color: rgba(0, 212, 255, 0.04);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

body {
    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;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border: 1px solid var(--text-cyan);
    border-radius: 4px;
}

.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;
}

.hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    font-size: clamp(2.5rem, 4.5vw, 4.8rem);
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 25px;
    color: var(--text-white);
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

.hero-subtitle {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.8rem);
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-gray);
    max-width: 600px;
    line-height: 1.6;
}

/* KHUNG CHỨA HÌNH ẢNH BẢN ĐỒ GỐC CAFEF ĐỂ CHÈN ĐỐM SÁNG RADAR */
.hero-map-container {
    position: relative;
    width: 100%;
    max-width: 650px;
    aspect-ratio: 450 / 550; /* Giữ nguyên tỷ lệ chuẩn của vùng bản đồ */
    margin: 0 auto;
    background-image: url('https://cafefcdn.com/203337114487263232/2026/5/21/thiet-ke-chua-co-ten-12-177938735555937747996.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.15);
    border-radius: 12px;
}

/* Các đốm sáng Radar tương tác đổ bóng tỏa nhiệt */
.map-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 30;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.map-dot:hover {
    transform: translate(-50%, -50%) scale(1.6);
}

.map-dot::after {
    content: '';
    position: absolute;
    top: -100%; left: -100%; width: 300%; height: 300%;
    border-radius: 50%;
    animation: pulse 2s infinite;
    pointer-events: none;
}

.dot-done {
    background-color: var(--status-done);
    box-shadow: 0 0 15px var(--status-done), inset 0 0 4px #fff;
}
.dot-done::after {
    border: 2px solid var(--status-done);
}

.dot-pending {
    background-color: var(--accent-orange);
    box-shadow: 0 0 15px var(--accent-orange), inset 0 0 4px #fff;
}
.dot-pending::after {
    border: 2px solid var(--accent-orange);
}

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

/* Tooltip chuyển động theo chuột */
.map-tooltip {
    position: fixed;
    background: rgba(8, 12, 24, 0.95);
    border: 1px solid var(--text-cyan);
    padding: 12px 16px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.2s ease;
    max-width: 300px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.7);
}

.map-tooltip h4 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.15rem;
    color: var(--text-white);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.map-tooltip p {
    font-size: 0.85rem;
    color: var(--accent-orange);
    font-weight: 600;
}

.map-tooltip .tooltip-loc {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-top: 4px;
    font-family: monospace;
}

/* Mũi tên gợi ý cuộn xuống */
.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: 0.9rem;
    letter-spacing: 2px;
    color: var(--text-gray);
    cursor: pointer;
    z-index: 15;
}

.scroll-hint svg {
    width: 24px;
    height: 24px;
    fill: var(--text-cyan);
    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); }
}

/* CHƯƠNG 2 — FILTER DASHBOARD */
.filter-dashboard {
    position: sticky;
    top: 0;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    padding: 15px 0;
    z-index: 100;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.filter-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-pill {
    background: rgba(26, 35, 64, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: var(--text-gray);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-pill:hover, .filter-pill.active {
    background: var(--text-cyan);
    color: var(--bg-main);
    border-color: var(--text-cyan);
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.filter-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    max-width: 600px;
    padding-bottom: 4px;
}

.filter-logo-item {
    height: 38px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    filter: grayscale(1) opacity(0.6);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-logo-item:hover, .filter-logo-item.active {
    filter: grayscale(0) opacity(1);
    border-color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(245, 166, 35, 0.5);
}

.counter-badge {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    color: var(--text-cyan);
    border-left: 2px solid rgba(0, 212, 255, 0.3);
    padding-left: 15px;
    font-weight: 600;
}

/* 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(--bg-card);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.4s ease;
}

.project-card.filtered-out {
    opacity: 0.15;
    pointer-events: none;
    transform: scale(0.98);
}

.visual-hub {
    position: relative;
    height: 100%;
    min-height: 280px;
    overflow: hidden;
    background-color: #0d1527;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.status-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 5;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.status-done-bg { background-color: var(--status-done); color: #000; }
.status-pending-bg { background-color: var(--status-pending); color: #000; }

@media (hover: hover) {
    .visual-hub:hover .project-img {
        transform: scale(1.05);
    }
}

.info-hub {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.rank-badge {
    background: linear-gradient(90deg, rgba(245, 166, 35, 0.15) 0%, rgba(245, 166, 35, 0) 100%);
    border-left: 3px solid var(--accent-orange);
    color: var(--accent-orange);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 4px 10px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 15px;
    text-transform: uppercase;
    color: var(--text-white);
}

.meta-list {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--text-gray);
}

.meta-item svg {
    width: 14px;
    height: 14px;
    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;
}

.history-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #c8d6e5;
}

.typewriter-cursor::after {
    content: '|';
    animation: blink 0.7s infinite;
    color: var(--accent-orange);
    font-weight: bold;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.detail-btn {
    background: transparent;
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.detail-btn:hover {
    background: var(--accent-orange);
    color: #000;
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.3);
}

/* CHƯƠNG 4 — STATS FOOTER */
.stats-footer {
    background: #0d1427;
    border-top: 2px solid var(--bg-card);
    padding: 60px 0;
    margin-top: 100px;
    position: relative;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-card {
    padding: 20px;
    border-right: 1px solid rgba(0, 212, 255, 0.1);
}

.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(--accent-orange) 0%, var(--accent-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-gray);
}

/* IV. MODAL CHI TIẾT OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(5, 7, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Container mới bọc wrapper để tạo khoảng trống cho nút lướt */
.modal-container-box {
    position: relative;
    width: 90%;
    max-width: 1220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--text-cyan);
    width: 100%;
    height: 85vh;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.modal-overlay.active .modal-wrapper {
    transform: scale(1);
}

/* NÚT LƯỚT SANG NGANG TRONG MODAL */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 35, 64, 0.8);
    border: 1px solid var(--text-cyan);
    color: var(--text-cyan);
    width: 44px;
    height: 44px;
    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 0 15px rgba(0, 212, 255, 0.2);
}

.modal-nav-btn:hover {
    background: var(--text-cyan);
    color: var(--bg-main);
    box-shadow: 0 0 20px var(--text-cyan);
}

.modal-nav-prev { left: -60px; }
.modal-nav-next { right: -60px; }

.modal-close-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 36px; height: 36px;
    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;
}

.modal-close-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.modal-left {
    position: relative;
    height: 100%;
    background: #05070f;
}

.modal-big-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-right {
    padding: 40px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(0, 212, 255, 0.1);
}

.modal-logo-box {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.modal-group-logo {
    max-height: 45px;
    max-width: 120px;
    background: white;
    padding: 4px 10px;
    border-radius: 4px;
    object-fit: contain;
}

/* PHẦN DÒNG CHỮ TÁC GIẢ & NGUỒN */
.author-credits {
    text-align: right;
    padding: 20px;
    font-size: 0.85rem;
    color: var(--text-gray);
    border-top: 1px solid rgba(0, 212, 255, 0.05);
    background: #070a14;
}

.author-credits a {
    color: var(--text-cyan);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-credits a:hover {
    color: var(--accent-orange);
    text-decoration: underline;
}

/* V. MOBILE RESPONSIVE (< 992PX) */
@media (max-width: 992px) {
    body {
        background-size: 30px 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;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-logos {
        max-width: 100%;
        padding-bottom: 8px;
    }
    .counter-badge {
        border-left: none;
        padding-left: 0;
        text-align: center;
        border-top: 1px dashed rgba(0,212,255,0.2);
        padding-top: 8px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 5px;
    }

    .project-card {
        grid-template-columns: 1fr;
    }

    .visual-hub {
        height: 220px;
        min-height: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .stat-card {
        border-right: none;
        border-bottom: 1px dashed rgba(0,212,255,0.1);
    }
    .stat-card:nth-child(3), .stat-card:nth-child(4) {
        border-bottom: none;
    }

    .modal-container-box {
        width: 95%;
    }
    .modal-wrapper {
        grid-template-columns: 1fr;
        height: 90vh;
    }
    .modal-left {
        height: 250px;
    }
    .modal-right {
        padding: 20px;
    }
    .modal-nav-btn {
        width: 36px;
        height: 36px;
        background: rgba(10, 14, 26, 0.9);
    }
    .modal-nav-prev { left: 10px; }
    .modal-nav-next { right: 10px; }
    
    .author-credits {
        text-align: center;
    }
}
