/* =============================================
   BASE
   ============================================= */
html, body {
    height: 100%;
    padding: 0;
    margin: 0;
    font-family: sans-serif;
    font-size: small;
}

html, body, #map {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}

#map {
    width: 100%;
    height: 100%;
}

/* =============================================
   OL CONTROLS
   ============================================= */
.ol-control {
    clear: both;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
    background-color: rgba(255,255,255,.4) !important;
    padding: 2px !important;
}

.ol-control > * {
    background-color: #f8f8f8 !important;
    color: #444444 !important;
    border-radius: 0px;
}

.ol-control > *:focus,
.ol-control > *:hover {
    background-color: rgba(248, 248, 248, 0.7) !important;
}

.ol-selectable {
    z-index: 3;
}

.ol-attribution {
    display: none;
}

.ol-zoom {
    position: relative;
    float: left;
    top: unset;
    left: unset;
    margin-top: 8px;
    margin-left: 8px;
}

/* =============================================
   POPUP DARK GLASS
   ============================================= */
.ol-popup {
    display: none; /* Wajib: sembunyikan saat awal */
    position: absolute;
    background: rgba(15, 20, 25, 0.88) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 163, 115, 0.25);
    border-radius: 12px;
    padding: 0 !important;
    min-width: 320px;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

.ol-popup:after,
.ol-popup:before {
    display: none !important;
}

.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 10px;
    right: 14px;
    color: rgba(255,255,255,0.5) !important;
    font-size: 15px;
    z-index: 10;
    background: rgba(255,255,255,0.08);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: cursive;
    font-weight: bold;
}

.ol-popup-closer:after {
    content: "✕";
}

.ol-popup-closer:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,0.18);
}

.ol-overlaycontainer-stopevent #top-right-container .layer-switcher:hover
~ .ol-overlaycontainer-stopevent .ol-overlay-container .ol-popup {
    display: none !important;
}

/* =============================================
   POPUP CONTENT
   ============================================= */
#popup-content {
    font-size: 12px;
    line-height: 1.2;
    margin-top: 0;
    max-height: 70vh;
    max-width: 70vw;
    overflow: auto;
}

#popup-content ul {
    list-style-type: none;
    padding-left: 0;
    margin: unset;
}

#popup-content li {
    margin-bottom: 0.25em;
}

#popup-content > ul > li > a {
    position: relative;
    display: block;
    padding: 2px;
    border-bottom: 1px solid #666;
    font-size: 12.5px;
}

#popup-content > table {
    font-size: 11.4px;
}

/* =============================================
   TABLE
   ============================================= */
th, td {
    vertical-align: top;
    text-align: left;
    color: #333;
}

th {
    min-width: 100px;
}

td {
    min-width: 100px;
}

td img {
    max-height: 50vh !important;
    max-width: 50vw !important;
}

td video {
    max-height: 50vh !important;
    max-width: 50vw !important;
}

/* =============================================
   LAYOUT CONTAINERS
   ============================================= */
#top-left-container {
    position: absolute;
    left: 0;
    top: 0;
}

#bottom-left-container {
    position: absolute;
    left: 0;
    bottom: 0;
}

#top-right-container {
    position: absolute;
    right: 0;
    top: 0;
    display: contents;
}

#bottom-right-container {
    position: absolute;
    right: 0;
    bottom: 0;
}

/* =============================================
   TITLE & ABSTRACT
   ============================================= */
.top-left-title, .top-left-abstract {
    position: relative;
    float: left;
    margin-top: 8px;
    margin-left: 8px;
}

.bottom-left-title, .bottom-left-abstract {
    position: relative;
    float: left;
    margin-bottom: 8px;
    margin-left: 8px;
}

.top-right-title, .top-right-abstract {
    position: relative;
    float: right;
    margin-top: 8px;
    margin-right: 8px;
}

.bottom-right-title, .bottom-right-abstract {
    position: relative;
    float: right;
    margin-bottom: 8px;
    margin-right: 8px;
}

.project-title {
    margin: 1px;
    padding: 5px;
}

#abstract {
    max-width: 30%;
}

.ol-touch #abstract {
    max-width: 50%;
}

.project-abstract {
    font: bold 18px 'Lucida Console', Monaco, monospace;
    width: 20px;
    height: 20px;
    display: block;
    text-align: center;
    cursor: pointer;
    padding: 3px;
}

.project-abstract-uncollapsed {
    width: auto;
    height: auto;
    display: block;
    padding: 3px;
    cursor: default;
    margin: 1px;
}

/* =============================================
   MEASUREMENT TOOL
   ============================================= */
.measure-control {
    position: relative;
    float: left;
    top: unset !important;
    left: unset !important;
    margin-top: 8px;
    margin-left: 8px;
    display: flex;
}

.tooltip {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    color: white;
    padding: 4px 8px;
    opacity: 0.7;
    white-space: nowrap;
}

.tooltip-measure {
    opacity: 1;
    font-weight: bold;
}

.tooltip-static {
    background-color: #ffcc33;
    color: black;
    border: 1px solid white;
}

.tooltip-measure:before,
.tooltip-static:before {
    border-top: 6px solid rgba(0, 0, 0, 0.5);
    border-right: 6px solid transparent;
    border-left: 6px solid transparent;
    content: "";
    position: absolute;
    bottom: -6px;
    margin-left: -7px;
    left: 50%;
}

.tooltip-static:before {
    border-top-color: #ffcc33;
}

.ol-touch .measure-control {
    top: 130px;
}

.measure-control label {
    padding: 1px;
    padding-right: 4px;
}

/* =============================================
   GEOLOCATE
   ============================================= */
