#map {
    height: 100vh;
}

.custom-tooltip {
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
}

.tooltip-content h6 {
    margin: 0;
    padding: 0;
    font-size: 10px;
}

.map-info-ais {
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid white;
    border-radius: 5px;
    padding: 10px 20px 10px 0px;
    font-size: 12px;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
}

.title-info-ais h4 {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: bold;
}

.title-info-ais h5 {
    margin: 0;
    padding-top: 5px;
    padding-left: 20px;
    font-size: 12px;
}

.map-info-ais hr {
    margin: 6px 0;
    border-color: rgba(255, 255, 255, 0.3);
}

.container-table-ais {
    margin-top: 0;
    width: 100%;
}

#searchBox {
    display: flex;
    width: 100%;
    margin-bottom: 10px;
}

#searchInput {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    outline: none;
}

#resetSearch {
    padding: 6px 12px;
    font-size: 12px;
    background-color: rgba(0, 170, 255, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

#mmsiList {
    max-height: 100%;
    overflow-y: auto;
    font-size: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

#mmsiList li {
    box-sizing: border-box;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    font-family: monospace;
    line-height: 1.4;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#mmsiList li:hover {
    background-color: rgba(0, 255, 255, 0.1);
    color: #00ffff;
}

#mmsiList li small {
    color: #ccc;
    font-size: 11px;
}

.mmsi-stop {
    background-color: rgba(255, 255, 255, 0.05);
}

.mmsi-slow {
    background-color: rgba(0, 255, 0, 0.08);
}

.mmsi-fast {
    background-color: rgba(255, 165, 0, 0.1);
}

.rotating-ship {
    width: 24px;
    height: 24px;
    transition: transform 0.4s ease;
}

.no-default-style {
    background: none !important;
    border: none !important;
}

.trail-icon {
    opacity: 0.7;
}

.anomaly-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 8px;
}

.blinking-fade {
    animation: fadeblink 1.6s ease-in-out infinite;
}

@keyframes fadeblink {
    0%   { opacity: 0.1; }
    50%  { opacity: 0.9; }
    100% { opacity: 0.1; }
}

.blinking-prediction {
    animation: blinkPrediction 2s ease-in-out infinite;
}

@keyframes blinkPrediction {
    0%   { opacity: 0.1; }
    50%  { opacity: 0.9; }
    100% { opacity: 0.1; }
}


.leaflet-pm-tooltip {
    font-size: 24px !important;
    font-weight: bold;
    color: #fff !important;
    background: rgba(0, 0, 0, 0.7) !important;
    padding: 6px 6px !important;
    border-radius: 6px;
    border: 1px solid white;
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
    white-space: nowrap;
  }
  
  .leaflet-pm-tooltip:before {
    display: none; /* hapus segitiga */
  }

.tooltip-jarak-custom-ais {
    font-size: 10px;
    font-weight: bold;
    color: white;
    background-color: rgba(0, 0, 0, 0.30);
    border-radius: 6px;
    padding: 6px 10px;
    border: 1px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    z-index: 9999;
}

.tooltip-jarak-custom-ais:before {
    display: none;
}

.tooltip-jarak-realtime {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* Pindahkan leaflet-control-velocity ke tengah bawah */
.leaflet-bottom.leaflet-left .leaflet-control-velocity {
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 12px !important;
  }
  
  /* Styling tambahan */
  .leaflet-control-velocity {
    background: rgba(0, 0, 0, 0.6);
    color: white !important;
    font-size: 12px !important;
    font-weight: bold;
    padding: 8px 14px;
    border-radius: 6px;
    z-index: 9999;
  }
  
  /* Pastikan bagian dalamnya juga putih */
  .leaflet-control-velocity .leaflet-control-velocity-speed,
  .leaflet-control-velocity .leaflet-control-velocity-dir {
    color: white !important;
  }


/* Blinking AIS ketika zoom lebih kecil dari 8 */
/* Ikon AIS berkedip dari tengah (pulse) */
.ais-blinking-icon {
    background: none !important;
    border: none !important;
    pointer-events: none;
}

.ais-blinking-svg {
    width: 20px;
    height: 20px;
    overflow: visible;
}

.ais-blinking-circle {
    fill: none;
    stroke: #FFD700;
    stroke-width: 2;
    opacity: 0.5;
    animation: ripple-gold 3s ease-out infinite;
    animation-delay: var(--blink-delay, 0s);
    transform-origin: center;
}
@keyframes ripple-gold {
    0% {
        r: 0;
        opacity: 0.9;
        stroke-width: 2;
    }
    50% {
        opacity: 0.3;
        stroke-width: 4;
    }
    100% {
        r: 12;
        opacity: 0;
        stroke-width: 0;
    }
}

/* Blinking anomali ketika zoom lebih kecil dari 8 */
.anomali-blinking-icon {
    background: none !important;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.anomali-blinking-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.anomali-blinking-circle {
    fill: none;
    stroke: #fc3605;
    stroke-width: 0;
    opacity: 1;
    transform-origin: center;
    animation: ripple-anomali 4s ease-out infinite;
    filter: url(#blur-glow);
}

.anomali-blinking-circle.delay1 {
    animation-delay: 0.2s;
}

.anomali-blinking-circle.delay2 {
    animation-delay: 0.4s;
}

@keyframes ripple-anomali {
    0% {
        r: 2;
        opacity: 0.9;
        stroke-width: 0.2;
    }
    90% {
        r: 10;
        opacity: 0;
        stroke-width: 0;
    }
    100% {
        r: 0;
        opacity: 0;
        stroke-width: 0;
    }
}

/* Togle selector aktivasi proses sinkronisasi dengan API Internal */
/* Grid 2x2 */
#featureToggles.toggles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
    margin-bottom: 12px;
}

/* Label luar switch */
.switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: white;
}

/* Hide checkbox */
.switch input {
    display: none;
}

/* Slider toggle */
.switch .slider {
    position: relative;
    width: 34px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 34px;
    transition: background-color 0.3s;
    cursor: pointer;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

/* Aktifkan toggle */
.switch input:checked + .slider {
    background-color: #00aaff;
}

.switch input:checked + .slider::before {
    transform: translateX(16px);
}

/* Label teks */
.switch .label {
    font-weight: bold;
    font-size: 11px;
    user-select: none;
}
