/* ==========================================================================
   IMAR.CSS - MODERN GLASS UI (Preserving Legacy Layouts)
   ========================================================================== */

/* --- 1. CORE VARIABLES & RESET --- */
:root {
  --lg-bg-color: rgba(255, 255, 255, 0.25);
  --lg-highlight: rgba(255, 255, 255, 0.75);
  --lg-text: #ffffff;
  --lg-red: #fb4268;
  --lg-grey: #444739;
  --primary-color: #233c7c;
  --hover-color: #162a59;
}

body {
  background-image: url("../images/imar-bg-2.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  height: 100vh;
  overflow: hidden; /* Prevent body scroll, handle inside containers */
  margin: 0;
}

/* Glass Container Wrapper */
.query-wrapper {
  position: relative;
  background: transparent !important;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 6px 6px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(0, 0, 0, 0.1);
  margin: 20px auto 20px auto;
  width: 1130px;
  max-width: 75%;
  /* padding-bottom: 20px; */
}

/* Glass Layers */
.glass-filter,
.glass-overlay,
.glass-specular {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.glass-filter {
  z-index: -1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
}

.glass-overlay {
  z-index: -1;
  background: var(--lg-bg-color);
  opacity: 0.6;
}

/* --- EXISTING ELEMENTS STYLING --- */

/* Navbar - Legacy overrides (Will be replaced by .header structure, but keeping just in case) */
.navbar {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* --- HEADER (Matched to index.aspx / style-3.0.css) --- */
.header {
  height: 116px;
  display: flex;
  align-items: center;
  padding: 0 25px;
  background: rgb(246 246 245);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;

  /* Flex item properties */
  flex: 0 0 auto; /* Don't shrink or grow */
  z-index: 1050;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Logo */
.header img {
  height: 50px;
  width: auto; /* Ensure aspect ratio */
  margin-right: 15px;
}

.company-logo {
  display: flex;
  align-items: center;
}

/* Ana başlık */
.header-text {
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--primary-color);
}

/* Alt birim yazısı */
.header-unit {
  font-size: 16px;
  opacity: 0.9;
  font-weight: 200;
  color: #444; /* Darker grey */
}

/* Menu positioning in new header */
.header-menu-container {
  margin-left: auto; /* Push to right */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.header-social-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 5px;
}

.navbar-nav {
  float: none !important; /* Override bootstrap */
  margin: 0 !important;
  display: flex;
  flex-direction: row;
}

.header-menu-container .nav > li > a {
  color: var(--primary-color) !important;
  font-weight: 400;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 15px; /* Slightly smaller for compactness */
}
.header-menu-container .nav > li > a:hover {
  background-color: var(--primary-color) !important;
  color: white !important;
}

/* Body Container (Flex Wrapper) */
.zoning-body {
  padding: 20px;
  background: transparent !important;
  height: 98vh;
  display: flex; /* Flex layout */
  flex-direction: column; /* Stack header and content */
  overflow: hidden; /* No scroll on container itself */
  box-sizing: border-box;
  position: relative; /* Context for watermark */
}

/* Scrollable Content Container */
#contextcontainer {
  flex: 1 1 auto; /* Grow to fill space */
  overflow-y: auto; /* Scroll internally */
  overflow-x: hidden; /* Scroll internally */
  padding: 10px; /* 10px padding on all sides (includes left/right as requested) */
  position: relative;
  border-radius: 12px;
  gap: 10px;
  flex-direction: column;
  display: flex;
  box-sizing: border-box; /* Ensure padding doesn't affect width causing scrollbar issues */
  /* Default background when NO watermark */
  background: linear-gradient(
    rgba(255, 255, 255, 0.75),
    rgba(255, 255, 255, 0.75)
  );
}

/* When watermark is present */
#contextcontainer.watermarked {
  /* Background handled by watermark logic (map image or other) - usually cleared or specific */
  background: none;
}

/* Map Container - RESTORED ORIGINAL BACKGROUND (White/Opaque) */
.map-container {
  background: #fff !important; /* User requested "eski hali ile kalsın" - usually white */
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0;
  position: relative;
  z-index: 20; /* Ensure map is above watermark */
  width: 100% !important; /* Fit to container width */
  box-sizing: border-box; /* Include border in width */
  overflow: hidden; /* Clip map to border-radius */
  /* margin-bottom: 10px; */
}

/* Ensure MapLibre canvas fills entire map div */
#map .maplibregl-canvas-container,
#map .maplibregl-canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Popover (fonksiyon bilgileri) - wider and better spacing */
.popover {
  max-width: 350px !important;
  min-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
}

.popover-content {
  /* padding: 12px 16px; */
  padding: 0 !important;
  font-size: 13px;
}

.popover-content table {
  width: 100%;
}

.popover-content table td,
.popover-content table th {
  padding: 4px 8px;
  vertical-align: middle;
}

.popover-content table td:first-child {
  min-width: 40% !important;
  max-width: 40% !important;
}

.map-container-box {
  border: 2px solid #989898;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 5px;
}

/* Description Text */
.text-wrap {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: black;
  font-size: 10px; /* Reduced to 9px as requested */
  border-radius: 8px;
  padding: 15px;
  /* margin-bottom: 10px; */
}

/* --- TABLE STRUCTURE (MODERNIZED FLEX) --- */

.divTableParentRow {
  display: flex !important;
}

/* The Table Container */
.divTable {
  display: flex;
  flex-direction: column;
  width: 100% !important;
  height: auto;
  border-collapse: unset;
  border-spacing: 0;
  background: transparent !important; /* No container background */
  border-radius: 0;
  box-shadow: none;
  border: none;
  gap: 2px; /* Tiny gap between rows as requested */
}

.divTableBody {
  display: flex;
  flex-direction: column;
  gap: 4px; /* Space between rows */
}

/* The Row */
.divTableRow {
  display: flex; /* Flex Layout */
  width: 100%;
  /* Default background (No Watermark) -> Opaque White */
  background-color: rgba(255, 255, 255, 1);
  /* border-radius: 8px; Rounded row */
  overflow: visible; /* Allow content to dictate height */
  min-height: 40px; /* Minimum height for consistency */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* Subtle shadow per row */
  border: 1px solid rgba(35, 60, 124, 0.2); /* Lighter version of #233c7c */
}

/* Row background when Watermark is present */
#contextcontainer.watermarked .divTableRow {
  background-color: rgba(255, 255, 255, 0.7);
}

