/* ================= RESET GLOBAL ================= */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ========================GLOBAL======================== */

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:'Poppins',sans-serif;
}

html{
  scroll-behavior:smooth;
}

body{
  background:#f4f7fb;
  overflow-x:hidden;
}

/* ========================NAVBAR======================== */

.navbar{
  position:fixed;
  top:0;
  left:0;
  z-index:99999;

  width:100%;
  height:75px;

  display:flex;
  align-items:center;

  padding:0 25px;

  background:rgba(255,255,255,0.95);
  backdrop-filter:blur(10px);

  box-shadow:0 4px 20px rgba(0,0,0,0.08);

  opacity:0;
  visibility:hidden;

  transition:0.4s;
}

.leaflet-top{
  top:90px;
}

/* LOGO */

.logo{
  margin-right:20px;

  font-size:18px;
  font-weight:700;
  line-height:1.4;
  color:#1e3a8a;
}

/* MENU */

.menu{
  display:flex;
  align-items:center;
  gap:25px;
  margin-left:auto;
}

/* BUTTON */

.menu-btn{
  height:42px;
  padding:10px 18px;

  display:flex;
  align-items:center;

  border:none;
  border-radius:10px;

  background:transparent;

  cursor:pointer;

  font-size:15px;
  font-weight:500;

  transition:0.3s;
}

.menu-btn:hover{
  background:#eff6ff;
  color:#2563eb;
}

/* LOGIN BUTTON */

.menu-btn.login{
  background:#2563eb;
  color:white;
}

.menu-btn.login:hover{
  background:#1d4ed8;
}

/* ========================DROPDOWN========================*/

.dropdown{
  position:relative;
  margin-right:0;
}

.dropdown-content{
  display:none;
  position:absolute;
  top:45px;
  right:0;
  z-index:999999;

  min-width:250px;
  padding:12px;

  background:white;
  border-radius:12px;

  box-shadow:0 8px 20px rgba(0,0,0,0.15);
}

.dropdown-content a{
  padding:10px 14px;

  text-decoration:none;
  color:#333;

  border-radius:10px;

  transition:0.3s;
}

.dropdown-content a:hover{
  background:#eff6ff;
  color:#2563eb;
}

/* ================= DROPDOWN DATA ================= */

.dropdown.data .dropdown-content{
  flex-direction:column;
}

.dropdown.data.active .dropdown-content{
  display:flex;
}

/* ================= DROPDOWN WILAYAH ================= */

.dropdown.wilayah .dropdown-content{
  flex-direction:row;

  min-width:500px;

  gap:15px;
}

.dropdown.wilayah.active .dropdown-content{
  display:flex;
}

.dropdown.wilayah{
  margin:0 !important;
}

/* GRID */

.wilayah-grid{
  min-width:500px;
}

.kolom{
  min-width:220px;
  max-height:300px;

  overflow-y:auto;
}

.kolom a{
  display:block;
  padding:10px 12px;

  text-decoration:none;
  color:#333;

  border-radius:8px;
  transition:0.2s;
}

.kolom a:hover{
  background:#eff6ff;
  color:#2563eb;
}


/* ========================LOGIN MODAL======================== */

.login-modal{
  display:none;
}

/* ========================HERO SECTION======================== */

.hero{
  width:100%;
  height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:20px;
  text-align:center;
  color:white;
  background:
    linear-gradient(
      rgba(0,0,0,0.65),
      rgba(0,0,0,0.65)
    ),
    url('../libs/icon/masamba.jpg');

  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
   position: relative;
}

.hero-content{
  max-width:850px;
}

.hero-content h1{
  margin-bottom:20px;
  font-size:55px;
  line-height:1.3;
}

.hero-content p{
  margin-bottom:30px;
  font-size:18px;
  line-height:1.8;
}

/* BUTTON */

.btn{
  display:inline-block;
  padding:14px 30px;
  background:#2563eb;
  color:white;
  text-decoration:none;
  font-weight:600;
  border-radius:12px;
  transition:0.3s;
}

.btn:hover{
  background:#1d4ed8;
  transform:translateY(-3px);
}

