:root {
    /* Tông màu Trắng Hiện Đại */
    --brand-color: #0284c7; 
    --brand-dark: #0369a1;
    --bg-main: #ffffff; 
    --bg-panel: #ffffff; 
    --text-main: #0f172a; 
    --text-muted: #475569; 
    --border-color: #e2e8f0;
}

body, html {
    margin: 0; padding: 0;
    width: 100%; height: 100vh;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    overflow: hidden; /* Chống cuộn toàn trang */
}

h1, h2, h3, .serif { font-family: 'Lora', serif; }

/* Khoảng hở 1cm (40px) trên cùng cho IMS Tag */
#vne-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 40px);
    margin-top: 40px; 
    overflow: hidden;
    background-color: #f8fafc;
}

/* ----- INTRO SCREEN ----- */
#intro-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-main);
    background-image: linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.98)), url('https://images.unsplash.com/photo-1617788138017-80ad40651399?q=80&w=2070&auto=format&fit=crop');
    background-size: cover; background-position: center;
    z-index: 100;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 2rem; transition: opacity 0.6s ease, visibility 0.6s;
    overflow-y: auto;
}
#intro-screen.hidden { opacity: 0; visibility: hidden; }
.intro-title {
    font-size: clamp(1.8rem, 3.5vw, 3rem); color: var(--brand-color); text-align: center;
    margin-bottom: 2rem; max-width: 900px; line-height: 1.3; font-weight: 700;
}
.intro-sapo {
    font-size: 1.1rem; line-height: 1.8; max-width: 800px;
    text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; font-weight: 400;
}
.stats-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; margin-bottom: 3rem; width: 100%;
}
.stat-box {
    background: #ffffff; border: 1px solid var(--border-color);
    padding: 1.5rem 2rem; border-radius: 8px; text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.stat-num {
    display: block; font-size: 2.5rem; color: var(--brand-color);
    font-family: 'Lora', serif; font-weight: 600; margin-bottom: 0.5rem;
}
.stat-text { font-size: 0.9rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.btn-start {
    padding: 1rem 3rem; font-size: 1.1rem; background-color: var(--brand-color);
    color: #fff; border: none; border-radius: 4px; cursor: pointer;
    font-weight: 600; transition: all 0.3s; text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.2);
}
.btn-start:hover { background-color: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(2, 132, 199, 0.3); }

/* ----- MAIN APP CONTAINER ----- */
#app-container { display: flex; height: calc(100% - 80px); width: 100%; position: relative;}

/* LEFT PANEL: HIỂN THỊ THÔNG TIN */
#info-panel {
    width: 40%; 
    height: 100%; background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color); display: flex; flex-direction: column; overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0,0,0,0.02); z-index: 10;
}
#info-panel::-webkit-scrollbar { width: 6px; }
#info-panel::-webkit-scrollbar-track { background: #f8fafc; }
#info-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.factory-img {
    width: 100%; height: 300px; object-fit: cover;
    border-bottom: 3px solid var(--brand-color); transition: opacity 0.3s;
}
.info-content { padding: 2.5rem 3rem; opacity: 1; transition: opacity 0.3s; }
.info-content.fade { opacity: 0; }
.factory-title { color: var(--brand-color); font-size: 1.8rem; margin-bottom: 0.5rem; line-height: 1.4; font-weight: 700; }
.factory-meta {
    display: inline-block; font-size: 0.9rem; color: var(--brand-dark);
    background: #f0f9ff; border: 1px solid #bae6fd;
    padding: 5px 14px; border-radius: 20px; margin-bottom: 1.5rem; font-weight: 500;
}
.factory-text { font-size: 1.05rem; line-height: 1.8; color: var(--text-main); }
.factory-text p { margin-bottom: 0.8rem; }
.factory-text strong { color: #000; font-weight: 600; }

/* RIGHT PANEL: BẢN ĐỒ */
#map-panel {
    width: 60%; 
    height: 100%; background-color: #f8fafc;
    position: relative; overflow: hidden; display: flex; flex-direction: column;
}

/* Nút Quay lại trang chủ */
#btn-home {
    position: absolute; top: 20px; right: 20px; z-index: 50;
    background: rgba(255, 255, 255, 0.95); border: 1px solid var(--brand-color);
    color: var(--brand-color); padding: 6px 12px; border-radius: 20px;
    cursor: pointer; font-size: 0.8rem; font-weight: 600;
    display: flex; align-items: center; gap: 6px; transition: all 0.3s;
    backdrop-filter: blur(5px); box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
#btn-home:hover { background: var(--brand-color); color: #fff; }

/* BOTTOM PANEL: TIMELINE */
#timeline-container {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 80px;
    background-color: var(--bg-panel); border-top: 1px solid var(--border-color);
    display: flex; align-items: center; padding: 0 1rem; overflow-x: auto; white-space: nowrap; z-index: 20;
}
#timeline-container::-webkit-scrollbar { height: 4px; }
#timeline-container::-webkit-scrollbar-track { background: #f8fafc; }
#timeline-container::-webkit-scrollbar-thumb { background: #cbd5e1; }

.timeline-btn {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border-color);
    padding: 8px 16px; margin-right: 10px; border-radius: 20px;
    cursor: pointer; font-size: 0.9rem; transition: all 0.2s; font-weight: 500;
}
.timeline-btn:hover { border-color: var(--brand-color); color: var(--brand-color); }
.timeline-btn.active {
    background: var(--brand-color); color: #fff; border-color: var(--brand-color); font-weight: bold;
}

@media (max-width: 900px) {
    #app-container { flex-direction: column-reverse; }
    #info-panel { width: 100%; height: 50%; border-right: none; border-top: 1px solid var(--brand-color); }
    .factory-img { height: 180px; }
    .info-content { padding: 1.5rem; }
    #map-panel { width: 100%; height: 50%; }
}

/* ----- CSS BẢN ĐỒ ĐỐM SÁNG MỚI ----- */
.spot {
    position: absolute; width: 14px; height: 14px; border-radius: 50%;
    cursor: pointer; z-index: 10;
    transform: translate(-50%, -50%); /* Căn giữa hoàn hảo tọa độ */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Nảy nhẹ */
    box-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Bóng mặc định */
}
.spot:hover { transform: translate(-50%, -50%) scale(1.3); z-index: 20; }

.spot-red { background-color: #ff3333; }
.spot-blue { background-color: #00ccff; }
.spot-green { background-color: #99ff99; border: 1px solid #4dff4d; }

/* Sáng viền trắng khi được chọn */
.spot.active {
    transform: translate(-50%, -50%) scale(1.8);
    z-index: 50; 
    box-shadow: 0 0 0 3px #ffffff, 0 0 15px rgba(0, 0, 0, 0.5);
}