/* ... skipped hover ... */

/* Header/Footer Handling (Hide or Adapt) */
.divTableHeading,
.divTableFoot {
  display: none; /* Usually not used effectively in this specific output, or treat as row */
}

.divTableNoneRow {
  height: 10px;
}

.divTableContent {
  background-color: transparent;
  border: none;
}

.emptyrow-content {
  background: rgba(35, 60, 124, 0.05) !important;
  text-align: center;
  font-weight: bold;
  padding: 6px;
}

/* CELLS */
#htmlOutput td,
.divTableCell,
.divTableHead {
  border: none !important;
  display: flex; /* Flex cell */
  align-items: center; /* Vertical Center */
  padding: 8px 16px !important;
  font-size: 14px !important;
  /* color: #374151 !important; */
  color: black !important;
  flex: 1; /* Value takes remaining space */
  flex-wrap: wrap; /* Fix for buttons: Allow wrapping */
  gap: 5px; /* Spacing for wrapped buttons */

  /* Text Wrapping Support */
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: break-word;
  height: auto !important;
}

/* LABEL CELL */
.divTableCellLabel,
#htmlOutput td:first-child {
  background: rgba(
    35,
    60,
    124,
    0.05
  ) !important; /* Very light tint of #233c7c */
  font-weight: 500 !important;
  min-width: 35%; /* Fixed width */
  max-width: 35%;
  color: #414245 !important; /* User specified color */
  border-right: 1px solid rgba(35, 60, 124, 0.15) !important; /* Soft divider */
  justify-content: flex-start; /* Align text left */
  display: flex;
  align-items: center;

  /* Text Wrapping Support for Label */
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: break-word;
  height: auto !important;
}

/* Remove old specific border class if present or repurpose */
.divTableCellBorder {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 5px;
  box-shadow: none;
}

/* --- BUTTONS & CONTROLS --- */
/* Scale/Zoom Buttons common style */
.scale-button {
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  margin: 2px;
  cursor: pointer;
  color: #333;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 14px;
}

.fonksiyonalani,
.nonefonksiyonalani {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 50px;
  text-decoration: none !important;
  color: #fff !important;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  margin: 4px;
  border: none;
  cursor: pointer;
}

