/* ═══════════════════════════════════════════════════════════════════
   LAYOUT — Fullscreen map with sidebar overlaid on top
   ═══════════════════════════════════════════════════════════════════ */

.app-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRESS BAR — Thin gold line at top during intro
   ═══════════════════════════════════════════════════════════════════ */
.intro-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #d4af37 0%, #f9e339 50%, #d4af37 100%);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.8);
  z-index: 10000;
  transition: width 0.1s linear;
  width: 0%;
}

/* ═══════════════════════════════════════════════════════════════════
   LOADING OVERLAY — Centered content with spinner during intro
   ═══════════════════════════════════════════════════════════════════ */
.intro-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, rgba(5, 18, 84, 0.96) 0%, rgba(8, 4, 76, 0.94) 50%, rgba(10, 32, 120, 0.9) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.overlay-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.overlay-title-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overlay-main-title {
  font-size: 4rem;
  font-weight: 700;
  color: #d4af37;
  margin: 0;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.overlay-subtitle {
  font-size: 1.3rem;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.5px;
  line-height: 1.6;
  max-width: 600px;
}

/* Loading Spinner */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(212, 175, 55, 0.2);
  border-top: 4px solid #d4af37;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  .app-layout.transparent-bg {
    background-color: transparent;
  }

  .app-layout.transparent-bg .content-wrapper {
    background-color: transparent;
  }

  .app-layout.transparent-bg .main {
    background-color: transparent;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   PERMANENT TITLE — Top-left position overlaid on map after intro completes
   ═══════════════════════════════════════════════════════════════════ */
.permanent-title-overlay {
  position: absolute;
  top: 22px;
  left: 98px;
  z-index: 1000;
  animation: fadeIn 0.5s ease-out;
  max-width: 280px;
  background: none;
  padding: 0;
  border-radius: 0;
  backdrop-filter: none;
}

.permanent-title-text {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #d4af37;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  line-height: 1.3;
}

.permanent-title-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: rgba(245, 251, 255, 0.8);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  line-height: 1.2;
}

.layout {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.main {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #08044C;
  --panel-overlay-gap: 16px;
--panel-overlay-width: 75vw;
  --panel-overlay-effective-width: min(
    var(--panel-overlay-width),
    calc(100vw - (var(--panel-overlay-gap) * 2))
  );
  /* Desktop push amount when a left sidebar is visible. */
  --map-shift-inline: clamp(260px, calc(var(--panel-overlay-effective-width) * 0.9), 560px);
  /* Target widths when sidebar is opened together with the map so both occupy 50% */
  --sidebar-width: min(640px, calc(100vw - 32px));
  --map-width: 100vw;
  --combined-width: calc(var(--sidebar-width) + var(--map-width));
}

/* When the right brief is hidden show Cesium container full width */

.cesium-container {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  transition: left 0.34s ease;
  touch-action: pan-y;
  /* Use a solid dark-blue backdrop instead of the previous sunset image */
  background-image: none !important;
  background-color: #08044C !important;
}

/* Force very light blue background on Cesium root elements and canvas to override star-sky */
/* Force the exact color on root Cesium elements and canvas to override any skybox or starfield */
/* Let Cesium's viewer render its own background (skybox/starfield). Do not force light-blue. */
#cesiumContainer,
#cesiumContainer .cesium-viewer,
#cesiumContainer .cesium-viewer-cesiumWidgetContainer,
#cesiumContainer canvas {
  background-image: none !important;
  background-color: #08044C !important;
}

:host ::ng-deep #cesiumContainer .cesium-viewer,
:host ::ng-deep #cesiumContainer .cesium-viewer-cesiumWidgetContainer,
:host ::ng-deep #cesiumContainer canvas {
  background-image: none !important;
  background-color: #08044C !important;
}

#cesiumContainer {
  transition: filter 0.4s ease;
  background-color: #08044C !important;
  opacity: 1 !important;
}

/* Keep map fully visible with sidebar by shifting per language direction.
   Arabic UI: move map left. English/French UI: move map right. */
.main.sidebar-open-left .cesium-container,
.main.sidebar-open-right .cesium-container {
  width: 100%;
}

.main.lang-ar.sidebar-open-left .cesium-container,
.main.lang-ar.sidebar-open-right .cesium-container {
  left: calc(-1 * var(--map-shift-inline));
}

.main.lang-ltr.sidebar-open-left .cesium-container,
.main.lang-ltr.sidebar-open-right .cesium-container {
  left: var(--map-shift-inline);
}



#cesiumContainer.district-selected {
  filter: brightness(0.9) saturate(1.18) contrast(1.02);
}

.district-hover-popup {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  max-width: min(280px, calc(100vw - 24px));
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
  text-align: start;
  letter-spacing: 0.2px;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

/* Selection frame that sits above the map and points to the currently selected pin */
.selection-frame {
  position: absolute;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 200;
  border-radius: 8px;
  display: none;
  box-shadow: 0 0 12px 3px rgba(11,138,43,0.22), inset 0 0 6px rgba(11,138,43,0.35);
  border: 2px solid rgba(11,138,43,0.6);
}
.selection-frame.visible { display: block; }
.selection-frame::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 3px 8px rgba(0,0,0,0.45);
  border-radius: 2px;
}