.geolocate {
    position: relative !important;
    float: left;
    top: unset !important;
    left: unset !important;
    margin-top: 8px;
    margin-left: 8px;
}

/* =============================================
   GEOCODER
   ============================================= */
.ol-geocoder.gcd-gl-container {
    position: relative !important;
    float: left !important;
    top: unset;
    left: unset;
    margin-top: 8px;
    margin-left: 8px;
    clear: both;
}

.gcd-gl-control {
    position: relative !important;
}

.gcd-gl-control button:after {
    display: none;
}

.ol-attribution a,
.gcd-gl-input::placeholder,
.search-layer-input-search::placeholder {
    color: #444444 !important;
}

/* =============================================
   SEARCH LAYER
   ============================================= */
.search-layer {
    position: relative !important;
    float: left;
    top: unset !important;
    left: unset !important;
    margin-top: 8px;
    margin-left: 8px;
}

.search-layer-input-search {
    width: 144px;
    top: 3px;
    padding: 3px;
    background-color: #f8f8f8 !important;
}

.search-layer-input-search:after {
    left: 27px;
    width: 139px;
    top: 0px;
    padding: 4px;
    border: 3px solid rgba(255,255,255,.4) !important;
}

/* =============================================
   SCALE LINE
   ============================================= */
.ol-scale-line {
    background: none !important;
    position: relative;
    float: left;
    bottom: unset;
    left: unset;
    margin-bottom: 8px;
    margin-left: 8px;
}

.ol-scale-line-inner {
    border: 2px solid;
    border-top: none;
    background: rgba(255, 255, 255, 0.5);
    color: black;
    margin: unset;
}

/* =============================================
   LAYER SWITCHER
   ============================================= */
.layer-switcher {
    position: relative;
    float: right;
    top: unset;
    right: 0;
    bottom: unset !important;
    margin-top: 8px;
    margin-right: 8px;
    padding: 3px;
    background-color: rgba(255,255,255,.4) !important;
}

.layer-switcher:hover {
    background-color: rgba(255, 255, 255, .6) !important;
}

.layer-switcher .panel {
    border: unset;
    border-radius: unset;
    float: right;
    width: fit-content;
    margin: 1px;
    max-height: calc(100vh - 200px);
    box-sizing: unset;
    
}

.layer-switcher.shown {
    align-items: flex-end;
}

.layer-switcher.shown.layer-switcher-activation-mode-click > button {
    position: relative;
    border-radius: 5px;
    font-size: x-large;
    font-family: serif;
    z-index: 2;
}

.layer-switcher img {
    max-width: 22px;
    max-height: 22px;
}

/* =============================================
   ATTRIBUTION
   ============================================= */
.bottom-attribution {
    float: right;
    position: relative;
    display: flex;
    font-size: 0.9rem;
}

.bottom-attribution a {
    color: #0078A8;
    text-decoration: none;
}

.bottom-attribution a:hover {
    text-decoration: underline;
}

.bottom-attribution button {
    display: none;
}

.bottom-attribution ul {
    padding: unset;
    margin: unset;
    display: flex;
    list-style: none;
}

.bottom-attribution > li {
    padding-left: 8px !important;
    list-style: none;
}

/* =============================================
   MISC
   ============================================= */
.roller-switcher {
    background-image: url(lds-roller.gif);
    background-size: contain;
    height: 19px;
    width: 19px;
    display: inline-block;
}

.fa-exclamation-triangle {
    color: orangered;
    font-size: 15px;
}

/* =============================================
   PANEL KABUPATEN
   ============================================= */
#panel-kabupaten {
    position: fixed;
    top: 15px;
    right: -420px;
    width: 380px;
    height: calc(100% - 30px);
    background: #1a1f26;
    color: #e0e0e0;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    border-radius: 12px 0 0 12px;
    border-left: 1px solid rgba(212, 163, 115, 0.3);
}

#panel-kabupaten.aktif {
    right: 0;
}

#panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: #2c4c4c;
    border-radius: 12px 0 0 0;
}

#panel-title {
    font-size: 20px;
    font-weight: 700;
    color: #d4a373;
    letter-spacing: 1px;
}

#panel-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#panel-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

#panel-subtitle {
    font-size: 10px;
    color: #d4a373;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 600;
}

#panel-teks {
    font-size: 13.5px;
    line-height: 1.8;
    color: #b0bec5;
    margin-bottom: 25px;
}

#panel-situs h4 {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 163, 115, 0.2);
}

#panel-situs-list {
    list-style: none;
    padding: 0;
}

#panel-situs-list li {
    padding: 10px 0 10px 25px;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s ease, border-left 0.2s ease;
}

#panel-situs-list li::before {
    content: "•";
    color: #d4a373;
    font-weight: bold;
    position: absolute;
    left: 8px;
    font-size: 18px;
    top: 6px;
}

.situs-link {
    cursor: pointer;
    color: #8db596;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.situs-link:hover {
    color: #ffffff;
    padding-left: 5px;
}

#panel-situs-list li.active {
    background: rgba(212, 163, 115, 0.10);
    border-left: 3px solid #d4a373;
    padding-left: 22px;
    border-radius: 4px;
}

#panel-situs-list li.active::before {
    color: #ffd29d;
}

#panel-situs-list li.active .situs-link {
    color: #000000c9;
    font-weight: 700;
}

/* --- Pastikan teks pada layer switcher berwarna hitam --- */
.layer-switcher,
.layer-switcher .panel,
.layer-switcher .panel ul,
.layer-switcher .panel li {
  color: #000000 !important;  
  padding: 3px;  
}

.executive-link {
    font-size: 22px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.executive-link:hover {
    color: #e8c28b;
    text-decoration: none;
}