.fonksiyonalani {
  background: linear-gradient(135deg, #1a73e8, #0054c1);
}

.nonefonksiyonalani {
  background: linear-gradient(135deg, #92b919, #6a8a12);
}

.fonksiyonalani:hover,
.nonefonksiyonalani:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
}

/* --- MODERN MAP BUTTONS --- */
.map-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 50px;
  text-decoration: none !important;
  color: #fff !important;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  margin: 4px;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.map-link-btn i {
  margin-right: 8px;
  font-size: 14px;
}

.map-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
}

.map-link-btn:active {
  transform: translateY(0);
}

/* Gradient Variants */
.btn-google {
  background: linear-gradient(135deg, #4285f4, #34a853);
}
.btn-yandex {
  background: linear-gradient(135deg, #ff8f00, #c67100);
}
.btn-osm {
  background: linear-gradient(135deg, #7ebc6f, #008744);
}
.btn-tkgm {
  background: linear-gradient(135deg, #005c97, #363795);
}
.btn-generic-map {
  background: linear-gradient(135deg, #233c7c, #4a90e2);
}
.btn-kapi-list {
  background: linear-gradient(135deg, #00b3b5, #007677);
}

/* --- MAP CONTROLS POSITIONS & STYLING (MODERNIZED) --- */

/* Coordinate: Bottom-Right */
.coordinate {
  position: absolute;
  bottom: 0px; /* Aligned to bottom edge */
  right: 0px; /* Aligned to right edge */
  z-index: 100;
  background: rgba(255, 255, 255, 0.9); /* More opaque for visibility */
  /* padding: 4px 8px; */
  border-top-left-radius: 6px; /* Rounded inner corner */
  font-size: 11px;
  font-weight: bold;
  color: #333;
  pointer-events: none;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}

/* North Arrow: Bottom-Right (Above Coordinates) */
#northArrow {
  bottom: 30px !important; /* Stacked above coordinate strip */
  right: 10px !important;
  width: 40px !important;
  z-index: 95 !important;
  /* Add visibility circle */
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ZoomBar (Magnifier): Hidden by default */
#ZoomBar,
.zoombar {
  display: none !important;
}

/* Scale (Zoom Buttons): Top-Right */
.scale {
  position: absolute;
  right: 10px;
  top: 10px; /* Slight offset from edge */
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 100;
  width: auto;
  background: transparent;
  box-shadow: none;
}

.scale .container-fluid,
.scale .row {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  /* gap: 8px; Space between In/Out buttons */
}

.scale .scale-button {
  width: 36px !important;
  height: 36px !important;
  background-color: #fff;
  border-radius: 6px;
  /* Stronger shadow for lift */
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #333;
  transition: all 0.2s ease;
  flex: none !important;
  margin: 0 !important;
  /* Dark border for contrast against white map */
  border: 1px solid #999;
}

.scale .scale-button:hover {
  background-color: #f8f9fa;
  border-color: #666;
  transform: translateY(-1px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.35);
}

/* Navigation (Layers): Bottom-Left */
.navigation {
  position: absolute;
  left: 10px;
  bottom: 15px; /* Offset to not touch edge */
  background-color: transparent;
  padding: 0;
  margin: 0;
  width: auto;
  box-shadow: none;
  z-index: 100;
}

.navigation .container-fluid,
.navigation .row {
  padding: 0;
  margin: 0;
  display: flex;
  /* gap: 8px;  */
  /* Horizontal gap between Plan/Uydu */
}

.navigation-button-plan,
.navigation-button-uydu {
  width: 40px;
  height: 40px;
  background-color: #fff;
  border-radius: 6px;
  /* Stronger shadow */
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover; /* Ensure image fits */
  /* background-size: 100% 100%; */ /* fotoların bulanık olmadığı versiyon */
  transition:
    transform 0.1s,
    border-color 0.2s;
  /* Dark border for contrast */
  border: 2px solid #ccc;
}

.navigation-button-plan:hover,
.navigation-button-uydu:hover {
  border-color: #666;
  transform: translateY(-1px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.35);
}
.navigation-button-plan {
  background-image: url("../images/plan_1.jpg");
}
.navigation-button-uydu {
  background-image: url("../images/uydu_1.jpg");
}

.navigation-button-plan:active,
.navigation-button-uydu:active {
  transform: scale(0.95);
}

/* --- WATERMARK --- */
/* .watermarked-div {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.1;
    top: 0;
    left: 0;
}
.active-watermark {
    z-index: 9999;
} */

/* Watermarked div */
/* Context Container for Watermark */
.context-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Watermark applied directly to Scroll Container */
#contextcontainer.watermarked {
  position: relative;
  /* Simulating opacity 0.25 using white overlay (0.75 alpha) */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)),
    url("../images/do-not-copy-160137_1280-3.png");
  background-repeat: repeat;
  background-size: 250px 250px;
  background-position: left top;
  background-attachment: local; /* Critical: Background scrolls with content */
}

/* Cleanup old styles */
/* .watermarked-div { display: none; } */

/* --- FOOTER INFO --- */
#bilgiMetni,
#baskanAdi {
  background: rgba(255, 255, 255, 0.6);
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  /* font-weight: bold; */
  color: black;
  /* margin-top: 10px; */
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Popover styles override */
.popover {
  max-width: 400px !important;
  width: auto;
}

/* Fonksiyon Tablosu (Popup İçeriği) */
.fonksiyontable {
  width: 100% !important;
  display: table !important; /* Force table behavior */
  border-collapse: separate; /* Allow border-radius/spacing */
  border-spacing: 0 2px; /* Slight gap between rows */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  /* border: 1px solid rgba(35, 60, 124, 0.2); */
  border-radius: 4px; /* Optional for better look with border */
  padding: 5px;
}

.fonksiyontable tr {
  display: table-row !important; /* Force row behavior */
}

.fonksiyontable-label {
  font-weight: bold;
  text-align: left;
  font-size: 12px;
  color: #0c6587;
  white-space: nowrap; /* Prevent wrapping */
  width: 40%; /* Give distinct width */
}

.fonksiyontable-value {
  text-align: left;
  font-size: 12px;
  color: #0c6587;
  white-space: nowrap; /* Prevent wrapping */
}

.fonksiyontable > tbody > tr > th,
.fonksiyontable > tbody > tr > td {
  padding: 5px;
  border: none !important; /* Override global td style */
  border-top: 1px solid #e9e8e8 !important;
  background: transparent !important; /* Ensure no conflicting bg */
  white-space: nowrap; /* Ensure single line */
  display: table-cell !important; /* Force cell behavior (fixes stacking) */
  vertical-align: middle;
}

.download-button {
  width: 21px;
  height: 21px;
  background-image: url("../images/download-flat.png");
  cursor: pointer;
}

.download-button:hover {
  width: 21px;
  height: 21px;
  background-image: url("../images/download-flat-hover.png");
  cursor: pointer;
}

/* Scrollbar */
/* ::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); }
::-webkit-scrollbar-thumb { background: rgba(35, 60, 124, 0.5); border-radius: 4px; } */

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 0px;
}
/* ::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 3px;
} */

/* ==========================================================================
   MOBILE RESPONSIVENESS (Max-width: 768px)
   ========================================================================== */
@media (max-width: 930px) {
  /* 1. Container Adjustments */
  .query-wrapper {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    height: 100vh; /* Full height on mobile */
    box-shadow: none;
  }

  /* 2. Header Layout - Stacked but Side-by-Side Logo/Text */
  .header {
    height: auto;
    /* flex-direction: column; */ /* Changed to row wrap for side-by-side */
    flex-direction: row;
    flex-wrap: wrap;
    padding: 5px 10px;
    gap: 10px;
    text-align: center;
    align-items: center;
    justify-content: center; /* Center the logo/text group */
  }

  .company-logo {
    justify-content: flex-end; /* Push logo to right of its half? No, just flow naturally */
    margin-bottom: 0;
    flex: 0 0 auto;
    order: 1;
  }

  .header-titles {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align text left next to logo */
    width: auto;
    margin-bottom: 0;
    flex: 1 1 auto;
    order: 2;
    padding-left: 10px;
  }

  .header-menu-container {
    width: 100%;
    align-items: center;
    margin-left: 0;
    margin-top: 5px;
    order: 3; /* Force to bottom */
  }

  .header-text {
    font-size: 18px; /* Smaller font */
    line-height: 1.1;
  }

  .header-unit {
    font-size: 13px;
    /* display: none; */ /* Keep visible but small */
  }

  /* 3. Menu as Tabs (Sekme Yapısı) */
  .header-menu-container {
    width: 100%;
    align-items: center;
    margin-left: 0;
    margin-top: 5px;
  }

  .header-social-row {
    justify-content: center;
    margin-bottom: 8px;
    /* Optional: Hide on very small screens if cluttered */
  }

  .navbar-nav {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 5px;
    justify-content: space-between;
    padding: 0;
    margin: 0;
  }

  .navbar-nav > li {
    flex: 1; /* Equal width tabs */
    min-width: 70px; /* Minimum touch target width */
    list-style: none; /* Ensure no bullets */
  }

  .navbar-nav > li > a {
    padding: 8px 4px !important;
    font-size: 11px !important;
    text-align: center;
    background: rgba(255, 255, 255, 0.4) !important;
    border-radius: 6px;
    white-space: nowrap;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0 !important;
  }

  .navbar-nav > li > a:hover,
  .navbar-nav > li > a:focus {
    background: white !important;
    color: var(--primary-color) !important;
    font-weight: bold;
  }

  /* 4. Body Content */
  .zoning-body {
    padding: 10px;
    height: 100vh; /* Ensure full usage */
  }

  /* 5. Footer & Text */
  .text-wrap {
    padding: 10px;
    font-size: 9px; /* Readable on mobile */

    /* ACCORDION LOGIC */
    max-height: 50px; /* Show approx 3 lines */
    overflow: hidden;
    cursor: pointer;
    transition: max-height 0.4s ease-in-out;
    position: relative;
    /* Optional: Fade effect to indicate more text */
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  }

  .text-wrap.expanded {
    max-height: -webkit-fill-available;
    mask-image: none;
    -webkit-mask-image: none;
  }

  /* Indicator arrow */
  .text-wrap::after {
    content: "▼";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: var(--primary-color);
    opacity: 1;
  }

  .text-wrap.expanded::after {
    content: "▲";
    opacity: 0.3;
  }

  .no-break-full {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .no-break-full .col-md-6 {
    width: 100%;
    padding: 0;
  }

  #bilgiMetni,
  #baskanAdi {
    font-size: 10px;
    text-align: center !important; /* Center align footer info on mobile */
    margin-top: 5px !important;
  }

  /* HTML Output Mobile Responsiveness */
  /* HTML Output Mobile Responsiveness - Horizontal Layout (Side-by-Side) */
  #htmlOutput .divTableRow {
    flex-direction: row !important; /* Keep side-by-side */
    flex-wrap: wrap; /* Allow wrapping if absolutely needed, but try to keep row */
    height: auto;
  }

  #htmlOutput .divTableCellLabel,
  #htmlOutput td:first-child {
    width: 35% !important; /* Fixed width for label */
    max-width: 35% !important;
    min-width: 35% !important;
    border-right: 1px solid rgba(35, 60, 124, 0.15) !important; /* Restore separator */
    border-bottom: none !important;
    background: rgba(35, 60, 124, 0.05) !important; /* Restore header bg */
    padding: 6px 5px !important;
    white-space: normal !important;
    word-break: break-word;
    height: auto !important;
    display: flex;
    align-items: center;
  }

  #htmlOutput .divTableCell,
  #htmlOutput td {
    width: 65% !important; /* Remaining width */
    max-width: 65% !important;
    padding: 6px 5px !important;
    height: auto !important;
    white-space: normal !important;
    word-break: break-word; /* Prevent overflow */
    overflow: visible !important;
  }

  /* Map Controls Adjustments for Mobile */
  .scale {
    bottom: 30px; /* Move up slightly to avoid overlap with footer info if needed */
  }

  /* .coordinate {
    bottom: 35px;
    right: 10px;
    font-size: 10px;
  } */

  /* Restore ZoomBar on Mobile */
  #ZoomBar {
    display: flex !important;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 35px;
    left: 10px;
    z-index: 100;
    /* Match other controls */
    background: white;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    /* Stronger shadow & Border */
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.3),
      0 1px 3px rgba(0, 0, 0, 0.2);
    /* border: 1px solid #999; */
    padding: 0;
  }

  #ZoomBar a {
    color: #333;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
  }

  #ZoomBar .glyphicon {
    font-size: 16px;
    top: 0; /* accurate centering */
  }

  /* Hide Drawing/Measure Tools on Mobile (Generic classes usually used) */
  .maplibregl-ctrl-measure,
  .mapboxgl-ctrl-measure,
  .ml-measures-control {
    display: none !important;
  }

  /* Reduce Watermark Size */
  .watermarked-div.active {
    background-size: 150px 150px;
  }

  /* Popover Mobile Fix - Vertically Anchored, Horizontally Centered */
  .popover {
    position: absolute !important;

    /* Force Horizontal Center relative to viewport/body */
    left: 2.5vw !important;
    width: 85vw !important;
    max-width: 85vw !important;

    /* Allow Bootstrap to calculate Vertical (Top) */
    /* top: inherit; -- Do not override top */

    /* Reset margins/transforms */
    margin: 5px 0 !important;
    transform: none !important;

    z-index: 1060 !important;
  }

  /* Hide arrow on mobile as it won't align correctly */
  .popover > .arrow {
    display: none !important;
  }
}

