/* =========================================================
   css/layout.css - App Shell, Container & View Transitions
   ========================================================= */

.app-root-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  background-color: var(--page-bg);
  overflow: hidden;
}

.app-card-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  flex: 1 1 0%;
  background-color: var(--surface-bg);
  position: relative;
  overflow: hidden;
}

#app-view-outlet {
  flex: 1 1 0%;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background-color: var(--surface-bg);
}

/* View Transitions */
.view-container {
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-container.active {
  opacity: 1;
  transform: translateX(0);
}

/* Left to Right Slide Transition (Overlays & Secondary Screens) */
.view-slide-left-right {
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.28s cubic-bezier(0.32, 0.72, 0, 1), transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform, opacity;
  width: 100%;
  height: 100%;
}

.view-slide-left-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Expand/Collapse Transition */
.collapse-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease-out;
  opacity: 0;
}

.collapse-container.open {
  max-height: 1000px;
  opacity: 1;
}

/* Menu Backdrop Transition */
.menu-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Leaflet Custom Styles */
.first-point-minimized-marker-icon {
  background: transparent !important;
  border: none !important;
}

.first-point-minimized-popup .leaflet-popup-content-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 9999px !important;
}

.first-point-minimized-popup .leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  width: auto !important;
}

.first-point-minimized-popup .leaflet-popup-tip-container {
  display: none !important;
}

.first-point-info-popup .leaflet-popup-content,
.territory-poly-popup .leaflet-popup-content {
  margin: 8px 10px 8px 10px !important;
  width: auto !important;
}

.leaflet-bottom.leaflet-left {
  bottom: 16px !important;
  left: 14px !important;
}

@media (max-width: 767px) {
  .first-point-info-popup .leaflet-popup-content,
  .territory-poly-popup .leaflet-popup-content,
  .leaflet-popup-content {
    margin: 5px 7px 5px 7px !important;
    width: auto !important;
  }
}