/* ========================SECTION TITLE======================== */

.judul-section,
.judul-diagram{
  margin-bottom:40px;
  text-align:center;
  font-size:38px;
  font-weight:700;
  color:#1e3a8a;
}

/* ========================TENTANG SECTION======================== */

.tentang{
  padding:80px 50px;
  text-align:center;
}

.tentang h2{
  margin-bottom:20px;
  font-size:40px;
  color:#1e3a8a;
}

.tentang p{
  max-width:900px;
  margin:auto;
  line-height:1.9;
  color:#444;
}

/* ========================GRID INFORMASI======================== */

.tentang-container{
  width:100%;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:20px;
  align-items:stretch;
}

/* ========================CARD======================== */

.box{
  position:relative;
  overflow:hidden;
  padding:80px 30px 30px 30px;
  text-align:center;
  background:white;
  border-radius:24px;
  box-shadow:0 10px 30px rgba(0,0,0,0.08);
  transition:all 0.4s ease;
}

.box::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:90px;
  background:linear-gradient(
    90deg,
    #2563eb,
    #60a5fa
  );
}

.box:hover{
  transform:translateY(-8px);
  box-shadow:0 18px 35px rgba(0,0,0,0.15);
}

/* ICON */
.icon-box{
  width:60px;
  height:60px;
  padding:10px;
  margin-top:-80px;
  margin-bottom:15px;
  position:relative;
  z-index:2;
  object-fit:contain;
  border-radius:50%;
  background:white;
  box-shadow:0 8px 18px rgba(0,0,0,0.15);
}

/* TEXT */

.box h3{
  margin-bottom:15px;
  margin-top:-10px;
  position:relative;
  z-index:2;
  font-size:22px;
  color:#1e3a8a;
}

.box p{
  font-size:15px;
  line-height:1.8;
  color:#555;
}

.box ul{
  padding-left:20px;

  text-align:left;
  line-height:1.9;
  color:#444;
}

/* FOOTER */

.footer-tentang{
  margin-top:50px;

  text-align:center;

  font-size:14px;
  color:#666;
}

/* ========================DIAGRAM========================*/

.diagram-section{
  width:100%;
  margin:auto;
  padding:70px 40px;
}

/* GRID */

.diagram-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:20px;
}

/* CARD */

.chart-container{
  padding:20px;

  background:white;
  border-radius:20px;

  box-shadow:0 8px 20px rgba(0,0,0,0.08);

  transition:0.3s;
}

.chart-container:hover{
  transform:translateY(-5px);
}

.chart-container canvas{
  width:100% !important;
  height:260px !important;
}

/* TITLE */

.chart-title{
  margin-bottom:20px;

  text-align:center;

  font-size:22px;
  font-weight:700;
  color:#1e3a8a;
}

/*========================MAP======================== */

#map-section{
  width:100%;
  padding:0;
  display:none;

  position:relative;
  z-index:1;
}

#map{
  width:100%;
  height:calc(100vh - 75px);

  margin-top:75px;

  position:relative;
  z-index:1;
}

/* ========================LABEL PETA========================*/

.styleLabelDesa,
.styleLabelKecamatan{
  padding:0;
  margin:0;

  font-family:'Times New Roman',Times,serif;
  font-weight:bold;
  color:black;

  background:transparent !important;
  border:none !important;

  box-shadow:none !important;
  text-shadow:none;

  pointer-events:none;
  opacity:0.8;
}

.styleLabelDesa{
  font-size:12px;
}

.styleLabelKecamatan{
  font-size:14px;
}

.styleLabelDesa::before,
.styleLabelKecamatan::before{
  display:none !important;
}

/* ========================LEGENDA======================== */

.legend-modern{
  width:auto;
  padding:8px;

  background:white;
  border-radius:14px;

  box-shadow:0 5px 15px rgba(0,0,0,0.15);
}

/* HEADER */

.legend-header{
  display:flex;
  justify-content:center;
  align-items:center;

  margin-bottom:8px;

  cursor:pointer;
}

.legend-header img{
  width:30px;
  height:30px;

  transition:0.3s;
}

