/* Custom styles for Pangan360 */

@layer utilities {
  .glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(229, 231, 235, 0.8);
  }

  .dark .glass-card {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(55, 65, 81, 0.6);
  }
}

/* Custom transitions */
.transition-all-200 {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Utilitas Tanpa Scrollbar untuk Scroll Horizontal Halus di Mobile */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* Responsivitas Kanvas Peta Leaflet untuk Mobile & Desktop */
#nationalWarehouseMapContainer {
  width: 100%;
  height: 360px;
  position: relative;
  z-index: 1;
  isolation: isolate;
}
@media (min-width: 640px) {
  #nationalWarehouseMapContainer {
    height: 480px;
  }
}
@media (min-width: 1024px) {
  #nationalWarehouseMapContainer {
    height: 560px;
  }
}

/* Peta Full Indonesia Overview di Dashboard (Tanpa Zoom) */
#dashboardIndonesiaMap {
  width: 100%;
  height: 380px;
  position: relative;
  z-index: 1;
  isolation: isolate;
  background-color: #f1f5f9;
}
.dark #dashboardIndonesiaMap {
  background-color: #0f172a;
}
@media (min-width: 640px) {
  #dashboardIndonesiaMap {
    height: 480px;
  }
}
@media (min-width: 1024px) {
  #dashboardIndonesiaMap {
    height: 520px;
  }
}

/* Leaflet GIS Map Styling */
#gisMapContainer {
  min-height: 340px;
  width: 100%;
  border-radius: 1rem;
  position: relative;
  z-index: 1;
  isolation: isolate;
}
@media (min-width: 640px) {
  #gisMapContainer {
    min-height: 420px;
  }
}

#droneMapContainer {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* Stacking Context Isolation: Pastikan Leaflet panes & controls terkurung di konteks lokal */
.leaflet-container {
  font-family: inherit !important;
  position: relative;
  z-index: 1 !important;
  isolation: isolate;
}

/* Modal Elevation: Seluruh modal selalu tampil di atas map layer */
[id$="Modal"],
[id$="FullscreenModal"] {
  z-index: 99999 !important;
}

#toast {
  z-index: 100005 !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px !important;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.15) !important;
  padding: 4px;
}

.leaflet-popup-tip {
  box-shadow: 0 6px 12px rgba(0,0,0,0.1) !important;
}

.custom-leaflet-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease-in-out;
}

.custom-leaflet-marker:hover {
  transform: scale(1.15);
}

/* Drone Aerial Inspection Map Styling */
#droneMapContainer {
  min-height: 340px;
  width: 100%;
  border-radius: 1.25rem;
  z-index: 10;
}
@media (min-width: 640px) {
  #droneMapContainer {
    min-height: 520px;
  }
}

/* Optimasi Tombol Kontrol Peta untuk Layar Sentuh Mobile */
.leaflet-touch .leaflet-bar a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
}

.leaflet-touch .leaflet-control-layers-toggle {
  width: 36px !important;
  height: 36px !important;
}

.custom-defect-pin,
.custom-drone-facility-marker,
.custom-wp-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Laser Scanner Animation */
@keyframes laserSweep {
  0% {
    top: 0%;
    opacity: 0.8;
  }
  50% {
    top: 95%;
    opacity: 1;
  }
  100% {
    top: 0%;
    opacity: 0.8;
  }
}

.laser-active {
  animation: laserSweep 1.8s ease-in-out infinite;
}

/* Image Comparison Slider Styling */
.comparison-slider-container {
  position: relative;
  overflow: hidden;
  user-select: none;
}

.comparison-slider-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 30;
}

/* =========================================================
   Pangan360 Login Page - Transparent Background & Card (CSS)
   ========================================================= */

/* Background Image Transparan 25% via CSS murni */
.login-bg-transparent {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background-image: url('../assets/851ba44f-3e42-4970-a638-4929bc1c1519.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.25;
  pointer-events: none;
}

.dark .login-bg-transparent {
  opacity: 0.20;
}

/* =========================================================
   Pangan360 QR Camera Scanner & Laser Viewfinder Styling
   ========================================================= */

#qrScannerViewport {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
  border-radius: 1rem;
}

#qrScannerViewport video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 1rem;
}

#qrScannerViewport img[alt="Info icon"],
#qrScannerViewport div[id*="header-message"] {
  display: none !important;
}

.scanner-laser-line {
  position: absolute;
  left: 5%;
  width: 90%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, #34d399, #10b981, transparent);
  box-shadow: 0 0 12px #10b981, 0 0 4px #34d399;
  animation: laserScanDownUp 2.2s ease-in-out infinite;
}

@keyframes laserScanDownUp {
  0% {
    top: 5%;
    opacity: 0.3;
  }
  50% {
    top: 92%;
    opacity: 1;
  }
  100% {
    top: 5%;
    opacity: 0.3;
  }
}

/* Memastikan modal kamera langsung tertutup tanpa hambatan CSS */
#qrScannerModal.hidden,
#qrScannerModal[style*="display: none"],
#qrScannerModal[style*="display:none"] {
  display: none !important;
}