/* Split hint popup shown over the Cesium map to guide users to Map Settings */
.split-hint-popup {
  position: absolute;
  z-index: 10005;
  right: 20px;
  top: 86px;
  background: rgba(3,37,65,0.96);
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  max-width: 340px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.split-hint-popup .hint-text { flex: 1; }
.split-hint-popup .hint-actions { display:flex; gap:8px; }
.split-hint-popup .btn-ghost { background:transparent; border:1px solid rgba(255,255,255,0.12); color:#fff; padding:6px 10px; border-radius:8px; cursor:pointer; }
.split-hint-popup .btn-ghost:hover { background:rgba(255,255,255,0.04); }

/* Hide Cesium InfoBox camera button (focus camera on object) */
:host ::ng-deep .cesium-viewer-infoBoxContainer,
:host ::ng-deep .cesium-infoBox,
:host ::ng-deep .cesium-infoBox-visible {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide Cesium InfoBox camera button (focus camera on object) */
:host ::ng-deep .cesium-infoBox .cesium-infoBox-camera,
:host ::ng-deep .cesium-infoBox-camera {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   OVERLAY SIDEBAR — floats over the map (right side)
   ═══════════════════════════════════════════════════════════════════ */
.info-panel {
  position: absolute;
  /* Floating sidebar with gaps at top and bottom */
  top: 40px;
  /* Anchor the panel to the right edge of the left-half map (inside the map) */

  right: auto;
  bottom: 40px;
  width: var(--sidebar-width);
  max-width: min(var(--sidebar-width), 100vw);

  display: flex;
  flex-direction: column;

  /* Panel background uses CSS variable so user settings can override it */
  background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);

  /* Hidden by default — slides in from right */
  opacity: 0;
  transform: translateX(25px);
  pointer-events: none;
  transition: all 0.4s ease;
  z-index: 100;
}

/* Ensure sidebar text inherits the user-selected color/font from inline styles
   Use strong specificity so local component rules do not override the chosen values. */
.info-panel {
  color: var(--sidebar-dynamic-text-color, inherit) !important;
  font-family: inherit !important;
}
.info-panel, .info-panel * {
  color: inherit !important;
  font-family: inherit !important;
  font-size: var(--sidebar-font-size, inherit) !important;
}

/* Keep key navigation labels permanently white even when sidebar theme changes. */
.info-panel .filter-tab,
.info-panel .filter-tab.active,
.info-panel .filter-tab:hover:not(.active),
.info-panel .explore-label,
.info-panel .explore-current,
.info-panel .explore-counter,
.info-panel .hierarchy-level,
.info-panel .hierarchy-explore-label,
.info-panel .hierarchy-explore-current,
.info-panel .hierarchy-explore-counter {
  color: #ffffff !important;
}

/* Make the small close-tab button match the main circular close design (.btn-close) */
.info-panel .btn-close-tab {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%) !important;
  border: 1px solid #e1b740 !important;
  color: #ffffff !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  z-index: 30;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.info-panel .btn-close-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(227, 182, 74, 0.35);
}

/* Small expand/reduce tab button matched to .btn-close-tab */
.info-panel .btn-expand-tab {
  margin-left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%) !important;
  border: 1px solid #e1b740 !important;
  color: #ffffff !important;
  cursor: pointer;
  display: none; /* shown on small screens */
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  z-index: 30;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.info-panel .btn-expand-tab:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(227, 182, 74, 0.35); }

@media (max-width: 720px) {
  .info-panel .btn-expand-tab { display: inline-flex; }
}

.info-panel.active {
  will-change: transform, opacity, left, right, top, bottom, width, height;
}

.info-panel.position-inside-right {
  left: calc(var(--map-pane-width) - var(--panel-overlay-effective-width) - var(--panel-overlay-gap));
  right: auto;
}

.info-panel.position-inside-left {
  left: var(--panel-overlay-gap);
  right: auto;
}

.info-panel.position-right {
  left: auto;
  right: var(--panel-overlay-gap);
}

.info-panel.position-left {
  left: var(--panel-overlay-gap);
  right: auto;
}

.info-panel.position-top {
  left: 0;
  right: auto;
  top: 0;
  bottom: auto;

  max-width: var(--map-pane-width);
  height: 40vh;
}

.info-panel.position-bottom {
  left: 0;
  right: auto;
  top: auto;
  bottom: 0;

  max-width: var(--map-pane-width);
  height: 42vh;
  border-radius: 18px 18px 0 0;
}

/* Mobile expand/reduce button: hidden by default, visible on small screens */
.mobile-expand-btn {
  display: none; /* enabled via media query for responsive */
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 200;
  background: rgba(255,255,255,0.92);
  color: #0b1220;
  border: 2px solid #00d08f;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

/* When active, make the sidebar occupy the full map section on mobile */
.info-panel.mobile-expanded {
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border-radius: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: all !important;
  z-index: 9999;
}

@media (max-width: 720px) {
  .mobile-expand-btn { display: inline-flex; align-items: center; justify-content: center; }
}

/* Show header expand (agrandir) button only in responsive mode and keep it next to the close button */
@media (max-width: 720px) {
  .hierarchy-header .btn-expand {
    display: inline-flex;
  }
  /* ensure header layout keeps buttons aligned */
  .hierarchy-header { align-items: center; gap: 8px; }
}

/* Explicit direction classes (requested): avoid inherited inset conflicts. */
.info-panel.sidebar-left,
.info-panel.position-left {
  position: absolute;
  left: 16px;
  right: auto;
  top: 40px;
  bottom: 40px;
  width: var(--sidebar-width);
  max-width: min(var(--sidebar-width), 100vw);
  height: auto;
  border-radius: 16px;
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
}

.info-panel.sidebar-right,
.info-panel.position-right {
  position: absolute;
  left: auto;
  right: 16px;
  top: 40px;
  bottom: 40px;
  width: var(--sidebar-width);
  max-width: min(var(--sidebar-width), 100vw);
  height: auto;
  border-radius: 16px;
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
}

.info-panel.sidebar-top,
.info-panel.position-top {
  position: absolute;
  top: 40px;
  left: 16px;
  right: 16px;
  bottom: auto;
  width: calc(100% - 32px);
  max-width: calc(100% - 32px);
  height: 250px;
  border-radius: 16px;
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
}

.info-panel.sidebar-bottom,
.info-panel.position-bottom {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 16px;
  top: auto;
  width: calc(100% - 32px);
  max-width: calc(100% - 32px);
  height: 250px;
  border-radius: 16px;
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
}

.info-panel.anim-fade {
  transform: none;
  transition: opacity 0.28s ease;
}

.info-panel.anim-fade.panel-visible {
  transform: none;
}

.info-panel.anim-expand {
  transform-origin: top right;
  transform: scale(0.96);
}

.info-panel.anim-expand.panel-visible {
  transform: scale(1);
}

.info-panel.panel-visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

/* ── Scrollable body ── */
.panel-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
  direction: ltr;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.panel-scroll-content {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}



.panel-scroll-body::-webkit-scrollbar {
  width: 4px;
}

.panel-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

@media (max-width: 720px) {
  .panel-scroll-body {
    overflow-y: scroll;
    padding-inline-end: 2px;
  }

  .panel-scroll-body::-webkit-scrollbar {
    width: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   FILTER TABS (matching reference image tab bar)
   ═══════════════════════════════════════════════════════════════════ */

.filter-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 4px;
  gap: 2px;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 12, 0.95);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.filter-tab {
  flex: 1;
  padding: 14px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.filter-tab.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.filter-tab:hover:not(.active) {
  color: #ffffff;
}

.sidebar-search { padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); background: rgba(0,0,0,0.02); }
.sidebar-search-input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.08); background: #ffffff; color: #ffffff !important; caret-color: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.sidebar-search-input:-webkit-autofill,
.sidebar-search-input:-webkit-autofill:hover,
.sidebar-search-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0a0a0a !important;
  transition: background-color 9999s ease-out 0s;
}
.sidebar-search-input::placeholder { color: rgba(0,0,0,0.45); }

/* Force search input text color even when sidebar theme overrides text color. */
.info-panel .sidebar-search-input {
  color: #060606 !important;
  caret-color: #ffffff !important;
  -webkit-text-fill-color: #0d0d0d !important;
}

/* ═══════════════════════════════════════════════════════════════════
   LOCATION CARDS (matching reference list items)
   ═══════════════════════════════════════════════════════════════════ */

.locations-list {
  padding: 8px 0;
}

.list-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 16px 16px 6px;
  margin: 0;
}

.location-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.location-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.location-card.active-selection {
  /* Toned-down active state: subtler background and muted gold indicator */
  background: rgba(255, 255, 255, 0.035);
  border-left: 3px solid rgba(212, 175, 55, 0.28); /* muted gold */
}