/* ==========================================================================
   INTERMEDIATE RESPONSIVENESS (769px - 1200px)
   ========================================================================== */
@media (min-width: 930px) and (max-width: 1500px) {
  .header {
    padding: 0 15px;
  }
  .header img {
    height: 45px; /* Slight reduction for intermediate */
    min-width: 45px;
    margin-right: 10px;
  }
  .header-text {
    font-size: 24px;
  }
  .header-unit {
    font-size: 16px;
  }
  .navbar-nav > li > a {
    padding: 8px 8px;
    font-size: 12px;
  }
}

/* Skeleton Loader */
#map-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000; /* Higher than controls (usually 100-1000) */
  background: linear-gradient(90deg, #e3e3e3 0%, #f5f5f5 50%, #e3e3e3 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.3s infinite;
  display: block;
  border-radius: 8px; /* Match map border radius */
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/*
.pdf-mode .divTableRow:has(.no-print),
.pdf-mode .divTableBody:has(.no-print),
.pdf-mode .divTable:has(.no-print) {
  display: none !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
} */

/* Global rule to hide print map on screen (overridden by .pdf-mode) */
/* .print-only-map {
  display: none !important;
} */

/* ==========================================================================
   PDF MODE (Clean Layout for Export)
   ========================================================================== */
/* .pdf-mode .planfonksiyonseperator {
  visibility: visible;
} */

/* PDF Layout Adjustments */
.pdf-mode .query-wrapper {
  padding: 0px;
  position: relative;
  width: 1200px !important;
  min-width: 1200px !important;
  max-width: none !important;
  background: white !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.pdf-mode .text-wrap {
  margin: 0px 0px 15px 0px;
  font-size: 14px !important;
  /* background: white !important; */
  border: 1px solid #ddd !important;
}

.pdf-mode .row {
  margin: 0 !important;
  width: 100% !important;
}

.pdf-mode .col-md-12 {
  width: 100% !important;
  padding: 0 !important;
  float: none !important;
}

.pdf-mode .col-md-6,
.pdf-mode .col-sm-6 {
  width: 50% !important;
  float: left !important;
  padding: 0 !important; /* Small padding for gutter */
  margin: 0 !important;
}

.pdf-mode .zoning-body {
  margin-top: 20px;
  height: auto !important;
  display: block !important;
  overflow: visible !important;
}

.pdf-mode .map-container {
  height: auto !important; /* Fit to content, no extra space */
  width: 100% !important; /* Ensure it fills the 1200px wrapper */
  margin-bottom: 5px !important;
}

.pdf-mode .navbar-brand {
  height: 100px;
}

.pdf-mode .img-responsive {
  margin: 0px;
  min-height: 100px;
  height: 100px;
}

.pdf-mode .company-title {
  font-size: 35px;
}

.pdf-mode .company-subtitle {
  font-size: 15px;
}

.pdf-mode a[href]:after {
  content: none !important;
}

.pdf-mode .navbar {
  display: block !important;
  position: relative !important;
}

.pdf-mode body {
  font-size: 14px !important;
  background: white !important;
  height: auto !important;
  overflow: visible !important;
}

/* Hide PDF Download on Mobile */
@media screen and (max-width: 768px) {
  #download-button,
  .download-button {
    display: none !important;
  }

  /* Resize Map Buttons on Mobile */
  #northArrow {
    width: 30px !important;
  }

  .scale .scale-button {
    width: 28px !important;
    height: 28px !important;
  }

  .scale .scale-button .glyphicon {
    font-size: 10px !important; /* Smaller icons */
  }

  .navigation-button-plan,
  .navigation-button-uydu {
    width: 32px !important;
    height: 32px !important;
  }

  .zoombar {
    width: 28px !important;
    height: 28px !important;
    right: 5px !important; /* Closer to edge */
  }

  .navigation {
    left: 5px !important;
    bottom: 5px !important;
  }

  /* Hide Hint Bubble on Mobile */
  .map-hint-bubble {
    display: none !important;
  }
}

/* Animated Hint Bubble */
.map-hint-bubble {
  position: absolute;
  /* Position relative to the row */
  bottom: 100%;
  left: 50%;
  margin-bottom: 5px; /* Spacing above row */
  background: rgba(35, 60, 124, 0.9); /* Primary color */
  color: #fff;
  padding: 8px 12px; /* Slightly smaller padding */
  border-radius: 8px;
  font-size: 12px; /* Slightly smaller font */
  font-weight: bold;
  z-index: 9999;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none; /* Let clicks pass through */
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  transform: translateY(10px) translateX(-50%); /* Start slightly lower */
  max-width: 250px;
  text-align: center;
  white-space: normal;
}

.map-hint-bubble.visible {
  opacity: 1;
  transform: translateY(0) translateX(-50%);
  /* animation: bounce 2s infinite; - Removed bounce for cleaner hover effect */
}

.map-hint-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px; /* Arrow at bottom */
  left: 50%; /* Centered */
  transform: translateX(-50%);
  border-width: 6px 6px 0; /* Pointing down */
  border-style: solid;
  border-color: rgba(35, 60, 124, 0.9) transparent transparent transparent;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* .pdf-mode .product-owner {
  display: none;
} */

/* Hide controls in PDF mode */
.pdf-mode #ZoomBar,
.pdf-mode .zoombar,
.pdf-mode .scale,
.pdf-mode .navigation,
.pdf-mode #map-skeleton,
.pdf-mode .glass-overlay,
.pdf-mode .maplibregl-control-container,
.pdf-mode .header-menu-container,
.pdf-mode #eimarmenu,
.pdf-mode #multiplePlanHint,
.pdf-mode #share {
  display: none !important;
}