.legend-header img:hover{
  transform:scale(1.1);
}

/* CONTENT */

#legend-content{
  display:none;
}

.legend-modern label{
  display:block;
  margin-bottom:8px;

  cursor:pointer;
}

.legend-modern p{
  display:flex;
  align-items:center;
  gap:8px;

  margin:6px 0;
}

.legend-modern hr{
  margin:10px 0;

  border:none;
  border-top:1px solid #ddd;
}

/* ========================SEARCH CONTROL======================== */

.leaflet-control-search{
  overflow:hidden;

  border-radius:10px !important;

  box-shadow:0 2px 10px rgba(0,0,0,0.2);
}

.leaflet-control-search input{
  width:220px !important;
  height:34px !important;

  padding-left:10px;

  font-size:13px;
}

.leaflet-control-minimap .leaflet-container{
  background:#fff;
}

.leaflet-control-minimap{
  overflow:hidden;
  border-radius:12px;
}

/*========================POPUP DESA======================== */

.popup-desa{
  width:320px;
  font-family:Arial,sans-serif;
}

.popup-img{
  width:90%;
  height:150px;

  object-fit:cover;

  border-radius:10px;

  margin-bottom:10px;
}

.popup-desa h3{
  margin:5px 0;

  text-align:center;
  color:#1e3a8a;
}

.popup-alamat{
  text-align:center;

  font-size:12px;
  color:#555;
}

.popup-desa hr{
  margin:10px 0;

  border:none;
  border-top:1px solid #ddd;
}

/* GRID */

.popup-duakolom{
  display:flex;
  justify-content:space-between;
  gap:15px;
}

.popup-kiri,
.popup-kanan{
  flex:1;
}

.popup-kiri p,
.popup-kanan p{
  margin:8px 0;
  font-size:13px;
}


/* ================= POPUP SEKOLAH ================= */

.popup-sekolah{
  width: 250px;
  font-family: 'Poppins', sans-serif;
}

.popup-img-sekolah{
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 8px;
}

.popup-sekolah h3{
  text-align: center;
  margin: 10px 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.4;
}

.popup-alamat{
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}

.popup-duakolom{
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.popup-kiri p,
.popup-kanan p{
  margin: 4px 0;
  font-size: 12px;
}


/*========================FOOTER======================== */

footer{
  margin-top:50px;
  padding:20px;

  text-align:center;
  color:white;

  background:#1e3a8a;
}


/* ======================== PANEL DATA ======================== */

#panel-data{
  position:fixed;
  top:75px;
  left:0;
  z-index:2000;

  width:100%;
  height:calc(100vh - 75px);

  overflow-y:auto;

  padding:25px;

  background:#f4f7fb;

  display:none;

  max-width:100%;
}

/* ======================== CONTAINER CARD ======================== */

#data-container{
  width:100% !important;
  display:grid !important;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap:20px !important;
  align-items:start !important;
}

.card{
  width:100%;
  min-height:180px;
  padding:22px;
  background:white;
  border-radius:18px;
  box-shadow:0 4px 15px rgba(0,0,0,0.08);
  transition:0.3s;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  overflow:hidden;
  box-sizing:border-box;
}

.card:hover{
  transform:translateY(-5px);
  box-shadow:0 10px 25px rgba(0,0,0,0.14);
}

.card h3{
  font-size:17px;
  line-height:1.5;
  color:#1e3a8a;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.card p{
  font-size:14px;
  color:#555;
  margin-bottom:10px;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.card button{
  width:fit-content;
  margin-top:auto;
  padding:10px 18px;
  border:none;
  border-radius:10px;
  background:#2563eb;
  color:white;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition:0.3s;
}

.card button:hover{
  background:#1d4ed8;
}

.card.sd{
  border-left:12px solid #22c55e;
}

.card.smp{
  border-left:12px solid #eab308;
}

.card.sma{
  border-left:12px solid #ef4444;
}

.card.fasilitas{
  border-left:12px solid #45bd63;
}

/* ======================== PANEL DETAIL ======================== */

#panel-detail{
  position:fixed;
  top:75px;
  right:0;
  z-index:1000;
  width:38%;
  height:calc(100vh - 75px);
  overflow-y:auto;
  padding:25px;
  background:white;
  box-shadow:-5px 0 20px rgba(0,0,0,0.1);
  display:none;
}

