/* Live Tracking — peta fullscreen sebagai background */

body.page-live-tracking {
  --lt-layout-gap: 14px;
}

/* Peta fullscreen di belakang seluruh halaman */
body.page-live-tracking .lt-map-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #1b1b1b;
}

body.page-live-tracking .lt-map-background #tabletLiveMap {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #1b1b1b;
}

body.page-live-tracking .lt-map-background .leaflet-container {
  width: 100%;
  height: 100%;
  background: #1b1b1b;
  font-family: inherit;
}

body.page-live-tracking .lt-map-background .leaflet-container img.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
}

/* Vignette halus agar UI tetap terbaca di atas peta */
body.page-live-tracking .lt-map-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(244, 245, 247, 0.42) 0%, transparent 18%, transparent 72%, rgba(244, 245, 247, 0.28) 100%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 35%, rgba(15, 23, 42, 0.12) 100%);
}

body.page-live-tracking.theme-dark .lt-map-background::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 18%, transparent 72%, rgba(0, 0, 0, 0.38) 100%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 35%, rgba(0, 0, 0, 0.28) 100%);
}

body.page-live-tracking .dash-wrapper {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  min-height: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}

body.page-live-tracking .lt-top-bar {
  pointer-events: auto;
}

html.pwa-standalone body.page-live-tracking .dash-wrapper {
  padding-bottom: 0;
}

.lt-top-bar {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto;
  gap: var(--lt-layout-gap);
  align-items: center;
}

.lt-top-bar .top-left {
  min-width: 0;
}

.lt-top-bar .top-right {
  justify-self: end;
}

.lt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lt-back {
  width: 32px;
  height: 32px;
  border-radius: 32px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lt-back:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.lt-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.lt-page {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 0 max(16px, env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.lt-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 20px 0;
  padding-top: 5px;
}

body.page-live-tracking .live-location-map-controls {
  left: 0;
  bottom: 20px;
}

body.page-live-tracking .live-location-map-control {
  width: 35px;
  height: 35px;
  font-size: 16px;
}

/* Tile surface — Live Tracking chip, info kapal, zoom & focus */
body.page-live-tracking .live-location-chip,
body.page-live-tracking .live-location-ship-name,
body.page-live-tracking .live-location-map-control {
  border: 1px solid var(--border-soft);
  -webkit-backdrop-filter: blur(var(--card-blur));
  backdrop-filter: blur(var(--card-blur));
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

body.page-live-tracking.theme-light .live-location-chip,
body.page-live-tracking.theme-light .live-location-ship-name,
body.page-live-tracking.theme-light .live-location-map-control {
  color: var(--text-main);
}

body.page-live-tracking.theme-dark .live-location-chip,
body.page-live-tracking.theme-dark .live-location-ship-name,
body.page-live-tracking.theme-dark .live-location-map-control {
  background: rgba(17, 18, 24, 0.78);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.4);
  color: #fff;
}

body.page-live-tracking.theme-dark .live-location-ship-icon {
  color: #93b4ff;
}

/* Map style picker — selaras mobile/live-tracking.html */
body.page-live-tracking .lt-map-style-controls {
  position: absolute;
  right: 0px;
  bottom: 20px;
  z-index: 5;
  pointer-events: auto;
}

body.page-live-tracking .lt-map-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.page-live-tracking .lt-map-submenu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

body.page-live-tracking .lt-map-submenu.is-open {
  pointer-events: auto;
}

body.page-live-tracking .lt-map-type-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 50%;
  padding: 0;
  box-sizing: border-box;
  overflow: visible;
  background: #fff;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.2),
    0 8px 22px rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.28s ease, visibility 0.28s ease;
}

body.page-live-tracking .lt-map-type-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  z-index: -1;
  pointer-events: none;
}

body.page-live-tracking .lt-map-type-btn.is-toggle.is-open {
  transform: scale(0.96);
}

body.page-live-tracking .lt-map-submenu-item {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.85);
  pointer-events: none;
}

body.page-live-tracking .lt-map-submenu-item.is-current {
  display: none;
}

body.page-live-tracking .lt-map-submenu.is-open .lt-map-submenu-item:not(.is-current) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

body.page-live-tracking .lt-map-submenu.is-open .lt-map-submenu-item:not(.is-current):nth-child(1) {
  transition-delay: 0.06s;
}

body.page-live-tracking .lt-map-submenu.is-open .lt-map-submenu-item:not(.is-current):nth-child(2) {
  transition-delay: 0.14s;
}

body.page-live-tracking .lt-map-submenu.is-open .lt-map-submenu-item:not(.is-current):nth-child(3) {
  transition-delay: 0.22s;
}

body.page-live-tracking .lt-map-submenu:not(.is-open) .lt-map-submenu-item {
  transition-delay: 0s;
}

body.page-live-tracking .lt-map-type-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  border-radius: 50%;
}

