/* Dark theme overrides — PELNIGO tablet kiosk */
body.theme-dark {
  --bg: #0c0c0c;
  --panel-bg: rgba(19, 19, 24, 0.92);
  --panel-bg-soft: rgba(23, 25, 35, 0.88);
  --panel-bg-soft2: #191b26;
  --icon-accent: #395aff;
  --icon-arrow: #6b83ff;
  --primary: #395aff;
  --primary-soft: rgba(57, 90, 255, 0.22);
  --accent: #6b83ff;
  --accent-soft: rgba(107, 131, 255, 0.25);
  --text-main: #dde1ec;
  --text-muted: #807d96;
  --border-soft: rgb(140 140 140 / 12%);
  --shadow-soft: 0 18px 35px rgba(0, 0, 0, 0.75);
  --card-blur: 12px;
}

body.theme-dark,
body.theme-dark html {
  background-color: #000;
  color: var(--text-main);
}

body.theme-dark::before {
  background-image: url("images/bg-pelnigo-dark.jpg");
  background-color: #0c0c0c;
  opacity: 1;
  transform: none;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

body.theme-dark .bg-parallax {
  background-image: none;
  background-color: #0c0c0c;
  opacity: 1;
  transform: none;
}

body.theme-dark:not(.has-bg-parallax)::before {
  background-image: url("images/bg-pelnigo-dark.jpg");
}

@media (prefers-reduced-motion: reduce) {
  body.theme-dark::before {
    background-image: url("images/bg-pelnigo-dark.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
  }

  body.theme-dark .bg-parallax-video {
    display: none;
  }
}

body.theme-dark .dash-wrapper {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--text-main);
  overflow: hidden;
}

html:not(.pwa-standalone) body.theme-dark .dash-wrapper {
  height: var(--app-height);
  max-height: var(--app-height);
}

body.theme-dark .top-bar {
  color: var(--text-muted);
}

body.theme-dark .icon-small {
  border-color: rgba(255, 255, 255, 0.18);
  color: #d3daea;
  background: rgba(10, 12, 20, 0.9);
}

body.theme-dark .icon-small.active {
  background: #395aff;
  border-color: #395aff;
  color: #ffffff;
}

body.theme-dark .live-location-card {
  border-color: var(--border-soft);
  -webkit-backdrop-filter: blur(var(--card-blur));
  backdrop-filter: blur(var(--card-blur));
  box-shadow: var(--shadow-soft);
  transform-origin: center center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .live-location-info {
  background: rgba(34, 32, 50, 0.88);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

body.theme-dark .live-location-info-top {
  background: rgb(65 65 65 / 92%);
}

body.theme-dark .live-location-info-bottom {
  background: rgb(56 56 56 / 92%);
}

body.theme-dark .live-location-chip,
body.theme-dark .live-location-ship-name {
  background: rgba(34, 32, 50, 0.92);
  color: #fff;
}

body.theme-dark .live-location-ship-icon {
  color: #395aff;
}

body.theme-dark .live-location-map-control {
  background: rgba(34, 32, 50, 0.92);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

body.theme-dark .live-location-temp,
body.theme-dark .live-location-route-item strong,
body.theme-dark .live-location-stat strong,
body.theme-dark .live-location-total strong {
  color: #fff;
}

body.theme-dark .live-location-weather,
body.theme-dark .live-location-weather-icon {
  color: #395aff;
}

body.theme-dark .live-location-route-item span,
body.theme-dark .live-location-stat .label,
body.theme-dark .live-location-total .label {
  color: #a8afc0;
}

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

body.theme-dark .live-location-route-line {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.28) 0,
    rgba(255, 255, 255, 0.28) 4px,
    transparent 4px,
    transparent 8px
  );
}

body.theme-dark .tile {
  border-color: var(--border-soft);
  -webkit-backdrop-filter: blur(var(--card-blur));
  backdrop-filter: blur(var(--card-blur));
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.4);
  background: rgba(17, 18, 24, 0.78);
  transform-origin: center center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .tile.subtle {
  background: rgb(24 24 24 / 30%);
}

body.theme-dark .tile-label {
  color: #b2b2b2;
}

body.theme-dark .tile-icon {
  color: var(--text-muted);
}

body.theme-dark .tile .tile-icon i.ri-arrow-right-line,
body.theme-dark .tile:hover .tile-icon i.ri-arrow-right-line,
body.theme-dark .title-subtitle .tile-icon i.ri-arrow-right-line {
  color: var(--icon-arrow) !important;
}

body.theme-dark .tile-svg-icon i,
body.theme-dark .resto-card .tile-svg-icon i,
body.theme-dark .resto-card-label .tile-svg-icon i {
  color: #818698;
}

body.theme-dark .tile:hover .tile-svg-icon i,
body.theme-dark .resto-card:hover .tile-svg-icon i,
body.theme-dark .resto-card:hover .resto-card-label .tile-svg-icon i {
  color: var(--icon-arrow);
}

body.theme-dark .tile:hover .tile-icon i:not(.ri-arrow-right-line) {
  color: var(--icon-accent);
}

body.theme-dark .main,
body.theme-dark .left-col,
body.theme-dark .mid-col,
body.theme-dark .right-col,
body.theme-dark .left-grid,
body.theme-dark .mid-stack,
body.theme-dark .right-grid {
  overflow: visible;
}

body.theme-dark .tile:hover,
body.theme-dark .live-location-card:hover,
body.theme-dark .resto-card:hover {
  /* /* transform: scale(1.05); */ */
  overflow: visible;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 28px rgba(57, 90, 255, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .announcement-card:hover {
  /* transform: scale(1.05); */
  overflow: hidden;
  position: relative;
  z-index: 2;
  border-radius: var(--radius-md);
  box-shadow: 0 0 28px rgba(57, 90, 255, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .live-location-card:hover {
  overflow: hidden;
}

body.theme-dark .left-col,
body.theme-dark .mid-col {
  grid-template-rows: minmax(0, 1.4fr) minmax(0, 1.6fr);
}

body.theme-dark .mid-col-spacer {
  min-height: 0;
}

body.theme-dark .mid-stack {
  justify-content: flex-end;
  gap: 12px;
  min-height: 0;
  height: 100%;
}

body.theme-dark .mid-stack > .tile {
  flex: 0 0 auto;
  align-self: start;
  width: calc((100% - 12px) / 2);
  height: calc((100% - 12px) / 2);
  min-height: 0;
  box-sizing: border-box;
}

body.theme-dark .mid-stack > .resto-card {
  flex: 0 0 auto;
  width: 100%;
  height: calc((100% - 12px) / 2);
  min-height: 0;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
  overflow: hidden;
}

body.theme-dark .left-grid {
  grid-template-rows: 1fr 1fr;
  min-height: 0;
}

body.theme-dark .left-grid .tile.tile-span-2 {
  height: 100%;
  min-height: 0;
}

body.theme-dark .resto-card {
  background: rgb(24 24 24 / 30%);
  -webkit-backdrop-filter: blur(var(--card-blur));
  backdrop-filter: blur(var(--card-blur));
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-soft);
  transform-origin: center center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .text-caption-muted {
  color: var(--text-muted);
}

body.theme-dark #restoSlider,
body.theme-dark .resto-slider {
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
}


body.theme-dark .right-col {
  display: grid;
  grid-template-rows: 1.4fr 1.6fr;
  gap: 15px;
  min-height: 0;
  background: none;
  background-image: none;
  border: none;
  padding: 0;
  overflow: visible;
  justify-content: stretch;
  box-shadow: none;
  transform: none;
  transition: none;
}

body.theme-dark .right-col:hover {
  transform: none;
  box-shadow: none;
  transition: none;
}

body.theme-dark .right-grid {
  gap: 12px;
  min-height: 0;
  overflow: visible;
  isolation: isolate;
}

body.theme-dark .right-grid > .tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  justify-self: stretch;
  z-index: 0;
  background: rgb(24 24 24 / 30%);
}

body.theme-dark .right-grid > .tile:hover {
  /* transform: scale(1.05); */
  z-index: 3;
  overflow: visible;
  box-shadow: 0 0 28px rgba(57, 90, 255, 0.42);
}

body.theme-dark .announcement-card {
  --overlay-bottom-start: 60%;
  position: relative;
  min-height: 0;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.4);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transform-origin: center center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .announcement-card .right-badge {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 1;
}

body.theme-dark .announcement-card .announcement-slider {
  min-height: unset;
}

body.theme-dark .announcement-card .tile-main,
body.theme-dark .announcement-card .caption-label {
  color: var(--text-main);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

body.theme-dark .announcement-card .caption-date {
  color: var(--primary);
  text-shadow: none;
}

body.theme-dark .announcement-card .title-pengumuman {
  display: block;
  color: #ffffff;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  line-height: 20px;
  cursor: pointer;
  transition: color 0.2s ease;
}

body.theme-dark .announcement-card .title-pengumuman:hover {
  color: #fca5a5;
}

body.theme-dark .bottom-left-text .bottom-left-brand {
  color: #ffffff;
}

body.theme-dark .bottom-right-text .brand {
  color: var(--text-main);
}

body.theme-dark .temp-pill {
  background: rgba(17, 18, 24, 0.9);
  border-color: var(--border-soft);
  color: var(--text-main);
}

body.theme-dark .port-tooltip-inner {
  background-color: #111218;
  border-color: var(--border-soft);
  color: var(--text-main);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

body.theme-dark .device-guard-overlay {
  background: rgba(5, 6, 10, 0.78);
}

body.theme-dark .device-guard-content {
  color: var(--text-main);
  border-color: var(--border-soft);
  background: #111218;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

body.theme-dark .device-guard-message {
  color: var(--text-muted);
}

@media screen and (max-width: 1180px) {
  body.theme-dark #restoSlider,
  body.theme-dark .resto-slider {
    min-height: 0;
  }

  body.theme-dark .right-col {
    gap: 12px;
  }

  body.theme-dark .announcement-card {
    padding: 10px 14px;
  }

  body.theme-dark .announcement-card .right-badge {
    top: 10px;
    left: 14px;
    right: 14px;
  }
}