/* ========================MAP SPLIT======================== */

.map-split{
    width:62% !important;
}

#map{
  transition:0.4s;
}

/* ========================DETAIL BOX======================== */

.detail-box{
  width:100%;
}

.judul-detail{
  margin-bottom:16px;

  text-align:center;

  font-size:28px;
  color:#1e3a8a;
}

/* ========================TOP SECTION======================== */

.top-section{
  display:flex;
  flex-direction:column; 
  gap:14px;
  margin-bottom:20px;
}

/* IMAGE WRAPPER */
.img-wrapper{
  display:flex;
  justify-content:center;
  align-items:center;
}

/* IMAGE */
.img-sekolah{
  width:100%;
  max-width:340px;
  height:230px;
  object-fit:cover;
  border-radius:16px;
  display:block;
}

.judul-detail{
  margin:10px 0 20px 0;
  text-align:center;
  font-size:28px;
  color:#1e3a8a;
}

/* INFO */

.info-wrapper{
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:center; 
  text-align:center;
}

.info-wrapper h4{
  margin-bottom:8px;

  font-size:20px;
  color:#1e3a8a;
}

.info-wrapper p{
  margin-bottom:15px;

  font-size:14px;
  line-height:1.6;
  color:#555;
}

.info-wrapper h1,
.info-wrapper h2{
  color:#2563eb;
}

/* ========================ACTION BUTTON======================== */

.action-buttons{
  display:flex;
  justify-content:flex-end;
  gap:10px;

  margin-bottom:15px;
}

.btn-detail{
  width:42px;
  height:42px;

  border:none;
  border-radius:12px;

  font-size:18px;
  cursor:pointer;

  transition:0.3s;
}

.btn-download{
  background:#2563eb;
  color:white;
}

.btn-download:hover{
  background:#1d4ed8;
}

.btn-close{
  background:#ef4444;
  color:white;
}

.btn-close:hover{
  background:#dc2626;
}

/* ========================TABLE======================== */

table{
  width:100%;
  margin-top:15px;

  border-collapse:collapse;
}

table th{
  padding:12px;

  background:#2563eb;
  color:white;

  font-size:14px;
}

table td{
  padding:10px;

  border-bottom:1px solid #e5e7eb;

  font-size:14px;
}

table tr:hover{
  background:#f8fafc;
}

/* ========================CANVAS CHART======================== */

canvas{
  margin-top:15px;
}

/* ========================RESPONSIVE PANEL======================== */

@media(max-width:1100px){

  #panel-detail{
    width:340px;
  }

  #panel-data{
    width:100%;
  }

  .map-split{
    width:calc(100% - 360px) !important;
  }

}

@media(max-width:768px){

  #panel-data,
  #panel-detail{
    position:fixed;

    top:85px;
    left:10px;
    right:10px;

    width:auto;
    max-height:75vh;
  }

  .map-split{
    width:100% !important;
  }

  .top-section{
    flex-direction:column;
  }

}

/* ======================== HIDE MAP CONTROL ======================== */

.hide-map-controls .leaflet-control-container{
  display:none !important;
}


/* ========================RESPONSIVE======================== */

@media(max-width:900px){

  .tentang-container{
    grid-template-columns:repeat(2,1fr);
  }

  .diagram-grid{
    grid-template-columns:repeat(2,1fr);
  }

}

@media(max-width:768px){

  .navbar{
    height:auto;
    padding:15px 20px;

    flex-direction:column;
  }

  .logo{
    margin-bottom:15px;
    text-align:center;
  }

  .menu{
    height:75px;
  }

  .hero-content h1{
    font-size:38px;
  }

  .hero-content p{
    font-size:16px;
  }

  .judul-section,
  .judul-diagram{
    font-size:30px;
  }

  .tentang{
    padding:50px 20px;
  }

  .diagram-section{
    padding:50px 20px;
  }

}