body.page-live-tracking .lt-map-type-btn:active {
  transform: scale(0.96);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.16),
    0 4px 12px rgba(0, 0, 0, 0.18);
}

body.page-live-tracking.theme-dark .lt-map-type-btn {
  border-color: rgba(255, 255, 255, 0.85);
  background: #2a2a2a;
}

body.page-live-tracking .live-location-chip {
  font-size: calc(11px * 1.2);
  padding: calc(5px * 1.2) calc(10px * 1.2);
  gap: calc(6px * 1.2);
}

body.page-live-tracking .live-location-chip-dot {
  width: calc(7px * 1.2);
  height: calc(7px * 1.2);
  box-shadow: 0 0 0 calc(3px * 1.2) rgba(34, 197, 94, 0.25);
}

body.page-live-tracking .live-location-ship-name {
  font-size: calc(11px * 1.2);
  padding: calc(5px * 1.2) calc(10px * 1.2);
  gap: calc(5px * 1.2);
  pointer-events: auto;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.page-live-tracking .live-location-ship-name:hover {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

body.page-live-tracking.theme-dark .live-location-ship-name:hover {
  background: rgba(17, 18, 24, 0.88);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.48);
}

body.page-live-tracking .live-location-ship-name.is-active {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(57, 90, 255, 0.35);
  box-shadow: 0 8px 20px rgba(57, 90, 255, 0.15);
  color: var(--primary);
}

body.page-live-tracking.theme-dark .live-location-ship-name.is-active {
  background: rgba(17, 18, 24, 0.88);
  border-color: rgba(147, 180, 255, 0.35);
  box-shadow: 0 12px 22px rgba(57, 90, 255, 0.2);
  color: #93b4ff;
}

body.page-live-tracking .live-location-ship-name.is-active .live-location-ship-icon {
  color: var(--primary);
}

body.page-live-tracking .lt-ship-anchor {
  position: relative;
  pointer-events: auto;
  flex-shrink: 0;
}

body.page-live-tracking .lt-ship-info-wrap {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  width: min(420px, calc(100vw - 48px));
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

body.page-live-tracking .lt-ship-info-wrap.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body.page-live-tracking .lt-ship-info-wrap.is-hidden:not(.is-open) {
  display: block;
}

body.page-live-tracking .lt-ship-info-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: calc(12px * 1.2);
  padding: calc(14px * 1.2) calc(16px * 1.2) calc(10px * 1.2);
}

body.page-live-tracking .lt-ship-info-title {
  display: flex;
  align-items: center;
  gap: calc(10px * 1.2);
  min-width: 0;
}

body.page-live-tracking .lt-ship-info-avatar {
  flex-shrink: 0;
  width: calc(44px * 1.2);
  height: calc(44px * 1.2);
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  object-position: center;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

body.page-live-tracking .lt-ship-info-title-copy {
  min-width: 0;
}

body.page-live-tracking .lt-ship-info-title-copy strong {
  display: block;
  font-size: calc(15px * 1.2);
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

body.page-live-tracking .lt-ship-info-title-copy span {
  display: block;
  margin-top: calc(2px * 1.2);
  font-size: calc(10px * 1.2);
  font-weight: 500;
  color: #5f6775;
  line-height: 1.3;
}

body.page-live-tracking .lt-ship-status {
  display: inline-flex;
  align-items: center;
  gap: calc(6px * 1.2);
  flex-shrink: 0;
  padding: calc(5px * 1.2) calc(10px * 1.2);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  font-size: calc(10px * 1.2);
  font-weight: 600;
  line-height: 1;
}

body.page-live-tracking .lt-ship-status-dot {
  width: calc(7px * 1.2);
  height: calc(7px * 1.2);
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 calc(3px * 1.2) rgba(34, 197, 94, 0.25);
}

body.page-live-tracking .lt-ship-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(12px * 1.2) calc(16px * 1.2);
  padding: calc(12px * 1.2) calc(16px * 1.2) calc(16px * 1.2);
}

body.page-live-tracking.theme-dark .lt-ship-info-title-copy strong,
body.page-live-tracking.theme-dark .lt-ship-info-grid .live-location-stat strong {
  color: #f4f4f5;
}

body.page-live-tracking.theme-dark .lt-ship-info-title-copy span,
body.page-live-tracking.theme-dark .lt-ship-info-grid .live-location-stat .label {
  color: #a1a1aa;
}

body.page-live-tracking.theme-dark .lt-ship-status {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

body.page-live-tracking .live-location-ship-icon {
  font-size: calc(13px * 1.2);
}

@media screen and (min-width: 1920px) and (min-height: 1080px) {
  body.page-live-tracking .live-location-chip,
  body.page-live-tracking .live-location-ship-name {
    font-size: calc(14px * 1.2);
  }

  body.page-live-tracking .live-location-ship-icon {
    font-size: calc(16px * 1.2);
  }

  body.page-live-tracking .live-location-temp {
    font-size: calc(26px * 1.2);
  }

  body.page-live-tracking .live-location-weather-icon {
    font-size: calc(28px * 1.2);
  }

  body.page-live-tracking .live-location-weather,
  body.page-live-tracking .live-location-route-item span {
    font-size: calc(16px * 1.2);
  }

  body.page-live-tracking .live-location-route-item strong,
  body.page-live-tracking .live-location-stat .label {
    font-size: calc(14px * 1.2);
  }

  body.page-live-tracking .live-location-stat strong {
    font-size: calc(18px * 1.2);
  }

  body.page-live-tracking .live-location-total .label {
    font-size: calc(11px * 1.2);
  }

  body.page-live-tracking .live-location-total strong {
    font-size: calc(13px * 1.2);
  }
}

body.page-live-tracking .live-location-info-wrap {
  width: min(100%, calc(520px * 1.2));
}

/* Tile surface — panel info tracking & detail kapal */
body.page-live-tracking .live-location-info {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  -webkit-backdrop-filter: blur(var(--card-blur));
  backdrop-filter: blur(var(--card-blur));
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

body.page-live-tracking.theme-dark .live-location-info {
  background: rgba(17, 18, 24, 0.78);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.4);
}

body.page-live-tracking .live-location-info-top,
body.page-live-tracking .live-location-info-bottom {
  background: transparent;
}

body.page-live-tracking .live-location-info-toggle {
  top: calc(-30px * 1.2);
  width: calc(25px * 1.2);
  height: calc(25px * 1.2);
  font-size: calc(14px * 1.2);
}

body.page-live-tracking .live-location-info-top {
  gap: calc(12px * 1.2);
  padding: 20px 30px;
}

body.page-live-tracking .live-location-info-head {
  gap: calc(8px * 1.2);
}

body.page-live-tracking .live-location-temp {
  font-size: calc(18px * 1.2);
}

body.page-live-tracking .live-location-weather {
  margin-top: calc(2px * 1.2);
  font-size: calc(11px * 1.2);
}

body.page-live-tracking .live-location-weather-icon {
  font-size: calc(22px * 1.2);
}

body.page-live-tracking .live-location-total {
  margin-top: calc(10px * 1.2);
}

body.page-live-tracking .live-location-total .label {
  font-size: calc(10px * 1.2);
  margin-bottom: calc(5px * 1.2);
}

body.page-live-tracking .live-location-total strong {
  font-size: calc(12px * 1.2);
}

body.page-live-tracking .live-location-route {
  grid-template-columns: calc(14px * 1.2) minmax(0, 1fr);
  gap: calc(8px * 1.2);
}

body.page-live-tracking .live-location-route-axis {
  padding: calc(2px * 1.2) 0;
}

body.page-live-tracking .live-location-dot {
  width: calc(8px * 1.2);
  height: calc(8px * 1.2);
}

body.page-live-tracking .live-location-route-line {
  width: calc(2px * 1.2);
  margin: calc(4px * 1.2) 0;
}

body.page-live-tracking .live-location-route-content {
  gap: calc(8px * 1.2);
}

body.page-live-tracking .live-location-route-item strong {
  font-size: calc(11px * 1.2);
  margin-bottom: calc(1px * 1.2);
}

body.page-live-tracking .live-location-route-item span {
  font-size: calc(11px * 1.2);
}

body.page-live-tracking .live-location-info .live-location-info-divider {
  background: rgba(15, 23, 42, 0.1);
}

body.page-live-tracking.theme-dark .live-location-info .live-location-info-divider {
  background: rgba(255, 255, 255, 0.22);
}

body.page-live-tracking .live-location-info-divider {
  margin: 0 calc(14px * 1.2);
}

body.page-live-tracking .live-location-info-bottom {
  gap: calc(10px * 1.2);
  padding: 20px 30px;
}

body.page-live-tracking .live-location-transport {
  width: calc(32px * 1.2);
  height: calc(32px * 1.2);
  font-size: calc(22px * 1.2);
}

body.page-live-tracking .live-location-stat .label {
  font-size: calc(10px * 1.2);
  margin-bottom: calc(2px * 1.2);
}

body.page-live-tracking .live-location-stat strong {
  font-size: calc(12px * 1.2);
}

body.page-live-tracking.theme-light .lt-back {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

body.page-live-tracking.theme-light .lt-back:hover {
  background: rgba(255, 255, 255, 0.34);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--primary);
}

body.page-live-tracking.theme-light .lt-top-bar .icon-small:not(.active) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

body.page-live-tracking.theme-dark .lt-top-bar .icon-small:not(.active) {
  background: rgba(30, 30, 30, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.page-live-tracking.theme-dark .lt-back {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(30, 30, 30, 0.55);
  color: #f4f4f5;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.page-live-tracking.theme-dark .lt-back:hover {
  background: rgba(58, 90, 255, 0.18);
  border-color: var(--primary);
  color: #93b4ff;
}

a.live-location-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
