/* * Tên file: home.css
 * Vị trí: /assets/css/home.css
 * Version: 1.4.0
 * Changelog: Append CSS cho giao diện Glassmorphism Modal (Stage 4.2).
 * Mục đích: Layout 3 cột, Bản đồ 16:9, Hiệu ứng Click to Center & Zoom 3D.
 */

/* =========================================
   1. BACKGROUND ĐỘT PHÁ (AMBIENT GLOW)
========================================= */
.hero-wrapper {
    position: relative; background-color: #f0f7fb; overflow: hidden;
}
.hero-wrapper::before, .hero-wrapper::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(80px); z-index: 0; animation: floatGlow 10s infinite alternate ease-in-out; pointer-events: none;
}
.hero-wrapper::before { width: 600px; height: 600px; background: rgba(0, 168, 204, 0.15); top: -100px; left: -150px; }
.hero-wrapper::after { width: 500px; height: 500px; background: rgba(0, 86, 179, 0.1); bottom: -50px; right: -100px; animation-delay: -5s; }
@keyframes floatGlow { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(30px, 50px) scale(1.1); } }
.hero-content { position: relative; z-index: 1; }

/* =========================================
   2. TRỢ LÝ KHẢO SÁT & LAYOUT CHUNG
========================================= */
.smart-assistant-card {
    background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 80, 0.05); text-align: center;
}
.survey-step { display: none; animation: fadeIn 0.4s ease; }
.survey-step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chip-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.chip-btn {
    padding: 10px 20px; background: #fff; border: 2px solid var(--border-color); border-radius: 30px; font-weight: 600; color: var(--text-muted);
    cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.chip-btn:hover { border-color: var(--cyan-teal); color: var(--cyan-teal); transform: translateY(-2px); }

.dashboard-grid { display: grid; grid-template-columns: 280px 1fr 280px; gap: 25px; margin-top: 10px; align-items: stretch; }
.glass-panel {
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 86, 179, 0.05), inset 0 0 20px rgba(255,255,255,0.5); padding: 20px; position: relative; overflow: hidden;
}