/* Show static map image in PDF mode */
.pdf-mode .print-only-map {
  /* display: block !important; */
  max-height: 100% !important;
}

/* User Requested Print Styles for PDF Mode */
/* User Requested Print Styles for PDF Mode */
/* .pdf-mode .no-print,
.pdf-mode .no-print * {
  display: none !important;
} */

.pdf-mode #watermarkOverlay {
  display: block !important;
  opacity: 0.1 !important;
}

.pdf-mode #contextcontainer.watermarked {
  background-image: url("../images/do-not-copy-160137_1280-3.png") !important;
  background-repeat: repeat !important;
  background-size: 750px 750px !important;
  position: relative !important;
}

.pdf-mode .print-hidden-row {
  display: none !important;
}

.pdf-mode .no-break {
  page-break-inside: avoid !important;
}

.pdf-mode .no-break-full {
  /* page-break-before: avoid !important; */
  page-break-after: avoid !important;
  page-break-inside: avoid !important;
}

/* Custom Context Menu */
#map-context-menu {
  position: absolute;
  z-index: 9999;
  background: white;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  display: none;
  min-width: 150px;
  border-radius: 4px;
  padding: 5px 0;
}

#map-context-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#map-context-menu li {
  padding: 8px 15px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

#map-context-menu li:hover {
  background-color: #f5f5f5;
  color: #000;
}