.location-thumbnail {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}

.location-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255,255,255,0.04);
}

.location-info h4 {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
  line-height: 1.4;
}

.location-coordinates {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(0, 255, 220, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(235, 255, 250, 0.92);
}

/* ═══════════════════════════════════════════════════════════════════
   SECTOR CARDS
   ═══════════════════════════════════════════════════════════════════ */

.sector-header-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}

.sector-header-card:hover {
  background: rgba(255,255,255,0.05);
}

.sector-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sector-info {
  flex: 1;
  min-width: 0;
}

.sector-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.sector-count {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.sector-chevron {
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.project-sub-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 32px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.project-sub-card:hover {
  background: rgba(255,255,255,0.05);
}

.project-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
}

.project-sub-info {
  flex: 1;
  min-width: 0;
}

.project-sub-name {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-sub-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.project-sub-coordinates {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(165, 245, 236, 0.92);
}

.project-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b; /* yellow/amber for projects */
  border: 2px solid #a35a00; /* slightly darker edge for contrast */
  flex-shrink: 0;
}

/* Responsiveness: on small screens, present the panel as a bottom sheet so cards never overlay the sidebar */
@media (max-width: 720px) {
  .info-panel.sidebar-right,
  .info-panel.sidebar-left,
  .info-panel.position-right,
  .info-panel.position-left {
    left: 16px !important;
    right: 16px !important;
    bottom: 80px !important;
    top: auto !important;
    width: calc(100% - 32px) !important;
    height: 42vh !important;
    border-radius: 16px !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: all !important;
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
  }

  .main.sidebar-open-right .cesium-container,
  .main.sidebar-open-left .cesium-container {
    left: 0 !important;
    width: 100% !important;
  }

  .location-card {
    padding: 10px 12px;
  }

  .blue-section,
  .map-plan-banner {
    display: none !important;
  }

  /* Ensure map takes full width when blue-section is hidden */
  .map-section {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.project-status-dot.status-done { background: #22c55e; }
.project-status-dot.status-wip  { background: #f59e0b; }

/* ═══════════════════════════════════════════════════════════════════
   DETAIL VIEW
   ═══════════════════════════════════════════════════════════════════ */

.detail-view-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.detail-view-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  animation: slideInDetail 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDetail {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.detail-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.detail-hero .hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-hero {
  aspect-ratio: 4 / 3;
}

.panel-body {
  padding: 20px 20px 24px;
}

.location-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.content-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.description-text {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 8px 14px;
  transition: background 0.15s, border-color 0.15s;
}

.external-link:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
}

/* Meta rows (project detail) */
.meta-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  flex: 0 0 70px;
}

.meta-value {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}

.status-badge { font-weight: 600; }
.status-completed { color: #22c55e; }
.status-inprogress { color: #f59e0b; }

.coords-chip {
  margin-top: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 8px 12px;
}

.detail-coordinate-card {
  margin: 2px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(125deg, rgba(0, 185, 146, 0.15), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(93, 255, 220, 0.26);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-coordinate-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(210, 255, 245, 0.72);
}

.detail-coordinate-value {
  font-size: 12px;
  font-weight: 600;
  color: rgba(240, 255, 252, 0.98);
}

/* Child points */
.child-points-section { margin-top: 18px; }
.child-point-card { animation: none; }

/* ═══════════════════════════════════════════════════════════════════
   HIERARCHICAL RTL SIDEBAR
   ═══════════════════════════════════════════════════════════════════ */

.hierarchy-view-root {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  direction: ltr;
  text-align: left;
}

.hierarchy-view-root.rtl {
  direction: rtl;
  text-align: right;
}

.hierarchy-slide-in {
  animation: hierarchyRtlSlideIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.hierarchy-slide-out {
  animation: hierarchyRtlSlideOut 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes hierarchyRtlSlideIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes hierarchyRtlSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

.hierarchy-header {
  position: sticky;
  top: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 12, 0.96);
  backdrop-filter: blur(12px);
  direction: ltr;
}
.hierarchy-header .btn-close {
  position: static;        /* override the absolute positioning */
  margin-left: auto;       /* push to far right */
  top: unset;
  right: unset;
  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;
}

/* Ensure the fullscreen/expand button inside the hierarchy header
   matches the close button in size and visual weight. */
.hierarchy-header .btn-expand {
  position: static;
  margin-left: 8px;
  top: unset;
  right: unset;
  width: 32px;
  height: 32px;
  border-radius: 14px;
  display: none; /* hidden in normal (desktop) mode; shown in responsive below */
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%);
  border: 1px solid #e1b740;
  color: #ffffff;
  padding: 0;
  flex-shrink: 0;
}

.hierarchy-header .btn-close svg,
.hierarchy-header .btn-expand svg {
  width: 14px;
  height: 14px;
}
.hierarchy-level {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
}

/* Split-map now shows full-width map with no blue section */
.main.split-map .container {
  display: flex;
  height: 100%;
}

/* Hide blue-section and make map take full width */
.main.split-map .blue-section {
  display: none !important;
}

.main.split-map .map-section {
  flex: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  order: 1;
}

/* When the overlay panel is anchored inside the map (position-inside-*),
   make the panel background transparent so a dark vertical strip does not
   appear between map and the right brief. Also remove its heavy box-shadow. */
.info-panel.position-inside-right,
.info-panel.position-inside-left {
  /* Keep user-selected background (solid/image) from sidebar customization. */
  box-shadow: none !important;
  border: none !important;
}

/* Remove any decorative card backgrounds that appear inside the blue brief half */
.blue-section .project-sub-card,
.blue-section .project-thumb,
.blue-section .project-sub-info,
.blue-section .detail-coordinate-card,
.blue-section .location-thumbnail,
.blue-section .sector-icon {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  color: inherit !important;
}

/* Project dots color: use dark blue instead of black */
.legend-swatch-project-dot,
.project-status-dot,
.project-dot {
  background: #f59e0b !important; /* yellow/amber for projects */
}

/* Sidebar overlay effect helpers (applied via classes on .info-panel) */
.info-panel { position: absolute; overflow: hidden; }
.info-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0 !important;
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.info-panel > * { position: relative; z-index: 2; }

.info-panel.overlay-smoke::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.45));
  filter: blur(6px) saturate(110%);
  opacity: calc(var(--overlay-opacity, 0.45));
}
.info-panel.overlay-white::before {
  background: rgba(255,255,255,0.9);
  filter: blur(8px) saturate(100%);
  opacity: calc(var(--overlay-opacity, 0.45));
}
.info-panel.overlay-dark::before {
  background: linear-gradient(180deg, rgba(0,0,0,0.72), rgba(0,0,0,0.28));
  filter: blur(4px) contrast(0.9);
  opacity: calc(var(--overlay-opacity, 0.5));
}
.info-panel.overlay-gradient::before {
  background: linear-gradient(135deg, rgba(10,25,70,0.6), rgba(120,15,90,0.28));
  filter: blur(3px);
  opacity: calc(var(--overlay-opacity, 0.45));
}
.info-panel.overlay-glass {
  /* Keep custom sidebar background image/color and only tint the panel. */
  background-color: rgba(255,255,255,0.02) !important;
  backdrop-filter: blur(10px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(140%) !important;
}
.info-panel.overlay-opacity::before {
  background: rgba(0,0,0,0.5);
  filter: blur(2px);
  opacity: calc(var(--overlay-opacity, 0.35));
}

/* Ensure overlay pseudo-element does not obscure content by default */
.info-panel.panel-visible::before { opacity: 1; }

/* Do not reset sidebar background here; keep user-selected background/image
  from Map Settings and layer overlay effects using ::before. */

/* Ensure overlay pseudo-element stacks above the panel background but below content */
.info-panel::before { z-index: 1; }
.info-panel > * { z-index: 2; }

.hierarchy-top-arrow {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  border: 1px solid #e1b740;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  padding: 0;
}

.hierarchy-top-arrow svg {
  width: 14px;
  height: 14px;
}

.hierarchy-top-arrow:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(227, 182, 74, 0.35);
}

.hierarchy-panel-body {
  padding-top: 16px;
}

.hierarchy-title {
  margin-bottom: 12px;
}

.hierarchy-section-title {
  margin: 18px 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.hierarchy-click-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Right blue brief panel (text area) placed on the right half of the viewport */
.right-blue-brief {
  /* Pin the brief to the right 50% (exact half) and remove inner card visuals */
  position: absolute;
  left: var(--map-pane-width);
  top: 0;
  bottom: 0;
  width: calc(100% - var(--map-pane-width));
  padding: 24px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  background: transparent; /* remove any inner white card */
  color: #08304a;
  z-index: 80; /* above map overlays so text is visible */
}

.right-blue-brief .brief-title {
  font-size: 20px;
  font-weight: 800;
  color: #08304a;
  margin: 0 0 12px 0;
}

.right-blue-brief p {
  margin: 6px 0;
  line-height: 1.6;
  color: rgba(10,38,57,0.95);
  font-size: 15px;
  max-width: 100%;
  word-break: break-word;
}

/* Movable legend overlay that stays within the map section */
.map-legend-fixed {
  position: absolute;
  left: 16px;
  top: 112px;
  width: min(280px, calc(100% - 32px));
  background: rgba(58, 64, 76, 0.58);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 121;
  animation: legendFadeIn 0.18s ease;
  user-select: none;
  cursor: grab;
  touch-action: none;
}
@keyframes legendFadeIn {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.map-legend-fixed.dragging {
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.44);
  cursor: grabbing;
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.legend-drag-handle {
  cursor: grab;
  touch-action: none;
}

.legend-drag-handle:active {
  cursor: grabbing;
}

.legend-header h4 { margin: 0; font-size: 13px; color: #f7fbff; }
.legend-close {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: rgba(255,255,255,0.85); padding: 0 2px;
}
.btn-close-tab {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
}

.map-plan-banner {
  position: absolute;
  z-index: 124;
  pointer-events: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-wrap: balance;
}

.map-plan-banner h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: #f7fbff;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
}

.map-plan-banner p {
  margin: 10px 0 0;
  font-size: clamp(0.9rem, 1.25vw, 1.15rem);
  line-height: 1.45;
  color: rgba(245, 251, 255, 0.9);
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.map-plan-banner.rtl {
  direction: rtl;
}

.map-plan-banner.ltr {
  direction: ltr;
}

.map-controls-top-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
/* Unified top-right map controls (gray glass style) */
.map-controls-dock {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* When Arabic (RTL) is active, pin controls to the left and flip alignment/origin */
.map-controls-dock.rtl {
  left: 6px !important;
  right: auto !important;
  align-items: flex-start !important;
}

.map-controls-dock.rtl .map-controls-panel {
  transform-origin: top left;
}

.map-controls-dock.rtl .map-controls-trigger {
  margin-right: auto;
}

.map-controls-trigger {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(58, 64, 76, 0.62);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.map-controls-trigger:hover {
  transform: translateY(-1px);
  background: rgba(70, 77, 91, 0.72);
  border-color: rgba(255,255,255,0.32);
}

.map-controls-panel {
  width: min(310px, calc(100vw - 32px));
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(58, 64, 76, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
  padding: 12px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  /* Make the panel appear immediately when toggled to avoid perceptible lag */
  transition: opacity 0s ease, transform 0s ease;
}

.map-controls-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.map-controls-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-controls-lang-group {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
  margin-top: 10px;
}

.map-controls-lang-group .map-controls-btn {
  width: 100% !important;
  min-width: unset !important;
  height: 48px;
  border-radius: 999px;
}

.map-controls-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(44, 50, 62, 0.62);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.map-controls-btn:hover {
  background: rgba(66, 73, 88, 0.72);
  border-color: rgba(255,255,255,0.32);
  transform: translateY(-1px);
}

.map-controls-top-row {
  margin-top: 0;
  display: flex;
  gap: 10px;
  width: auto;
  justify-content: flex-end;
}

.map-controls-dock.rtl .map-controls-top-row {
  justify-content: flex-start;
}

.map-controls-btn-zoom {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 14px;
  border: 1px solid #e1b740;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(227, 182, 74, 0.22);
}

.map-controls-btn-zoom:hover {
  background: linear-gradient(135deg, #f9dc6c 0%, #e7ba4c 100%);
  box-shadow: 0 8px 18px rgba(227, 182, 74, 0.34);
}

.map-zoom-floating {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 132;
  display: flex;
  gap: 8px;
  align-items: center;
}

.map-zoom-floating.rtl {
  left: 14px;
  right: auto;
}

.map-zoom-floating .map-controls-btn-zoom {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 14px;
  border: 1px solid #e1b740;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(227, 182, 74, 0.28);
}

.map-zoom-floating .map-controls-btn-zoom:hover {
  background: linear-gradient(135deg, #f9dc6c 0%, #e7ba4c 100%);
  box-shadow: 0 8px 18px rgba(227, 182, 74, 0.35);
}

.map-controls-lang-btn {
  /* language buttons reuse base control button visual but show text */
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  background: rgba(44, 50, 62, 0.62);
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.18s ease;
}

.map-controls-lang-btn:hover {
  background: rgba(66, 73, 88, 0.78);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.32);
}

.map-controls-lang-btn.active {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.34);
  box-shadow: 0 6px 24px rgba(0,210,140,0.08), 0 1px 0 rgba(255,255,255,0.02) inset;
}

.legend-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex-shrink:0; }
.legend-swatch-district { background: #2dd4bf; border-radius: 4px; }
.legend-swatch-governorate-pin { background: #dc2626; width: 12px; height: 12px; border-radius: 2px; }
.legend-swatch-project-dot { background: #f59e0b; width: 12px; height: 12px; border-radius: 999px; border: 2px solid #a35a00; }

.map-legend-fixed .legend-item {
  color: rgba(245, 251, 255, 0.94);
}

/* Responsive: shrink legend and move to left padding on small screens */
@media (max-width: 900px) {
  .map-legend-fixed { width: min(260px, calc(100% - 24px)); }
  .right-blue-brief { padding: 18px; }
  .right-blue-brief p { font-size: 13px; }
}

.hierarchy-row-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  text-align: right;
  transition: background 0.18s, border-color 0.18s;
}

.hierarchy-row-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.hierarchy-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.hierarchy-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hierarchy-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.46);
  font-size: 18px;
}

.hierarchy-row-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.hierarchy-row-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hierarchy-row-sub {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
}

.hierarchy-row-coords {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(176, 255, 243, 0.92);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hierarchy-explore-navigation {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 12, 0.96);
  backdrop-filter: blur(12px);
  direction: ltr;
}

/* Reorder elements so arrows are next to each other: [Prev] [Next] [Center Text] */
.hierarchy-explore-navigation .hierarchy-explore-arrow:first-of-type {
  order: 1;
}

.hierarchy-explore-navigation .hierarchy-explore-arrow:last-of-type {
  order: 2;
}

.hierarchy-explore-navigation .hierarchy-explore-center {
  order: 3;
  margin-left: auto;
}

.hierarchy-explore-arrow {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  border: 1px solid #e1b740;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.hierarchy-explore-arrow:hover:not(:disabled) {
  background: linear-gradient(135deg, #f9dc6c 0%, #e7ba4c 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(227, 182, 74, 0.35);
}

.hierarchy-explore-arrow svg {
  width: 14px;
  height: 14px;
}

.hierarchy-explore-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hierarchy-explore-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.hierarchy-explore-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
}

.hierarchy-explore-current {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hierarchy-explore-counter {
  font-size: 11px;
  color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════
   ACTION BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-edit {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
  border-color: rgba(255,255,255,0.1);
}

.btn-edit:hover {
  background: rgba(255,255,255,0.12);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239,68,68,0.2);
}

.btn-delete:hover {
  background: rgba(239,68,68,0.2);
}

/* ── Close button ── */
.btn-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 0 15px 0 15px;
  border: none;
  background: linear-gradient(90deg, #D4AF37, #F9E339);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212,175,55,0.4);
}

/* Expand/Reduce button placed beside the close button (mobile only) */
.btn-expand {
  position: absolute;
  top: 14px;
  right: 64px; /* sits to the left of the close button */
  width: 32px;
  height: 32px;
  border-radius: 0 15px 0 15px;
  background: linear-gradient(90deg, #D4AF37, #F9E339);
  border: none;
  color: #ffffff;
  display: none; /* visible on small screens */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-expand:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212,175,55,0.4); }

.hierarchy-header .btn-close,
.hierarchy-header .btn-expand,
.info-panel .btn-close,
.info-panel .btn-expand,
.info-panel .btn-close-tab,
.info-panel .btn-expand-tab {
  /* l bouton previous w next f west a9alim*/
  border-radius:  15px 0 15px 0  !important;
  background: linear-gradient(90deg, #D4AF37, #F9E339) !important;
  border: none !important;
  color: #ffffff !important;
}



.hierarchy-header .btn-close:hover,
.hierarchy-header .btn-expand:hover,
.info-panel .btn-close:hover,
.info-panel .btn-expand:hover,
.info-panel .btn-close-tab:hover,
.info-panel .btn-expand-tab:hover {
  box-shadow: 0 8px 18px rgba(227, 182, 74, 0.35);
}

@media (max-width: 720px) {
  .btn-expand { display: flex; }
  .btn-close,
  .btn-expand,
  .info-panel .btn-close-tab,
  .info-panel .btn-expand-tab {
    width: 36px;
    height: 36px;
    border-radius: 0 15px 0 15px !important;
  }
  .hierarchy-header .btn-expand,
  .info-panel .btn-expand-tab {
    display: inline-flex !important;
  }
}

/* ── Back button ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: auto 16px 16px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #d4af37;
  background: rgba(255, 255, 255, 0.95);
  color: #111111;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  align-self: flex-start;
  animation: sidebarBackBounce 1.9s ease-in-out infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@keyframes sidebarBackBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.btn-back:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   EXPLORE MORE BAR (pinned at bottom of panel)
   ═══════════════════════════════════════════════════════════════════ */

.explore-navigation {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(10, 10, 12, 0.96);
  gap: 8px;
  animation: fadeInExplore 0.25s ease;
  position: relative;
  direction: ltr;
}

.explore-navigation .explore-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  align-items: center;
  pointer-events: none;
  width: max-content;
  text-align: center;
  direction: rtl;
}
.explore-navigation .nav-arrow:first-of-type {
  order: 1;
}

.explore-navigation .nav-arrow.second {
  order: 2;
}

.explore-navigation .explore-center {
  order: 3;
}
.explore-navigation {
  flex: 0 0 auto;
}

.explore-navigation  {
  margin-left: 0;
}


@keyframes fadeInExplore {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-arrow {
  width: 32px;
  height: 32px;
 /* border-radius: 10px;*/
  border: 1px solid #e1b740;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  padding: 0;
}

.explore-navigation .nav-arrow svg {
  transform: scaleX(-1);
}

.nav-arrow:hover:not(:disabled) {
  background: linear-gradient(135deg, #f9dc6c 0%, #e7ba4c 100%);
  border-color: #e1b740;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Unified sidebar icon color: keep cancel/back/navigation SVG icons white. */
.info-panel .btn-close,
.info-panel .btn-expand,
.info-panel .btn-close-tab,
.info-panel .btn-expand-tab,
.info-panel .btn-back,
.info-panel .hierarchy-top-arrow,
.info-panel .hierarchy-explore-arrow,
.info-panel .nav-arrow {
  color: #ffffff !important;
}

.info-panel .btn-close svg,
.info-panel .btn-expand svg,
.info-panel .btn-close-tab svg,
.info-panel .btn-expand-tab svg,
.info-panel .btn-back svg,
.info-panel .hierarchy-top-arrow svg,
.info-panel .hierarchy-explore-arrow svg,
.info-panel .nav-arrow svg,
.info-panel .btn-close svg path,
.info-panel .btn-expand svg path,
.info-panel .btn-close-tab svg path,
.info-panel .btn-expand-tab svg path,
.info-panel .btn-back svg path,
.info-panel .hierarchy-top-arrow svg path,
.info-panel .hierarchy-explore-arrow svg path,
.info-panel .nav-arrow svg path,
.info-panel .btn-close svg line,
.info-panel .btn-expand svg line,
.info-panel .btn-close-tab svg line,
.info-panel .btn-expand-tab svg line,
.info-panel .btn-back svg line,
.info-panel .hierarchy-top-arrow svg line,
.info-panel .hierarchy-explore-arrow svg line,
.info-panel .nav-arrow svg line,
.info-panel .btn-close svg polyline,
.info-panel .btn-expand svg polyline,
.info-panel .btn-close-tab svg polyline,
.info-panel .btn-expand-tab svg polyline,
.info-panel .btn-back svg polyline,
.info-panel .hierarchy-top-arrow svg polyline,
.info-panel .hierarchy-explore-arrow svg polyline,
.info-panel .nav-arrow svg polyline {
  stroke: #ffffff !important;
  fill: #ffffff !important;
}

.explore-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.explore-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
}

.explore-current {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.explore-counter {
  font-size: 11px;
  color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════
   CLEAR ALL BUTTON
   ═══════════════════════════════════════════════════════════════════ */

.clear-all-section { padding: 12px 16px 4px; }

.btn-clear-all {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
  color: #f87171;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-clear-all:hover {
  background: rgba(239,68,68,0.15);
}

/* ═══════════════════════════════════════════════════════════════════
   LANGUAGE CONTROLS
   ═══════════════════════════════════════════════════════════════════ */

.language-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 90;
  background: rgba(10,10,12,0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 6px 10px;
}

.lang-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-right: 4px;
}

.lang-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #ffffff;
}

.lang-btn:hover:not(.active) {
  color: rgba(255,255,255,0.8);
}

/* ═══════════════════════════════════════════════════════════════════
   LANDING MODE OVERLAYS
   ═══════════════════════════════════════════════════════════════════ */

.map-overlay-content {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: none;
}

.map-overlay-text {
  text-align: center;
  background: rgba(10,10,12,0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 28px;
}

.map-overlay-text h2 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px;
}

.map-overlay-text p {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   RIGHT BLUE BRIEF + LEGEND
   ═══════════════════════════════════════════════════════════════════ */

.right-blue-brief {
  position: absolute;
  top: 86px;
  right: 18px;
  width: min(44vw, 680px);
  max-height: calc(100% - 120px);
  overflow: auto;
  z-index: 26;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(36, 74, 120, 0.2);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(14, 37, 67, 0.16);
  backdrop-filter: blur(4px);
  padding: 14px 16px;
  color: #0f2740;
  line-height: 1.62;
  text-align: right;
}

.brief-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: #0b3158;
}

.right-blue-brief p {
  margin: 0 0 9px;
  font-size: 14px;
  font-weight: 500;
}

.map-legend-box {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
}

.map-legend-box h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: #102a43;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1a3045;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-swatch {
  display: inline-block;
  flex: 0 0 auto;
}

.legend-swatch-district {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #00b4d8, #2dd4bf);
}

.legend-swatch-governorate-pin {
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: #dc2626;
}

.legend-swatch-project-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #a35a00;
  background: #f59e0b;
}

.circular-zoom-controls {
  /* Horizontal controls centered at the very bottom of the map.
     On small screens they stack vertically. */
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row; /* horizontal layout */
  gap: 12px;
  align-items: center;
  justify-content: center;
  z-index: 40; /* below the .info-panel (z-index:100) to avoid overlapping the sidebar */
  pointer-events: auto;
}

/* Responsive: on very small screens keep the buttons stacked vertically so they remain tappable */
@media (max-width: 520px) {
  .circular-zoom-controls {
    flex-direction: column;
    gap: 8px;
    bottom: 18px;
  }
}

.circular-zoom-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(10,10,12,0.8);
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: 20px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.circular-zoom-btn:hover { background: rgba(255,255,255,0.1); }
.circular-zoom-btn:active { transform: translateY(1px); }

.custom-nav-controls {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 100;
}

.custom-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(10,10,12,0.8);
  backdrop-filter: blur(12px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.custom-nav-btn:hover { background: rgba(255,255,255,0.1); }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

/* No-op placeholder to ensure patch tool run ordering */
@media (max-width: 1200px) {
  .info-panel {
    left: auto !important;
    right: 16px !important;
    top: 40px;
    bottom: 80px;
    width: min(500px, var(--panel-overlay-width));
    max-width: min(500px, var(--panel-overlay-width));
    height: auto;
    border-radius: 16px;
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
  }


  .info-panel.panel-visible {
    transform: translateY(0);
  }

  .detail-hero {
    aspect-ratio: 16 / 7;
  }

  .location-title { font-size: 18px; }

  .language-controls {
    top: 10px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  .info-panel {
    height: 60vh;
  }

  .filter-tab {
    font-size: 10px;
    padding: 12px 4px;
  }
}

/* Medium / small screens: make the map full-width and convert sidebar to overlay/bottom sheet */
@media (max-width: 1200px) {
  .main {
   
    --panel-overlay-width: 86vw;
    --map-shift-inline: 0px; 
  }

  .right-blue-brief {
    display: none;
  }

  .blue-section,
  .map-plan-banner {
    display: none !important;
  }

  .cesium-container {
    width: 100%;
 
  }

  .info-panel {
    /* Keep it anchored inside map but constrained to the right on tablet */
    left: auto !important;
    right: 16px !important;
    top: 40px;
    bottom: 80px;
    width: min(500px, var(--panel-overlay-width));
    max-width: min(500px, var(--panel-overlay-width));
    height: auto;
    border-radius: 16px;
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
  }

  .info-panel.mobile-expanded {
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: all !important;
  }
}

@media (max-width: 900px) {
  .main {

    --panel-overlay-width: 94vw;
  }

  .info-panel {
    /* Slide up from bottom on narrow screens */
    top: auto !important;
    right: 16px !important;
    left: 16px !important;
    bottom: 80px !important;
    width: calc(100% - 32px) !important;
    max-width: calc(100% - 32px) !important;
    height: 50vh !important;
    border-radius: 16px !important;
    transform: translateY(20px);
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
  }

  .info-panel.mobile-expanded {
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: all !important;
  }

  .info-panel.panel-visible {
    transform: translateY(0);
  }

  .map-controls-dock {
    top: 10px;
    right: 10px;
  }

  .map-controls-dock.rtl {
    left: 4px !important;
    right: auto !important;
  }

  .map-controls-panel {
    width: min(290px, calc(100vw - 20px));
  }

  .map-plan-banner {
    display: none !important;
  }

  .map-plan-banner h2 {
    font-size: clamp(1.3rem, 5.2vw, 2.1rem);
  }

  .map-plan-banner p {
    font-size: clamp(0.8rem, 3vw, 1rem);
  }
}
:host ::ng-deep .cesium-infoBox-camera,
:host ::ng-deep .cesium-infoBox button[data-bind*="camera"] {
  display: none !important;
}
.legend-toggle-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 120;
  box-shadow: 0 2px 12px rgba(0,0,0,0.28);
  color: #032b38;
}
/* ═══════════════════════════════════════════════════════════════════
   CESIUM UI OVERRIDES
   ═══════════════════════════════════════════════════════════════════ */

.cesium-widget-credits { display: none !important; }

/* Switch positions of zoom buttons and baseLayerPicker (miniature map)
   Zoom buttons at top left, baseLayerPicker below them */
:host ::ng-deep .cesium-viewer-toolbar {
  position: absolute;
  top: 80px !important;
  left: 16px !important;
  right: auto !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

:host ::ng-deep .cesium-viewer-toolbar .cesium-toolbar-button {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%) !important;
  border: 1px solid #e1b740 !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

:host ::ng-deep .cesium-viewer-toolbar .cesium-toolbar-button:hover {
  filter: brightness(1.1);
  transform: scale(1.07);
}

:host ::ng-deep .cesium-viewer-zoom {
  position: absolute;
  top: 16px !important;
  left: 16px !important;
  right: auto !important;
  bottom: auto !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

:host ::ng-deep .cesium-viewer-zoom .cesium-button {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5d35a 0%, #e3b64a 100%) !important;
  border: 1px solid #e1b740 !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
  transition: filter 0.15s, transform 0.15s;
}

:host ::ng-deep .cesium-viewer-zoom .cesium-button:hover {
  filter: brightness(1.1);
  transform: scale(1.07);
}

/* Reposition baseLayerPicker (miniature map button) below zoom controls */
:host ::ng-deep .cesium-viewer-toolbar {
  top: 120px !important;
  left: 16px !important;
}

/* RTL support - move controls to right side for Arabic */
:host ::ng-deep .cesium-viewer.rtl .cesium-viewer-zoom,
:host ::ng-deep .main.lang-ar .cesium-viewer-zoom {
  left: auto !important;
  right: 16px !important;
}

:host ::ng-deep .cesium-viewer.rtl .cesium-viewer-toolbar,
:host ::ng-deep .main.lang-ar .cesium-viewer-toolbar {
  left: auto !important;
  right: 16px !important;
}


/* ===== Container for map + blue brief (50/50 or full) ===== */
.container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.blue-section {
  display: none !important;
}

/* Map takes full width now that blue-section is hidden */
.map-section {
  flex: 1 !important;
  width: 100% !important;
  min-width: 100% !important;
}

.brief-text {
  color: var(--brief-text, #032b38) !important;
}

.brief-text {
  max-width: 100%;
  text-align: center;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.brief-text p {
  margin: 0 0 10px;
}

/* Ensure any nested elements inside the brief inherit the parent inline color
   (settings bind color to the .brief-text element). Some selectors define
   explicit colors (e.g. .brief-title); make these inherit so runtime color
   changes from settings are visible. */
.brief-text, .brief-text * {
  color: inherit !important;
  background: transparent !important;
}

.brief-text .brief-title {
  color: inherit !important;
}




/* keep existing absolute-positioned Cesium container behavior but adapt to flex child */
.map-section .cesium-container {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.container {
  display: flex;
}



.map-section {
  flex: 1 !important;
  width: 100% !important;
  min-width: 100% !important;
  position: relative; /* sidebar will position:absolute inside this */
  background-color: #08044C;
}

/* Full map mode when brief is hidden via popup toggle. */
.map-section.full {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

/* Full-page map mode (CSS overlay, not browser F11 fullscreen API). */
.map-section.page-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  flex: 0 0 100% !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  z-index: 1500 !important;
}

/* In fullscreen, .info-panel is a sibling of .map-section (not a child),
   so keep it fixed above the map viewport. */
.main.map-fullscreen-active {
  overflow: visible;
}

.main.map-fullscreen-active .info-panel {
  position: fixed !important;
  z-index: 1705 !important;
  top: 30px !important;
  bottom: 80px !important;
  max-height: calc(100vh - 160px) !important;
background: var(--sidebar-background, rgba(10, 10, 12, 0.98));
}

.main.map-fullscreen-active .info-panel.position-inside-right,
.main.map-fullscreen-active .info-panel.position-right,
.main.map-fullscreen-active .info-panel.sidebar-right {
  left: auto !important;
  right: 16px !important;
}

.main.map-fullscreen-active .info-panel.position-inside-left,
.main.map-fullscreen-active .info-panel.position-left,
.main.map-fullscreen-active .info-panel.sidebar-left {
  left: 16px !important;
  right: auto !important;
}

.main.map-fullscreen-active .info-panel.position-top,
.main.map-fullscreen-active .info-panel.position-bottom,
.main.map-fullscreen-active .info-panel.sidebar-top,
.main.map-fullscreen-active .info-panel.sidebar-bottom {
  left: 16px !important;
  right: 16px !important;
  width: calc(100vw - 32px) !important;
  max-width: calc(100vw - 32px) !important;
}

.main.map-fullscreen-active .info-panel.panel-visible {
  pointer-events: all;
}

@media (max-width: 900px) {
  .main.map-fullscreen-active .info-panel.position-inside-right,
  .main.map-fullscreen-active .info-panel.position-right,
  .main.map-fullscreen-active .info-panel.sidebar-right,
  .main.map-fullscreen-active .info-panel.position-inside-left,
  .main.map-fullscreen-active .info-panel.position-left,
  .main.map-fullscreen-active .info-panel.sidebar-left {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 50vh !important;
    max-height: 50vh !important;
    border-radius: 16px 16px 0 0 !important;
  }
}

.map-section.page-fullscreen .cesium-container {
  width: 100% !important;
  height: 100% !important;
}

.map-section.page-fullscreen .info-panel {
  z-index: 1605 !important;
  top: 16px !important;
  bottom: 16px !important;
  max-width: calc(100vw - 32px) !important;
}

.map-section.page-fullscreen .info-panel.position-inside-right,
.map-section.page-fullscreen .info-panel.position-right,
.map-section.page-fullscreen .info-panel.sidebar-right {
  left: auto !important;
  right: 16px !important;
}

.map-section.page-fullscreen .info-panel.position-inside-left,
.map-section.page-fullscreen .info-panel.position-left,
.map-section.page-fullscreen .info-panel.sidebar-left {
  left: 16px !important;
  right: auto !important;
}

.map-section.page-fullscreen .info-panel.position-top,
.map-section.page-fullscreen .info-panel.position-bottom,
.map-section.page-fullscreen .info-panel.sidebar-top,
.map-section.page-fullscreen .info-panel.sidebar-bottom {
  left: 16px !important;
  right: 16px !important;
  width: calc(100vw - 32px) !important;
  max-width: calc(100vw - 32px) !important;
}

.map-section.page-fullscreen .map-plan-banner {
  z-index: 1606 !important;
}

.map-section.page-fullscreen .map-legend-fixed,
.map-section.page-fullscreen .legend-toggle-btn {
  z-index: 1705 !important;
}

.map-section.page-fullscreen .map-legend-fixed {
  z-index: 1607 !important;
}

.map-section:fullscreen,
.map-section:-webkit-full-screen,
.map-section:-ms-fullscreen {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 100vh !important;
}

.map-section:fullscreen .cesium-container,
.map-section:-webkit-full-screen .cesium-container,
.map-section:-ms-fullscreen .cesium-container {
  width: 100% !important;
  height: 100% !important;
}

.container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Keep legend controls away from responsive sidebars/bottom sheets. */
@media (max-width: 1200px) {
  .legend-toggle-btn {
    left: 16px;
    right: auto;
  }

  .map-legend-fixed {
    width: min(280px, calc(100% - 24px));
  }
}

@media (max-width: 900px) {
  .legend-toggle-btn {
    top: 72px;
    left: 12px;
    right: auto;
    bottom: auto;
  }

  .map-legend-fixed {
    width: min(260px, calc(100% - 24px));
  }
}

/* Requested: remove exact location text/details from sidebar cards and details. */
.location-coordinates,
.project-sub-meta,
.project-sub-coordinates,
.hierarchy-row-coords,
.detail-coordinate-card {
  display: none !important;
}

.cesium-selection-wrapper svg {
  transform: scale(0.3);
}
.map-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(90deg, #D4AF37, #F9E339);
  border: none;
  border-radius: 0 15px 0 15px;
  color: #f9f7f3;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(212,175,55,0.35);
  transition: filter 0.15s, transform 0.15s;
  line-height: 1;
}

.map-zoom-btn:hover {
  filter: brightness(1.12);
  transform: scale(1.07);
}

.map-zoom-btn:active {
  filter: brightness(0.92);
  transform: scale(0.97);
}
/*test*/
/* ═══ GOLD BUTTON BASE — applied to ALL sidebar/map buttons ═══ */
.btn-close,
.btn-back,
.btn-expand,
.btn-action,
.btn-clear-all,
.hierarchy-top-arrow,
.nav-arrow,
.map-controls-trigger,
.map-controls-btn,
.map-controls-lang-btn,
.info-panel .btn-close-tab,
.info-panel .btn-expand-tab,
.filter-tab,
.sector-header-card {
  box-sizing: border-box;
}

.btn-expand,
.hierarchy-top-arrow,
.nav-arrow,
.info-panel .btn-close-tab,
.info-panel .btn-expand-tab {
  /*l bouton l bakc arrow*/
  border-radius: 15px 0 15px 0 !important;
  border: none !important;
  color: #ffffff !important;
}

.btn-expand svg, .btn-expand svg *,
.hierarchy-top-arrow svg, .hierarchy-top-arrow svg *,
.hierarchy-explore-arrow svg, .hierarchy-explore-arrow svg *,
.nav-arrow svg, .nav-arrow svg *,
.info-panel .btn-close-tab svg, .info-panel .btn-close-tab svg *,
.info-panel .btn-expand-tab svg, .info-panel .btn-expand-tab svg * {
  stroke: #ffffff !important;
  fill: #ffffff !important;
}

.btn-expand:hover,
.hierarchy-top-arrow:hover,
.hierarchy-explore-arrow:hover:not(:disabled),
.nav-arrow:hover:not(:disabled),
.info-panel .btn-close-tab:hover,
.info-panel .btn-expand-tab:hover {
  filter: brightness(1.1);
  transform: scale(1.07);
  box-shadow: 0 6px 18px rgba(212,175,55,0.4) !important;
}

/* Cancel button uses the same visual treatment as Back */
.btn-close,
.hierarchy-header .btn-close,
.info-panel .btn-close {
  background: linear-gradient(90deg, #D4AF37, #F9E339) !important;
  border: none !important;
  color: #ffffff !important;
  border-radius: 15px 0  15px 0 !important;
}

.btn-close svg,
.btn-close svg *,
.hierarchy-header .btn-close svg,
.hierarchy-header .btn-close svg *,
.info-panel .btn-close svg,
.info-panel .btn-close svg * {
  stroke: #ffffff !important;
  fill: #ffffff !important;
}

.btn-close:hover,
.hierarchy-header .btn-close:hover,
.info-panel .btn-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212,175,55,0.4) !important;
}

/* Back button */


.btn-back svg, .btn-back svg * {
  stroke: #ffffff !important;
  fill: #ffffff !important;
}

.btn-back:hover {
  filter: brightness(1.1);
  transform: translateY(-1px) scale(1.07);
  box-shadow: 0 6px 18px rgba(212,175,55,0.4) !important;
}

.hierarchy-explore-arrow {
  border-radius: 0 15px  0  15px  !important;
}
.nav-arrow {
  border-radius: 0 15px 0 15px    !important;
}
.hierarchy-explore-arrow.second{
  border-radius:0 15px  0  15px       !important;
}
.nav-arrow.second {
  border-radius:  15px  0 15px  0  !important;
}

/* Action buttons (edit/delete) */
.btn-action.btn-edit {
  background: linear-gradient(90deg, #D4AF37, #F9E339) !important;
  border: none !important;
  color: #f9f7f3 !important;
  border-radius: 0 15px 0 15px !important;
}
.btn-action.btn-edit:hover {
  filter: brightness(1.1);
}

.btn-action.btn-delete {
  background: linear-gradient(90deg, #b91c1c, #ef4444) !important;
  border: none !important;
  color: #ffffff !important;
  border-radius: 0 15px 0 15px !important;
}

.btn-action.btn-delete:hover {
  filter: brightness(1.1);
}

/* Filter tabs */
.filter-tab {
  border-radius: 15px 0 15px 0  !important;
}
.filter-tab.active {
  background: linear-gradient(90deg, #D4AF37, #F9E339) !important;
  color: #1a1200 !important;
  border-bottom-color: transparent !important;
}

.filter-tab:hover:not(.active) {
  background: rgba(212,175,55,0.15) !important;
  color: #F9E339 !important;
}

/* Disabled state */
.hierarchy-explore-arrow:disabled,
.nav-arrow:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  filter: none !important;
  transform: none !important;
}

/* ═══ ZOOM BUTTONS — always visible, vertically centered on right/left ═══ */
.iframe-zoom-controls {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.iframe-zoom-controls.rtl {
  right: auto;
  left: 20px;
}

.zoom-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 0 15px 0 15px;
  background: linear-gradient(90deg, #D4AF37, #F9E339);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(212,175,55,0.35);
  line-height: 1;
}

.zoom-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(212,175,55,0.55);
}

.zoom-btn:active {
  transform: scale(0.95);
}


/* When map is fullscreen (page-fullscreen class), keep zoom controls fixed */
.map-section.page-fullscreen .iframe-zoom-controls {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 1800;
}

.map-section.page-fullscreen .iframe-zoom-controls.rtl {
  right: auto;
  left: 20px;
}

@media (max-width: 600px) {
  .iframe-zoom-controls {
    top: 10px;
    right: 10px;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    transform: none;
  }

  .iframe-zoom-controls.rtl {
    right: auto;
    left: 10px;
  }

  .zoom-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

}
/* ═══ EMBED FULLSCREEN — make toggleMapFullscreen work in iframe ═══ */
/* When page-fullscreen is active, fix the map to viewport */
.map-section.page-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1500 !important;
  flex: none !important;
}

/* Sidebar inside fullscreen */
.main.map-fullscreen-active .info-panel {
  position: fixed !important;
  z-index: 1700 !important;
  top: 16px !important;
  bottom: 16px !important;
  max-height: calc(100vh - 32px) !important;
}
