:root{--z-index-overlay:1000;--z-index-nav-toggle:1010;--z-index-sidebar:1020;--z-index-detail-panel:1030}
*{margin:0;padding:0;box-sizing:border-box}
html,body,#dmap{margin:0;padding:0;height:100%;width:100%;position:relative;z-index:10;font-family:'Roboto','Arial',sans-serif}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}
.dheader-map{border-bottom:1px solid rgba(255,255,255,0.4)}
.dheader-map-inner{height:60px;display:grid;grid-template-columns:300px 1fr;gap:20px;align-items:center;justify-content:center}
.dlogo-map{text-align:center;margin:5px auto}
.dlogo-map img{height:50px;width:auto;max-width:100%}
.dsologan-map{text-transform:uppercase;color:RED;font-weight:700;font-size:24px}
.mapboxgl-ctrl{display:none !important}
.mcontainer{position:relative;width:100%;height:100%;background-color:#f0f2f5;display:grid;grid-template-columns:1fr 240px;gap:10px}
#sidebar{width:240px;border-right:1px solid #e8eaed;box-shadow:0 2px 10px rgba(0,0,0,0.1);transition:all .3s ease;z-index:var(--z-index-sidebar);height:100vh;overflow-y:auto;overflow-x:hidden}
.dmapcer{position:relative;height:100vh}
#dmap{width:100%;height:100%}
#sidebar>.dhead{background:linear-gradient(135deg,#e74c3c 0%,#c0392b 100%);color:white;padding:10px;display:flex;align-items:center;gap:15px;position:relative;flex-shrink:0}
#sidebar>.dhead .logo{width:50px;height:50px;background:#fff;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer}
#sidebar>.dhead .logo img{width:22px;height:22px;object-fit:contain}
#sidebar>.dhead>div h1{font-size:18px;font-weight:700;margin:0}
#sidebar>.dhead>div h1>a{color:white;text-decoration:none}
#sidebar>.dhead>div h1>a:hover{color:#CCC}
.search-section{padding:10px;background:white;margin:8px;border-radius:8px;border:1px solid #e8eaed;flex-shrink:0}
.search-section h3{color:#202124;margin-bottom:12px;text-align:center;font-weight:700}
.search-box{position:relative}
.search-input{width:100%;padding:10px;border:1px solid #dadce0;border-radius:8px;outline:none;transition:border-color .2s;font-size:17px}
.search-input:focus{border-color:#1a73e8;box-shadow:0 0 0 2px rgba(26,115,232,0.1)}
#communeList{flex:1;overflow-y:auto;margin:0 8px 8px 8px;background:white;border-radius:8px;border:1px solid #e8eaed}
#communeList>.citem{padding:10px;border-bottom:1px solid #f1f3f4;cursor:pointer;display:flex;align-items:center;gap:12px;transition:background-color .2s}
#communeList>.citem:hover{background-color:#f8f9fa}
#communeList>.citem.selected{background-color:#e8f0fe;border-left:4px solid #1a73e8}
#communeList>.citem:first-child{border-radius:8px 8px 0 0}
#communeList>.citem:last-child{border-bottom:none;border-radius:0 0 8px 8px}
#communeList>.citem>.dot{width:12px;height:12px;border-radius:50%;flex-shrink:0;border:1px solid rgba(0,0,0,0.1)}
#communeList>.citem>.cname{font-size:15px;color:#202124;font-weight:400}
.maplibregl-ctrl-top-left{top:0;left:5px}
#detailPanel{position:absolute;top:20px;right:15px;width:320px;background:white;border-radius:8px;box-shadow:0 4px 16px rgba(0,0,0,0.12);z-index:var(--z-index-detail-panel);max-height:calc(100vh - 40px);overflow:hidden;transition:all .3s ease;visibility:hidden;opacity:0;pointer-events:none}
#detailPanel.show{visibility:visible;opacity:1;pointer-events:auto}
#detailPanel>.pheader{padding:10px;border-bottom:1px solid #e8eaed;position:relative;color:#000}
#detailPanel h2.ptitle{font-size:23px;font-weight:400;margin:0 40px 0 0;line-height:1.3}
#detailPanel h2.ptitle>a{color:#101;text-decoration:none}
#detailPanel h2.ptitle>a:hover{color:RED}
#detailPanel .bclose{position:absolute;top:12px;right:20px;width:32px;height:32px;border:none;background:#CCC;color:RED;cursor:pointer;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background-color .2s}
#detailPanel .bclose:hover{background-color:#f1f3f4}
#detailPanel>.pcontent{padding:5px;overflow-y:auto;max-height:calc(100vh - 185px);position:relative;min-height:200px}
.detail-info{display:flex;justify-content:space-between;margin-bottom:10px;gap:10px}
.detail-info-item{text-align:center;flex:1}
.text-blue{color:#324C9A;font-weight:bold}
.bg-text-blue{background-color:#EFF6FF;padding:8px;border-radius:10px}
.text-green{color:#155A32;font-weight:bold;background-color:#F0FDF4}
.bg-text-green{background-color:#F0FDF4;padding-top:10px;padding-bottom:10px;border-radius:10px}
.detail-info-value{font-size:18px;margin-bottom:4px}
.detail-info-label{font-size:14px;font-weight:500}
.detail-section{margin-bottom:10px}
.detail-section-title{font-size:16px;font-weight:500;color:#202124;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.detail-section-title a{color:#000;text-decoration:none}
.detail-section-title a:hover{color:RED}
.detail-section-content{font-size:15px;line-height:1.5}
.detail-section .etail-section-title a{text-decoration:none}
.detail-contact{background:#f8f9fa;border-radius:8px;padding:10px}
.contact-item{margin-bottom:10px;font-size:15px;line-height:1.4}
.contact-item:last-child{margin-bottom:0}
.contact-icon{width:20px;height:20px;color:#5f6368}
.contact-text{font-size:14px;color:#202124}
.contact-link{color:#1a73e8;text-decoration:none}
.contact-link:hover{text-decoration:underline}

@media (max-width:768px){
    .dmapcer{width:100%;margin-left:0;position:relative}
    #detailPanel{position:fixed;bottom:0;left:0;right:0;top:auto;width:100%;max-height:70vh;border-radius:16px 16px 0 0;transform:translateY(100%);visibility:visible;opacity:1;pointer-events:auto;z-index:var(--z-index-detail-panel)}
    #detailPanel.show{transform:translateY(0)}
    #detailPanel>.pcontent{max-height:calc(70vh - 80px);padding:15px}
    #detailPanel>.pheader{padding:15px}
    #detailPanel h2.ptitle{font-size:22px}
    .detail-info{flex-direction:column;gap:15px;margin-bottom:20px}
    .detail-info-item{text-align:left;display:flex;justify-content:space-between;align-items:center;padding:12px;background:#f8f9fa;border-radius:8px}
    .detail-info-value{font-size:18px;margin-bottom:0}
    .detail-info-label{font-size:16px}
    .detail-section-title{font-size:16px}
    .detail-section-content{font-size:15px}
    .contact-item{font-size:15px;flex-wrap:wrap}
    #sidebar>.dhead{align-items:center;justify-content:center}
    .custom-label.zoom-small{font-size:8px;max-width:60px}
    .custom-label.zoom-medium{font-size:11px;max-width:100px}
    .custom-label.zoom-large{font-size:14px}
    .custom-label.zoom-xlarge{font-size:16px}
    #detailPanel .bclose{top:13px}
}
@media (max-width:480px){
    #sidebar{width:90%;max-width:none}
    #sidebar>.dhead{padding:15px;align-items:center;justify-content:center;gap:15px;position:relative}
    #sidebar>.dhead>div h1{font-size:18px}
    #sidebar.collapsed{width:90%;transform:translateX(-100%)}
    .search-section{padding:12px;margin:6px}
    .search-section h3{font-size:20px}
    .search-input{font-size:16px;padding:10px 14px}
    #communeList{margin:0 6px 6px 6px}
    #communeList>.citem{padding:12px 14px}
    #communeList>.citem>.cname{font-size:16px}
    #detailPanel{max-height:75vh}
    #detailPanel>.pcontent{max-height:calc(75vh - 70px);padding:12px}
    #detailPanel>.pheader{padding:12px}
    #detailPanel h2.ptitle{font-size:20px}
    .detail-info-item{padding:10px}
    .detail-info-value{font-size:16px}
    .detail-info-label{font-size:14px}
    .detail-section-title{font-size:15px}
    .detail-section-content{font-size:14px}
    .contact-item{font-size:14px}
    #sidebar .close-btn{display:none !important}
    .custom-label.zoom-small{font-size:7px;max-width:50px}
    .custom-label.zoom-medium{font-size:10px;max-width:80px}
    .custom-label.zoom-large{font-size:13px}
    .custom-label.zoom-xlarge{font-size:15px}
    #detailPanel .bclose{top:10px}
    #detailPanel>.pheader{display:flex;align-items:center;padding:15px}
}
@media (max-width:425px){
    #communeList>.citem>.cname{font-size:15px}
    #sidebar{width:95%}
    #sidebar.collapsed{width:95%;transform:translateX(-100%)}
    .mobile-toggle{width:48px;height:48px;top:16px;left:12px}
    #sidebar>.dhead{padding:15px;display:flex;align-items:center;justify-content:center;gap:15px;position:relative}
    #sidebar>.dhead>div h1{font-size:16px}
    .search-section h3{font-size:18px}
    #communeList>.citem>.cname{font-size:15px}
    .toggle-buttons{right:10px}
    .toggle-btn{width:35px;height:35px}
    .toggle-btn svg{width:18px;height:18px}
    #sidebar .close-btn{display:none !important}
    #detailPanel{max-height:80vh}
    #detailPanel>.pcontent{max-height:calc(80vh - 60px);padding:10px}
    #detailPanel>.pheader{padding:16px}
    #detailPanel h2.ptitle{font-size:18px}
}
@media (max-width:375px){
    #sidebar{width:100%}
    #sidebar.collapsed{width:100%;transform:translateX(-100%)}
    #sidebar>.dhead{padding:12px;display:flex;align-items:center;gap:12px;position:relative}
    #sidebar>.dhead>div h1{font-size:15px}
    .search-section{padding:10px;margin:4px}
    .search-section h3{font-size:17px}
    .search-input{font-size:15px;padding:8px 12px}
    #communeList{margin:0 4px 4px 4px}
    #communeList>.citem{padding:10px 12px}
    #communeList>.citem>.cname{font-size:14px}
    #detailPanel{max-height:85vh}
    #detailPanel>.pcontent{max-height:calc(85vh - 50px);padding:8px}
    #detailPanel>.pheader{padding:8px}
    #detailPanel h2.ptitle{font-size:16px}
}

#communeList::-webkit-scrollbar,#detailPanel>.pcontent::-webkit-scrollbar{width:6px}
#communeList::-webkit-scrollbar-track,#detailPanel>.pcontent::-webkit-scrollbar-track{background:transparent}
#communeList::-webkit-scrollbar-thumb,#detailPanel>.pcontent::-webkit-scrollbar-thumb{background:#dadce0;border-radius:3px}
#communeList::-webkit-scrollbar-thumb:hover,#detailPanel>.pcontent::-webkit-scrollbar-thumb:hover{background:#bdc1c6}
.mcontainer .loading{display:flex;align-items:center;justify-content:center;padding:40px;color:#5f6368}
.mcontainer .loading::after{content:'';width:20px;height:20px;border:2px solid #e8eaed;border-top:2px solid #1a73e8;border-radius:50%;animation:spin 1s linear infinite;margin-left:12px}
@keyframes spin{
    0%{transform:rotate(0deg)}
    100%{transform:rotate(360deg)}
}
#communeList>.citem{animation:fadeInUp .3s ease}
@keyframes fadeInUp{
    from{opacity:0;transform:translateY(10px)}
    to{opacity:1;transform:translateY(0)}
}
@media(min-width:769px) and (max-width:871px){
    #sidebar{width:253px}
    #sidebar>.dhead>div h1{font-size:15px}
    #sidebar>.dhead{padding:15px !important}
    .search-section h3{font-size:15px !important}
    #communeList>.citem>.cname{font-size:11px}
    .search-input{font-size:15px}
    .search-section{padding:8px}
    #detailPanel h2.ptitle{font-size:16px}
    #detailPanel{width:267px}
    .contact-item{font-size:12px;padding:5px 11px;margin-bottom:0}
    .detail-info{margin-top:7px;margin-bottom:7px}
    .detail-section{margin-bottom:10px}
    .detail-section-title{font-size:13px}
    #detailPanel>.pheader{padding:10px}
    #detailPanel>.pcontent{padding:10px}
    .detail-section-content{font-size:13px}
    .detail-info-value{font-size:15px}
    .detail-contact{padding:0}
    .detail-section{margin-bottom:14px}
    #detailPanel .bclose{top:11px}
}
.search-select{width:100%;padding:10px 15px;border:2px solid #e0e0e0;border-radius:25px;font-size:14px;background-color:#fff;transition:all .3s ease;outline:none;appearance:none;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right 15px center;background-size:16px;padding-right:45px}
.search-select:focus{border-color:#4CAF50;box-shadow:0 0 0 3px rgba(76,175,80,0.1)}
.search-select:disabled{background-color:#f5f5f5;color:#999;cursor:not-allowed}
.list_article{width:100%}
.list_article ul{list-style:none;padding:3px}
.list_article ul>li{list-style:none;margin-bottom:15px}
.list_article ul>li>div{display:flex;font-size:12px}
.list_article ul>li>div>a{text-decoration:none;display:flex;gap:10px;color:#333}
.list_article ul>li>div>a img{width:100px;height:67px !important}
.list_article ul>li>div>a h3{font-size:13px;line-height:1.4em}
.list_article ul>li>div>a:hover{color:#AE0008}
#sidebar>.dhead,.list_article,.city-info,.search-section{flex-shrink:0}
#communeList{flex:1;overflow-y:auto;margin:0 8px 8px 8px;background:white;border-radius:8px;border:1px solid #e8eaed;min-height:300px}
#sidebar::-webkit-scrollbar{width:8px}
#sidebar::-webkit-scrollbar-track{background:#f8f9fa;border-radius:4px}
#sidebar::-webkit-scrollbar-thumb{background:#dadce0;border-radius:4px}
#sidebar::-webkit-scrollbar-thumb:hover{background:#bdc1c6}
@media (max-width:768px){
    #sidebar{overflow-y:auto}
}
.mobile-nav-toggle{display:none;position:fixed;top:15px;left:15px;z-index:var(--z-index-nav-toggle);background-color:white;border:none;border-radius:8px;width:45px;height:45px;box-shadow:0 2px 10px rgba(0,0,0,0.2);cursor:pointer;font-size:24px;line-height:45px;text-align:center;transition:all .3s ease}
.mobile-nav-toggle:hover{transform:scale(1.1)}
.mobile-nav-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.5);z-index:var(--z-index-overlay);backdrop-filter:blur(2px)}
@media (max-width:991px){
    .mobile-nav-toggle{display:block;z-index:var(--z-index-nav-toggle)}
    #sidebar{position:fixed;top:0;left:0;width:300px;max-width:85vw;height:100%;z-index:var(--z-index-sidebar);transform:translateX(-100%);transition:transform .35s ease-in-out;border-right:1px solid #e0e0e0}
    #sidebar.is-open{transform:translateX(0)}
    .mobile-nav-overlay.is-open{display:block;z-index:var(--z-index-overlay)}
    .mcontainer{grid-template-columns:1fr}
    .dmapcer{width:100%}
    .detail-panel{position:fixed;bottom:0;top:auto;left:0;right:0;width:100%;max-height:75vh;border-radius:16px 16px 0 0;transform:translateY(100%)}
    .detail-panel.show{transform:translateY(0)}
    #detailPanel>.pcontent{max-height:calc(75vh - 70px)}
    .maplibregl-ctrl-top-left{left:auto;right:10px}
}
@media (max-width:767px){
    .dheader-map-inner{grid-template-columns:1fr;height:auto;padding:10px 0;gap:5px}
    .dlogo-map{grid-row:1}
    .dsologan-map{font-size:15px;text-align:center}
    #detailPanel h2.ptitle{font-size:18px}
}

.map-loading-overlay {
    /* Che phủ toàn bộ container của bản đồ */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Căn giữa nội dung bên trong (spinner và text) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* Màu nền mờ */
    background-color: rgba(255, 255, 255, 0.8);
    
    /* Đảm bảo nó nằm trên lớp bản đồ */
    z-index: 999; 
    
    /* Thêm hiệu ứng chuyển động cho đẹp mắt */
    transition: opacity 0.3s ease-in-out;

    /* Ẩn đi mặc định, sẽ được JS bật lên */
    opacity: 0;
    pointer-events: none; /* Không cho click xuyên qua khi đang ẩn */
}

.map-loading-overlay.visible {
    opacity: 1;
    pointer-events: auto; /* Cho phép tương tác khi hiện */
}

/* Biểu tượng quay (spinner) */
.loader-spinner {
    border: 6px solid #f3f3f3; /* Vòng tròn xám nhạt */
    border-top: 6px solid #007bff; /* Màu xanh cho hiệu ứng quay */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.map-loading-overlay p {
    font-weight: bold;
    color: #333;
}

/* Animation cho spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lớp phủ loading cho panel chi tiết */
.detail-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Căn giữa spinner */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Nền trắng mờ */
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    
    transition: opacity 0.2s ease-in-out;

    /* Mặc định sẽ ẩn, điều khiển bằng class 'visible' */
    opacity: 0;
    pointer-events: none;
}

.detail-loader-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}