/* =========================================
   3. CỘT TRÁI & CỘT PHẢI
========================================= */
.ranking-header { font-size: 18px; color: var(--primary-blue); font-weight: 800; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.rank-item {
    display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 12px; background: rgba(255,255,255,0.85); border-radius: 14px; transition: all 0.4s; box-shadow: 0 4px 15px rgba(0,0,0,0.02); cursor: pointer;
}
.rank-item:hover { transform: scale(1.05) translateX(10px); background: #fff; box-shadow: 0 10px 25px rgba(0, 168, 204, 0.15); }
.vip-1 { border-left: 4px solid #ff6b00; } .vip-2 { border-left: 4px solid #00e5ff; } .vip-3 { border-left: 4px solid #f9ca24; } 
.rank-num { font-size: 14px; font-weight: 900; min-width: 20px; text-align: center;}
.vip-1 .rank-num { color: #ff6b00; } .vip-2 .rank-num { color: #00a8cc; } .vip-3 .rank-num { color: #f9ca24; }
.rank-logo { width: 42px; height: 42px; border-radius: 50%; object-fit: contain; background: #fff; padding: 2px;}
.vip-1 .rank-logo { border: 2px solid #ff6b00; box-shadow: 0 0 10px rgba(255, 107, 0, 0.3);} .vip-2 .rank-logo { border: 2px solid #00e5ff; box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);} 
.rank-info h4 { font-size: 14px; color: var(--text-main); margin-bottom: 2px; } .rank-info p { font-size: 11px; color: var(--text-muted); font-weight: 600;}

.shortcut-vertical {
    display: flex; align-items: center; gap: 15px; padding: 18px; background: rgba(255,255,255,0.7); border-radius: 16px; margin-bottom: 15px; border: 1px solid rgba(255,255,255,0.8); transition: all 0.3s; position: relative; overflow: hidden;
}
.shortcut-vertical:hover { background: #fff; transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 25px rgba(0, 168, 204, 0.15); border-color: var(--cyan-teal); }
.sv-icon { font-size: 28px; transition: transform 0.3s; }
.shortcut-vertical:hover .sv-icon { transform: scale(1.2) rotate(5deg); }
.sv-text h4 { font-size: 15px; color: var(--primary-blue); margin-bottom: 2px;} .sv-text p { font-size: 12px; color: var(--text-muted); line-height: 1.3;}

/* =========================================
   4. BẢN ĐỒ 16:9 ĐỘT PHÁ (SCI-FI MEDICAL)
========================================= */
.map-core-panel { display: flex; flex-direction: column; padding: 15px; }
.map-container {
    width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 16px; position: relative; overflow: hidden;
    background: #f8fdff; background-image: linear-gradient(rgba(0, 168, 204, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 168, 204, 0.1) 1px, transparent 1px); background-size: 40px 40px;
    border: 2px solid rgba(0, 168, 204, 0.3); box-shadow: inset 0 0 60px rgba(0, 168, 204, 0.15), 0 10px 30px rgba(0,0,0,0.08);
}
.map-container::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 200%; height: 200%;
    background: conic-gradient(transparent 270deg, rgba(0, 229, 255, 0.1) 360deg); transform-origin: center; margin-top: -100%; margin-left: -100%;
    animation: radarSweep 6s linear infinite; pointer-events: none; z-index: 0;
}
@keyframes radarSweep { 100% { transform: rotate(360deg); } }

.map-axis-x { position: absolute; bottom: 25px; left: 25px; right: 25px; height: 2px; background: rgba(0,86,179,0.3); z-index: 1;}
.map-axis-y { position: absolute; bottom: 25px; left: 25px; top: 25px; width: 2px; background: rgba(0,86,179,0.3); z-index: 1;}
.axis-label { position: absolute; font-size: 10px; font-weight: 800; color: var(--primary-blue); text-transform: uppercase; }
.label-x { right: 0; bottom: -20px; } .label-y { top: -20px; left: -15px; }

/* Lớp màng mờ đi khi có 1 node được Focus */
.map-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.75); backdrop-filter: blur(4px);
    z-index: 50; opacity: 0; pointer-events: none; transition: all 0.5s ease;
}
.map-container.has-focus .map-overlay { opacity: 1; pointer-events: auto; cursor: pointer; } /* Click để tắt */

/* Các node bệnh viện */
.hospital-node {
    position: absolute; z-index: 5; transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.node-core {
    position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #fff; transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: floatNode 4s infinite ease-in-out alternate; cursor: pointer;
}
@keyframes floatNode { 0% { transform: translateY(0px); } 100% { transform: translateY(-8px); } }
.node-core img { width: 70%; height: 70%; object-fit: contain; border-radius: 50%; pointer-events: none; }

.short-name { 
    position: absolute; bottom: -28px; font-size: 11px; font-weight: 800; color: var(--text-main); white-space: nowrap; 
    background: rgba(255,255,255,0.9); padding: 4px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: all 0.3s;
}

/* Vòng tròn thông số (Bình thường bị ẩn) */
.stats-ring {
    position: absolute; width: 100%; height: 100%; border: 1px dashed transparent;
    border-radius: 50%; opacity: 0; transform: scale(0.5); transition: all 0.5s; pointer-events: none;
    display: flex; align-items: center; justify-content: center; z-index: -1;
}
.stat-dot { 
    position: absolute; width: 36px; height: 36px; background: #fff; border: 2px solid; border-radius: 50%; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    font-size: 14px; transition: all 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.15); cursor: pointer;
}
.stat-dot span { font-size: 9px; font-weight: bold; margin-top: -2px; color: var(--text-muted); }

.stat-dot:nth-child(1) { top: -18px; left: 50%; margin-left: -18px; }
.stat-dot:nth-child(2) { bottom: -18px; left: 50%; margin-left: -18px; }
.stat-dot:nth-child(3) { left: -18px; top: 50%; margin-top: -18px; }
.stat-dot:nth-child(4) { right: -18px; top: 50%; margin-top: -18px; }

/* =========================================
   HIỆU ỨNG FOCUS & ZOOM 3D (KHI ĐƯỢC CLICK)
========================================= */
.hospital-node.focused {
    left: 50% !important; bottom: 50% !important; transform: translate(-50%, 50%) !important;
    z-index: 100 !important;
}
.hospital-node.focused .node-core {
    transform: scale(2.8); /* Zoom to đùng giữa màn hình */
    box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
    animation-play-state: paused;
}
.hospital-node.focused .short-name {
    transform: scale(0.5) translateY(45px); /* Chỉnh lại tỷ lệ text cho phù hợp */
    background: var(--primary-blue); color: #fff; font-size: 16px; padding: 8px 12px;
}
.hospital-node.focused .stats-ring {
    width: 200%; height: 200%; /* Bung vòng tròn ra */
    opacity: 1; transform: scale(1);
    border: 2px dashed rgba(0, 168, 204, 0.5);
    background: rgba(255, 255, 255, 0.85); 
    animation: spinRing 25s linear infinite; pointer-events: auto; /* Cho phép click */
}
.hospital-node.focused .stat-dot { transform: scale(0.45); /* Resize icon vừa vặn */ }
.hospital-node.focused .stat-dot:hover { transform: scale(0.55); background: var(--cyan-teal); color: #fff !important; }
.hospital-node.focused .stat-dot:hover span { color: #fff; }

@keyframes spinRing { 100% { transform: scale(1) rotate(360deg); } }
.stats-ring .stat-dot { animation: antiSpinRing 25s linear infinite; animation-play-state: paused; }
.hospital-node.focused .stats-ring .stat-dot { animation-play-state: running; }
@keyframes antiSpinRing { 100% { transform: scale(0.45) rotate(-360deg); } }

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; } .map-core-panel { order: -1; }
    .map-container { aspect-ratio: 4 / 3; }
}

/* =========================================
   5. BỔ SUNG SPRINT 2: GLASSMORPHISM MODAL 
   (HIỆN THÔNG TIN CHI TIẾT KHI CLICK VỆ TINH)
========================================= */
#glass-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 40, 80, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: all 0.4s ease;
}
#glass-modal-overlay.active { opacity: 1; pointer-events: auto; }

.glass-modal-box {
    width: 90%; max-width: 550px; background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 20px;
    padding: 30px; box-shadow: 0 20px 60px rgba(0, 86, 179, 0.2);
    transform: translateY(30px) scale(0.95); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; max-height: 85vh; overflow-y: auto;
}
#glass-modal-overlay.active .glass-modal-box { transform: translateY(0) scale(1); }

.glass-modal-close {
    position: absolute; top: 15px; right: 20px; background: none; border: none;
    font-size: 32px; color: var(--text-muted); cursor: pointer; transition: 0.3s;
    line-height: 1; padding: 0 5px;
}
.glass-modal-close:hover { color: var(--danger-red); transform: rotate(90deg) scale(1.1); }

.modal-header-info { display: flex; align-items: center; gap: 15px; }