@media(max-width:600px){

  .tentang-container,
  .diagram-grid{
    grid-template-columns:1fr;
  }

}

#data-container,
#panel-data,
#panel-detail,
.card{
  box-sizing:border-box;
}

.card *{
  min-width:0;
}


/* ===== FIX FINAL UNTUK PANEL DATA CARD ===== 

.navbar{
  margin-right:0 !important;
}

.dropdown{
  margin-right:0 !important;
}

#panel-data{
  width:100% !important;
}

#data-container{
  width:100% !important;
  display:grid !important;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap:20px !important;
  align-items:start !important;
}

.card{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  min-height:180px;
  padding:22px;
  background:white;
  border-radius:18px;
  box-shadow:0 4px 15px rgba(0,0,0,0.08);
  transition:0.3s;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  overflow:hidden;
  box-sizing:border-box;
}

.card > *{
  min-width:0;
}

.card h3,
.card p{
  margin-bottom:12px;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.card button{
  margin-top:auto;
  width:fit-content;
}

.card.sd{
  border-left:12px solid #22c55e;
}

.card.smp{
  border-left:12px solid #eab308;
}

.card.sma{
  border-left:12px solid #ef4444;
}

@media(max-width:1200px){
  #data-container{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }
}

@media(max-width:768px){
  #data-container{
    grid-template-columns:1fr !important;
  }
}

.card.fasilitas{
  border-left:20px solid #45bd63;
} 
  */

  /* ================= MODAL DOWNLOAD ================= */

.download-modal{
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.5);
  z-index:99999;

  justify-content:center;
  align-items:center;
}

.download-box{
  background:#fff;
  width:350px;
  padding:25px;
  border-radius:15px;
  box-shadow:0 10px 30px rgba(0,0,0,0.2);

  display:flex;
  flex-direction:column;
  gap:15px;
}

.download-box h3{
  margin:0;
  text-align:center;
  color:#1e293b;
}

.download-box input{
  padding:12px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  font-size:14px;
}

.download-actions{
  display:flex;
  gap:10px;
}

.download-actions button{
  flex:1;
  padding:10px;
  border:none;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
}

.download-actions button:first-child{
  background:#2563eb;
  color:white;
}

.download-actions button:last-child{
  background:#e2e8f0;
}

/* ===== MODAL CAPTCHA ===== */

.modal-captcha{
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.5);
  z-index:99999;

  justify-content:center;
  align-items:center;
}

.captcha-box{
  background:#fff;
  width:320px;
  padding:25px;
  border-radius:15px;
  text-align:center;

  box-shadow:0 5px 20px rgba(0,0,0,0.2);
}

.captcha-box h3{
  margin-bottom:15px;
}

.captcha-box input{
  width:100%;
  padding:10px;
  margin:10px 0;

  border:1px solid #ccc;
  border-radius:8px;
}

.captcha-buttons{
  display:flex;
  gap:10px;
  justify-content:center;
  margin-top:15px;
}

.captcha-buttons button{
  border:none;
  padding:10px 18px;
  border-radius:8px;
  cursor:pointer;
  font-weight:bold;
}

.captcha-buttons button:first-child{
  background:#2563eb;
  color:white;
}

.captcha-buttons button:last-child{
  background:#ef4444;
  color:white;
}

/* ================= LOGIN MODAL ================= */

.login-modal{
  display:none;
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  background:rgba(0,0,0,0.5);
  z-index:999999;
  justify-content:center;
  align-items:center;
}

.login-modal.active{
  display:flex;
}

.login-box{
  background:#fff;
  width:320px;
  padding:25px;
  border-radius:15px;
  text-align:center;
  box-shadow:0 5px 20px rgba(0,0,0,0.2);
  margin:auto;
}

.login-box h2{
  margin-bottom:20px;
}

.login-box input{
  width:100%;
  padding:10px;
  margin:10px 0;
  border:1px solid #ccc;
  border-radius:8px;
}

.login-box button{
  width:100%;
  padding:10px;
  margin-top:10px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  font-weight:bold;
  background:#2563eb;
  color:white;
  display:flex;
  flex-direction:column;
}