#map-context-menu li i {
  width: 16px;
  text-align: center;
}

#map-context-menu .divider {
  height: 1px;
  background-color: #eee;
  margin: 4px 0;
  padding: 0;
}
/* ==========================================================================
   LOADING INDICATOR STYLES
   ========================================================================== */
#lblLoading {
  background: rgba(255, 255, 255, 0.6); /* Semi-transparent overlay */
  backdrop-filter: blur(2px); /* Blur effect behind */
  z-index: 1000;
  display: flex !important; /* Force flex to center */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: transparent;
  border-radius: 8px;
}

/* Hide when inline style sets display: none */
#lblLoading[style*="display: none"] {
  display: none !important;
}

#lblLoading > div {
  background: white;
  padding: 20px 40px !important;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  min-width: 200px;
}

#loadingText {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0;
}

#imgLoading {
  width: 40px; /* Adjust spinner size */
  height: auto;
}

/* ==========================================================================
   POPOVER TABLE STYLING OVERRIDES
   ========================================================================== */
.popover-content table,
.popover-content .divTable {
  width: auto !important;
  display: table !important; /* Revert flex if needed */
}

/* Specific override for popover cells to disable aggressive wrapping */
.popover-content td,
.popover-content th,
.popover-content .divTableCell,
.popover-content .divTableCellLabel {
  white-space: normal !important; /* Allow normal wrapping */
  word-break: normal !important; /* Default word break */
  overflow-wrap: normal !important; /* Default overflow wrap */

  /* Reduced font size as requested */
  font-size: 11px !important;
  padding: 4px 6px !important;

  height: auto !important;
  display: table-cell !important; /* Revert flex cell if needed */
  vertical-align: middle !important;
  background: white !important; /* Ensure readable background in popover */
}

.popover-content .divTableRow {
  display: table-row !important;
  background: transparent !important;
  border: none !important;
}

.popover-content .divTableBody {
  display: table-row-group !important;
}

/* === ACCESSIBILITY (WCAG 2.2) === */

/* Screen reader only - visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Becomes visible on focus (skip navigation) */
.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  width: auto;
  height: auto;
  padding: 12px 24px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--primary-color);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Focus indicator improvement */
:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Reset heading styles to match existing design */
h1.header-text {
  all: unset;
  display: block;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

/* Download button as <button> - reset styles */
button.download-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Scale/nav buttons converted from div to button - reset */
button.scale-button,
button.navigation-button-plan,
button.navigation-button-uydu {
  border: none;
  padding: 0;
}

a {
  /*color: #3498db;*/
  text-decoration: none;
}

a:focus,
a:hover {
  text-decoration: none;
  /*color: #5dade2;*/
}
h5 {
  font-weight: bold;
  margin-top: 25px;
  margin-bottom: 15px;
}

/* ==========================================================================
   PRINT OVERRIDES (same file = guaranteed cascade, no cross-file specificity issues)
   ========================================================================== */
@media print {
  /* Compact table rows */
  .divTableRow {
    min-height: 0 !important;
    height: auto !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .divTableBody {
    gap: 0 !important;
  }

  .divTable {
    gap: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Compact cells: override the high-specificity #htmlOutput td rule */
  #htmlOutput td,
  #htmlOutput .divTableCell,
  #htmlOutput .divTableCellLabel,
  #htmlOutput .divTableContent {
    padding: 1px 3px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    min-height: 0 !important;
    height: auto !important;
    box-shadow: none !important;
  }

  /* Label column width stays proportional */
  #htmlOutput .divTableCellLabel {
    min-width: 35% !important;
    max-width: 35% !important;
  }

  /* Bootstrap 3 grid: col-md-* float'ları @media (min-width:992px) içinde —
     print modunda bu breakpoint eşleşmediği için sütunlar alt alta geliyor.
     Burada medya sorgusu olmadan açıkça zorluyoruz. */
  .col-md-12 { float: left !important; width: 100%    !important; box-sizing: border-box !important; padding: 0 !important; }
  .col-md-6  { float: left !important; width: 50%     !important; box-sizing: border-box !important; padding: 0 !important; }
  .col-md-4  { float: left !important; width: 33.333% !important; box-sizing: border-box !important; padding: 0 !important; }
  .col-md-3  { float: left !important; width: 25%     !important; box-sizing: border-box !important; padding: 0 !important; }

  /* Clearfix */
  .row::after { content: "" !important; display: table !important; clear: both !important; }

  /* bilgiMetni ve baskanAdi yan yana: rowBilgiBaskan'ı flex row yap.
     #contextcontainer flex container → .row içindeki col-md-6 float'tan etkilenmez;
     rowBilgiBaskan'ı da flex container yapmak tek güvenilir yol. */
  #rowBilgiBaskan {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
  }

  #colBilgiMetni,
  #colBaskanAdi {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    float: none !important;
    display: block !important;
  }

  /* Wrapper padding sıfırla: header ile içerik hizalansın */
  #bodycontainer,
  #contextcontainer {
    padding: 0 !important;
    margin: 0 !important;
  }

  .query-wrapper,
  #div_page {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* Boş satır spacer'larını ve bölüm ayraç çizgilerini gizle */
  .divTableNoneRow {
    display: none !important;
    height: 0 !important;
  }

  .divTableCellBorder {
    border-bottom: none !important;
    margin-bottom: 0 !important;
  }

  /* Hide mobile expand arrow */
  .text-wrap::after,
  .text-wrap.expanded::after {
    display: none !important;
    content: none !important;
  }

  /* Netcad logo smaller in print */
  .product-owner img {
    height: 18px !important;
  }

  /* Rows tighter */
  .divTableRow {
    margin: 0 !important;
  }
}
