/* ========================================================================= */
/* NAVBAR AND SEARCH STYLES - CONSOLIDATED AND FIXED */
/* تمام استایل‌های ناوبار و جستجو در یک فایل */
/* ========================================================================= */

/* ========= FONT SETUP ========= */
@font-face {
  font-family: Nahid;
  src: url(..//assets/Nahid-FD-WOL.eot);
  src: url(..//assets/Nahid-FD-WOL.eot?#iefix) format('embedded-opentype'),
       url(..//assets/Nahid-FD-WOL.woff) format('woff2'),
       url(..//assets/Nahid-FD-WOL.woff) format('woff'),
       url(..//assets/Nahid-FD-WOL.ttf) format('truetype');
  font-weight: normal;
}

/* ========= GLOBAL STYLES ========= */
* {
  direction: rtl;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
}

html {
  direction: rtl;
  height: 100vh;
  width: 100vw;
  margin: 0 !important;
  padding: 0 !important;
  font-family: "Nahid", Tahoma, 'Arial', sans-serif;
  overflow: hidden;
}

body {
  direction: rtl;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: "Nahid", Tahoma, 'Arial', sans-serif;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
}

/* ========= NAVBAR STYLES - DESKTOP ONLY ========= */
.navbar {
  min-height: 45px !important;
  max-height: 45px !important;
  height: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1040 !important;
  background-color: #222 !important;
  border-bottom: 1px solid #444 !important;
  display: flex !important;
  align-items: center !important;
}

/* گروه برند و لوگو */
.navbar-brand-group {
  display: flex !important;
  align-items: center !important;
  height: 45px !important;
  gap: 0.5rem !important;
  flex-shrink: 0 !important;
  order: -1 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

.navbar-brand {
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  height: 45px !important;
  line-height: 45px !important;
  font-size: 0.9rem !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.navbar-brand .title {
  font-size: 0.85rem !important;
  margin: 0 !important;
  padding: 0 1rem !important;
  text-align: right !important;
  direction: rtl !important;
}

.navbar-logo {
  display: none !important;
}

.navbar-brand img {
  display: none !important;
}

/* لوگو - کنار برند */
.navbar-logo-right {
  height: 28px !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.navbar img:not(.navbar-brand img) {
  height: 28px !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

/* ========= NAVBAR FORM AND SEARCH CONTAINER ========= */
.navbar-search-form {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0 !important;
  margin: 0 auto !important;
  height: 45px !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
  justify-content: center !important;
}

.navbar form[role="search"] {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0 !important;
  margin: 0 auto !important;
  height: 45px !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
  justify-content: center !important;
}

.navbar .container-fluid {
  padding: 0 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  height: 45px !important;
  gap: 0.5rem !important;
  margin: 0 !important;
  justify-content: space-between !important;
}

/* ========= LAYER SELECT STYLES ========= */
#navbar-layer-select {
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  height: 32px !important;
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 1050 !important;
  background: #222 !important;
  border: 1px solid #444 !important;
  color: #fff !important;
  border-radius: 4px 0 0 4px !important;
  border-right: none !important;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif !important;
  direction: rtl !important;
  text-align: right !important;
}

#navbar-layer-select option {
  font-size: 13px !important;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif !important;
  background: #222 !important;
  color: #fff !important;
}

#navbar-layer-select option[disabled] {
  color: #999 !important;
  background: #222 !important;
}

#navbar-layer-select:invalid {
  color: #999 !important;
}

#navbar-layer-select option:checked {
  color: #fff !important;
  background: #222 !important;
}

#navbar-layer-select[value=""] {
  color: #999 !important;
}

#navbar-layer-select:hover {
  border-color: #66afe9 !important;
  background: #333 !important;
  box-shadow: 0 0 8px rgba(102, 175, 233, 0.6) !important;
}

#navbar-layer-select:focus {
  outline: none !important;
  border-color: #66afe9 !important;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6) !important;
  background: #333 !important;
}

/* ========= SEARCH CONTAINER STYLES ========= */
#navbar-search-container {
  min-width: 150px !important;
  flex: 0 1 200px !important;
  max-width: 200px !important;
  height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  z-index: 1050 !important;
  display: flex !important;
  align-items: center !important;
}

.navbar-search-container {
  display: flex !important;
  align-items: center !important;
  background: transparent !important;
  gap: 0 !important;
  width: 100% !important;
  height: 32px !important;
  position: relative !important;
  z-index: 1050 !important;
}

/* ========= LEAFLET SEARCH CONTROL STYLES ========= */
.leaflet-control-search {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 32px !important;
}

/* حذف کامل آیکون ذره‌بین */
.leaflet-control-search .search-button,
.leaflet-control-search .search-button:hover,
.leaflet-control-search .search-button:focus,
.leaflet-control-search .search-button:active {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Search Input Styles */
.leaflet-control-search .search-input {
  background: #222 !important;
  border: 1px solid #444 !important;
  border-left: none !important;
  border-radius: 0 4px 4px 0 !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  height: 32px !important;
  line-height: 1.42857143 !important;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif !important;
  color: #fff !important;
  box-shadow: 0 0 5px rgba(102, 175, 233, 0.3) !important;
  position: relative !important;
  z-index: 1050 !important;
  direction: rtl !important;
  text-align: right !important;
  margin: 0 !important;
}

.leaflet-control-search .search-input::placeholder {
  color: #aaa !important;
}

.leaflet-control-search .search-input:focus {
  outline: none !important;
  border-color: #66afe9 !important;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6) !important;
  background: #333 !important;
}

/* Search Tooltip/Dropdown Styles */
.leaflet-control-search .search-tooltip {
  max-height: 220px !important;
  max-width: 300px !important;
  min-width: 220px !important;
  overflow-y: auto !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
  font-size: 13px !important;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif !important;
  z-index: 10000 !important;
  position: absolute !important;
  top: 32px !important;
  right: 0 !important;
  left: auto !important;
  overflow-x: visible !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  visibility: visible !important;
}

.leaflet-control-search .search-tooltip .search-tip {
  padding: 6px 8px !important;
  border-bottom: 1px solid #eee !important;
  cursor: pointer !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  overflow: visible !important;
  word-wrap: break-word !important;
  text-align: right !important;
  direction: rtl !important;
  color: #333 !important;
  transition: all 0.2s ease !important;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif !important;
  display: block !important;
  width: 100% !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
}

/* رنگ‌های متناوب برای آیتم‌های سرچ */
.leaflet-control-search .search-tooltip .search-tip:nth-child(odd) {
  background-color: #f9f9f9 !important;
}

.leaflet-control-search .search-tooltip .search-tip:nth-child(even) {
  background-color: #fff !important;
}

.leaflet-control-search .search-tooltip .search-tip:hover {
  background-color: #e3f2fd !important;
  color: #1976d2 !important;
  font-weight: 500 !important;
}

.leaflet-control-search .search-tooltip .search-tip:last-child {
  border-bottom: none !important;
}

/* Scrollbar Styles */
.leaflet-control-search .search-tooltip::-webkit-scrollbar {
  width: 6px !important;
}

.leaflet-control-search .search-tooltip::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
  border-radius: 3px !important;
}

.leaflet-control-search .search-tooltip::-webkit-scrollbar-thumb {
  background: #c1c1c1 !important;
  border-radius: 3px !important;
}

.leaflet-control-search .search-tooltip::-webkit-scrollbar-thumb:hover {
  background: #e36666 !important;
}

/* ========= BOOTSTRAP TOOLTIP STYLES ========= */
.tooltip {
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: 12px !important;
  z-index: 99999 !important;
  pointer-events: none !important;
}

.tooltip-inner {
  max-width: 300px !important;
  padding: 8px 12px !important;
  background-color: rgba(0, 0, 0, 0.9) !important;
  border-radius: 6px !important;
  text-align: right !important;
  direction: rtl !important;
  line-height: 1.4 !important;
}

.tooltip.bs-tooltip-right .arrow::before,
.tooltip.right .arrow::before {
  border-right-color: rgba(0, 0, 0, 0.9) !important;
}

.tooltip.bs-tooltip-left .arrow::before,
.tooltip.left .arrow::before {
  border-left-color: rgba(0, 0, 0, 0.9) !important;
}

.tooltip.bs-tooltip-top .arrow::before,
.tooltip.top .arrow::before {
  border-top-color: rgba(0, 0, 0, 0.9) !important;
}

.tooltip.bs-tooltip-bottom .arrow::before,
.tooltip.bottom .arrow::before {
  border-bottom-color: rgba(0, 0, 0, 0.9) !important;
}

.tooltip.right, .bs-tooltip-end {
  margin-left: 10px !important;
}

/* ========= HIDE MOBILE ELEMENTS ========= */
.navbar-toggler,
.navbar-collapse,
.navbar-expand-lg .navbar-collapse {
  display: none !important;
  visibility: hidden !important;
}

/* ========= FORM ELEMENTS ========= */
.navbar .form-select {
  margin: 0 !important;
  background-position: left 0.5rem center !important;
  padding-right: 1.75rem !important;
}

.d-flex.align-items-center {
  align-items: center !important;
}

/* ========= DESKTOP MEDIA QUERIES ========= */
@media (min-width: 992px) {
  .navbar {
    min-height: 45px !important;
    max-height: 45px !important;
    height: 45px !important;
    padding: 0 !important;
  }
  
  .navbar-brand {
    height: 45px !important;
    line-height: 45px !important;
  }
  
  .navbar form[role="search"] {
    height: 45px !important;
  }

  .navbar-toggler {
    display: none !important;
  }

  .navbar-collapse.collapse,
  .navbar-collapse.show {
    display: flex !important;
    align-items: center !important;
  }
}

@media (min-width: 1025px) {
  .navbar-search-container {
    flex-direction: row !important;
    gap: 15px !important;
  }

  #navbar-layer-select {
    min-width: 160px !important;
  }

  .leaflet-control-search .search-input {
    min-width: 200px !important;
  }

  .navbar-brand {
    font-size: 18px !important;
  }

  .navbar-brand img {
    height: 40px !important;
  }
}

/* ========= UTILITY CLASSES ========= */
.navbar-nav > li.navbar-search-item {
  float: right !important;
}

.navbar-search-item {
  margin: 0 2px !important;
  padding: 0 !important;
}

.navbar-form {
  padding: 0 !important;
  margin: 0 5px !important;
}

.navbar-form .form-control {
  display: inline-block !important;
  width: auto !important;
  vertical-align: middle !important;
}

.time-display {
  background: #222;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 14px;
  color: white;
  margin: 0 10px;
  display: inline-block;
  vertical-align: middle;
  line-height: 20px;
}

/* ========= SURFACE DUO FIX ========= */
@media (min-width: 540px) and (max-width: 720px),
       (min-width: 1114px) and (max-width: 1114px) {
  .navbar {
    border-bottom: none !important;
  }
}

/* ========= PRINT STYLES ========= */
@media print {
  .navbar {
    display: none !important;
  }
}

/* ========================================================================= */
/* NAVBAR RESPONSIVE STYLES - MOBILE, TABLET, LANDSCAPE */
/* تنظیمات responsive برای ناوبار در موبایل، تبلت و حالات مختلف */
/* ========================================================================= */

/* ========= MOBILE PORTRAIT (< 576px) ========= */
@media (max-width: 575.98px) {
  /* ناوبار */
  .navbar {
    min-height: 45px !important;
    max-height: 45px !important;
    height: 45px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .navbar .container-fluid {
    justify-content: space-between !important;
    gap: 0 !important;
  }

  /* برند و لوگو گروپ */
  .navbar-brand-group {
    order: -1 !important;
    flex: 0 0 auto !important;
  }

  .navbar-brand {
    order: 0 !important;
    flex: 0 0 auto !important;
  }

  .navbar-brand .title {
    font-size: 0.75rem !important;
    padding: 0 0.5rem !important;
  }

  .navbar-logo-right {
    order: 0 !important;
    flex: 0 0 auto !important;
    height: 24px !important;
    padding: 0 0.5rem !important;
  }

  /* navbar-collapse برای موبایل */
  .navbar-collapse {
    position: absolute !important;
    top: 45px !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 1rem 1rem 0.5rem 1rem !important;
    margin: 0 !important;
    max-height: calc(100vh - 45px) !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
    z-index: 1030 !important;
    pointer-events: auto !important;
  }

  .navbar-collapse.collapse:not(.show) {
    display: none !important;
  }

  .navbar-collapse.show {
    display: block !important;
    visibility: visible !important;
  }

  /* همبرگری منو */
  .navbar-toggler {
    display: flex !important;
    visibility: visible !important;
    order: 0 !important;
    padding: 0.25rem 0.5rem !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
  }

  .navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
  }

  .navbar-toggler-icon {
    width: 20px !important;
    height: 20px !important;
  }

  /* سرچ و کمبو در منوی موبایل */
  .navbar-collapse .navbar-search-form {
    display: flex !important;
    visibility: visible !important;
    flex-direction: column !important;
    width: 70% !important;
    max-width: 70% !important;
    padding: 0 !important;
    gap: 0.4rem !important;
    margin: 0 auto !important;
  }

  .navbar-collapse #navbar-layer-select {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
  }

  .navbar-collapse #navbar-search-container {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0 !important;
  }

  .navbar-collapse .leaflet-control-search {
    width: 100% !important;
    max-width: 100% !important;
  }

  .navbar-collapse .leaflet-control-search .search-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Search tooltip در موبایل */
  .navbar-collapse .leaflet-control-search .search-tooltip {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    z-index: 10000 !important;
    display: block !important;
    visibility: visible !important;
    margin-top: 2px !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    overflow-y: auto !important;
    max-height: 250px !important;
  }

  .leaflet-control-search .search-tooltip {
    position: absolute !important;
    z-index: 10000 !important;
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .leaflet-control-search .search-tooltip .search-tip {
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }
}

/* ========= SURFACE DUO FIX - Portrait (720px) & Landscape Spanned (1114px) ========= */
@media (min-width: 540px) and (max-width: 720px),
       (min-width: 1114px) and (max-width: 1114px) {
  /* حذف کامل border از navbar */
  .navbar {
    border-bottom: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  /* حذف سایه و border اضافی */
  .navbar::after,
  .navbar::before {
    display: none !important;
    content: none !important;
  }
  
  /* اطمینان از شفافیت کامل collapse */
  .navbar-collapse {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  /* حذف border از container */
  .navbar .container-fluid {
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }
  
  /* حذف هر گونه خط سیاه از المنت‌های داخلی */
  .navbar *,
  .navbar-collapse *,
  .navbar-brand-group *,
  .navbar-search-form * {
    border-bottom: none !important;
  }
  
  /* حذف background که ممکن است به صورت خط نمایش داده شود */
  .navbar-collapse.show::before,
  .navbar-collapse.show::after {
    display: none !important;
  }
}

/* تنظیمات خاص برای Surface Duo Portrait */
@media (min-width: 540px) and (max-width: 720px) {
  .navbar-collapse .navbar-search-form {
    width: 75% !important;
    max-width: 75% !important;
  }
}

/* ========= MOBILE LANDSCAPE (576px - 767px) ========= */
@media (min-width: 576px) and (max-width: 767.98px) {
  .navbar {
    min-height: 45px !important;
    max-height: 45px !important;
    height: 45px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .navbar .container-fluid {
    justify-content: space-between !important;
    gap: 0 !important;
  }

  /* برند و لوگو گروپ */
  .navbar-brand-group {
    order: -1 !important;
    flex: 0 0 auto !important;
  }

  .navbar-brand {
    order: 0 !important;
    flex: 0 0 auto !important;
  }

  .navbar-brand .title {
    font-size: 0.75rem !important;
    padding: 0 0.5rem !important;
  }

  .navbar-logo-right {
    order: 0 !important;
    flex: 0 0 auto !important;
    height: 24px !important;
    padding: 0 0.5rem !important;
  }

  /* navbar-collapse برای موبایل landscape */
  .navbar-collapse {
    position: absolute !important;
    top: 45px !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 1rem 1.5rem 0.5rem 1.5rem !important;
    margin: 0 !important;
    max-height: calc(100vh - 45px) !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
    z-index: 1030 !important;
  }

  .navbar-collapse.collapse:not(.show) {
    display: none !important;
  }

  .navbar-collapse.show {
    display: block !important;
    visibility: visible !important;
  }

  /* همبرگری منو */
  .navbar-toggler {
    display: flex !important;
    visibility: visible !important;
    order: 0 !important;
    padding: 0.25rem 0.5rem !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
  }

  .navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
  }

  .navbar-collapse .navbar-search-form {
    display: flex !important;
    visibility: visible !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: 80% !important;
    max-width: 80% !important;
    padding: 0 !important;
    gap: 0.5rem !important;
    margin: 0 auto !important;
    justify-content: center !important;
  }

  .navbar-collapse #navbar-layer-select {
    display: block !important;
    visibility: visible !important;
    width: calc(50% - 0.25rem) !important;
    max-width: calc(50% - 0.25rem) !important;
    margin-bottom: 0 !important;
    flex: 0 0 auto !important;
  }

  .navbar-collapse #navbar-search-container {
    display: block !important;
    visibility: visible !important;
    width: calc(50% - 0.25rem) !important;
    max-width: calc(50% - 0.25rem) !important;
    flex: 0 0 auto !important;
  }

  .navbar-collapse .leaflet-control-search {
    width: 100% !important;
    max-width: 100% !important;
  }

  .navbar-collapse .leaflet-control-search .search-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Search tooltip در موبایل landscape */
  .navbar-collapse .leaflet-control-search .search-tooltip {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    width: auto !important;
    max-width: 300px !important;
    min-width: 220px !important;
    z-index: 10000 !important;
    display: block !important;
    visibility: visible !important;
    margin-top: 2px !important;
    box-sizing: border-box !important;
  }

  .leaflet-control-search .search-tooltip {
    position: absolute !important;
    z-index: 10000 !important;
    display: block !important;
    visibility: visible !important;
  }
}

/* ========= TABLET PORTRAIT (768px - 991px) ========= */
@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar {
    min-height: 45px !important;
    max-height: 45px !important;
    height: 45px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .navbar .container-fluid {
    justify-content: space-between !important;
    gap: 0.5rem !important;
  }

  .navbar-brand {
    order: -1 !important;
    flex: 0 0 auto !important;
  }

  .navbar-brand .title {
    font-size: 0.8rem !important;
    padding: 0 0.75rem !important;
  }

  .navbar-logo-right {
    order: 1 !important;
    flex: 0 0 auto !important;
    height: 26px !important;
    padding: 0 0.75rem !important;
  }

  /* navbar-collapse برای تبلت */
  .navbar-collapse {
    position: absolute !important;
    top: 45px !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0.75rem !important;
    margin: 0 !important;
    max-height: calc(100vh - 45px) !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
    z-index: 1030 !important;
  }

  .navbar-collapse.collapse:not(.show) {
    display: none !important;
  }

  .navbar-collapse.show {
    display: block !important;
    visibility: visible !important;
  }

  /* همبرگری منو */
  .navbar-toggler {
    display: flex !important;
    visibility: visible !important;
    order: 0 !important;
    padding: 0.25rem 0.5rem !important;
    border: none !important;
    background: transparent !important;
  }

  .navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
  }

  .navbar-collapse .navbar-search-form {
    display: flex !important;
    visibility: visible !important;
    flex-direction: row !important;
    width: 100% !important;
    padding: 0 !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
  }

  .navbar-collapse #navbar-layer-select {
    display: block !important;
    visibility: visible !important;
    width: 48% !important;
  }

  .navbar-collapse #navbar-search-container {
    display: block !important;
    visibility: visible !important;
    width: 48% !important;
  }

  /* Search tooltip در تبلت */
  .navbar-collapse .leaflet-control-search .search-tooltip {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    width: auto !important;
    max-width: 300px !important;
    min-width: 220px !important;
    z-index: 10000 !important;
    display: block !important;
    visibility: visible !important;
    margin-top: 2px !important;
  }

  .leaflet-control-search .search-tooltip {
    position: absolute !important;
    z-index: 10000 !important;
    display: block !important;
    visibility: visible !important;
  }
}

/* ========= TABLET LANDSCAPE / SMALL DESKTOP (992px - 1199px) ========= */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar {
    min-height: 45px !important;
    max-height: 45px !important;
    height: 45px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .navbar .container-fluid {
    justify-content: flex-start !important;
    gap: 0.5rem !important;
  }

  .navbar-brand {
    order: -1 !important;
    flex: 0 0 auto !important;
  }

  .navbar-brand .title {
    font-size: 0.85rem !important;
    padding: 0 0.75rem !important;
  }

  .navbar-logo-right {
    order: 1 !important;
    flex: 0 0 auto !important;
    height: 28px !important;
    padding: 0 0.75rem !important;
  }

  /* همبرگری مخفی شود */
  .navbar-toggler {
    display: none !important;
    visibility: hidden !important;
  }

  /* navbar-collapse همیشه نمایش داده شود در دسکتاپ */
  .navbar-collapse {
    display: flex !important;
    visibility: visible !important;
    position: static !important;
    flex: 1 1 auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    max-height: none !important;
    overflow: visible !important;
    justify-content: center !important;
  }

  .navbar-collapse .navbar-search-form {
    display: flex !important;
    visibility: visible !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .navbar-collapse #navbar-layer-select {
    display: block !important;
    visibility: visible !important;
    width: auto !important;
  }

  .navbar-collapse #navbar-search-container {
    display: block !important;
    visibility: visible !important;
    width: auto !important;
  }
}

/* ========= TABLET LANDSCAPE / SMALL DESKTOP (992px - 1199px) - CONTINUED ========= */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar-logo-right {
    display: block !important;
    visibility: visible !important;
  }
}

/* ========= DESKTOP (>= 1200px) ========= */
@media (min-width: 1200px) {
  .navbar {
    min-height: 45px !important;
    max-height: 45px !important;
    height: 45px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .navbar .container-fluid {
    justify-content: flex-start !important;
    gap: 0.5rem !important;
  }

  .navbar-brand {
    order: -1 !important;
    flex: 0 0 auto !important;
  }

  .navbar-brand .title {
    font-size: 0.9rem !important;
    padding: 0 1rem !important;
  }

  .navbar-logo-right {
    display: block !important;
    visibility: visible !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    height: 28px !important;
    padding: 0 1rem !important;
  }

  /* همبرگری مخفی شود */
  .navbar-toggler {
    display: none !important;
    visibility: hidden !important;
  }

  /* navbar-collapse همیشه نمایش داده شود در دسکتاپ */
  .navbar-collapse {
    display: flex !important;
    visibility: visible !important;
    position: static !important;
    flex: 1 1 auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    max-height: none !important;
    overflow: visible !important;
    justify-content: center !important;
  }

  .navbar-collapse .navbar-search-form {
    display: flex !important;
    visibility: visible !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .navbar-collapse #navbar-layer-select {
    display: block !important;
    visibility: visible !important;
    width: auto !important;
  }

  .navbar-collapse #navbar-search-container {
    display: block !important;
    visibility: visible !important;
    width: auto !important;
  }
}

/* ========= HAMBURGER MENU STYLES ========= */
.navbar-toggler {
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.navbar-toggler:hover {
  opacity: 0.8 !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 30 30%27%3e%3cpath stroke=%27rgba%28255, 255, 255, 0.55%29%27 stroke-linecap=%27round%27 stroke-miterlimit=%2710%27 stroke-width=%272%27 d=%27M4 7h22M4 15h22M4 23h22%27/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% !important;
}

/* ========= PRINT STYLES ========= */
@media print {
  .navbar-toggler {
    display: none !important;
  }

  .navbar-collapse {
    display: none !important;
  }

  .navbar-search-form {
    display: none !important;
  }
}

/* استایل‌های ویجت نقشه‌ها */

.maps-widget {
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.toggle-all-container {
  margin-bottom: 15px;
  text-align: center;
}

.toggle-all-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-all-btn:hover {
  background: linear-gradient(135deg, #45a049, #4CAF50);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.toggle-all-btn[data-state="off"] {
  background: linear-gradient(135deg, #f44336, #d32f2f);
}

.toggle-all-btn[data-state="off"]:hover {
  background: linear-gradient(135deg, #d32f2f, #f44336);
}

.toggle-all-btn i {
  margin-left: 5px;
  font-size: 16px;
}

.layer-item {
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 5px;
  transition: background-color 0.2s ease;
}

.layer-item:hover {
  background-color: rgba(0,0,0,0.05);
}

.layer-item .form-check {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.layer-item input[type="checkbox"] {
  margin-top: 0 !important;
  margin-left: 8px;
}

.layer-item label {
  margin-bottom: 0;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.layer-item label i {
  margin-left: 8px;
  width: 16px;
  text-align: center;
}

/* استایل‌های dropdown */
.layer-item .dropdown {
  position: relative;
}

.layer-item .dropdown-menu {
  position: fixed !important;
  z-index: 99999 !important;
  min-width: 200px;
  padding: 8px 0;
  margin: 0;
  background-color: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0,0,0,.175);
}

/* موقعیت dropdown با JavaScript تنظیم می‌شود */

.layer-item .dropdown-menu li {
  list-style: none;
}

.layer-item .dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  clear: both;
  font-weight: 400;
  color: #333;
  text-align: inherit;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
}

.layer-item .dropdown-item:hover {
  background-color: #f8f9fa;
}

.layer-item .dropdown-divider {
  height: 0;
  margin: 8px 0;
  overflow: hidden;
  border-top: 1px solid #e9ecef;
}

/* استایل‌های responsive */
@media (max-width: 768px) {
  .toggle-all-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .layer-item label {
    font-size: 13px;
  }
}

/* استایل‌های ویجت تصاویر ماهواره */

.basemaps-widget {
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.basemap-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.basemap-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

.basemap-item:hover {
  border-color: #007bff;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}

.basemap-item input[type="radio"] {
  margin-left: 10px;
  margin-top: 0;
  transform: scale(1.2);
  accent-color: #007bff;
}

.basemap-item label {
  margin-bottom: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  flex-grow: 1;
  padding-right: 8px;
}

.basemap-item input[type="radio"]:checked + label {
  color: #007bff;
  font-weight: 600;
}

.basemap-item:has(input[type="radio"]:checked) {
  border-color: #007bff;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

/* افکت‌های انیمیشن */
.basemap-item input[type="radio"] {
  transition: transform 0.2s ease;
}

.basemap-item input[type="radio"]:checked {
  transform: scale(1.3);
}

/* استایل‌های responsive */
@media (max-width: 768px) {
  .basemap-item {
    padding: 8px;
  }
  
  .basemap-item label {
    font-size: 13px;
  }
  
  .basemap-item input[type="radio"] {
    transform: scale(1.1);
  }
  
  .basemap-item input[type="radio"]:checked {
    transform: scale(1.2);
  }
}

/* استایل‌های خاص برای حالت فعال */
.basemap-item.active {
  border-color: #28a745;
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.basemap-item.active label {
  color: #155724;
}

/* استایل‌های ویجت بوکمارک‌ها */

.bookmarks-widget {
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.bookmark-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.bookmark-tools .btn {
  padding: 6px 12px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.bookmark-tools .btn-primary {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
}

.bookmark-tools .btn-primary:hover {
  background: linear-gradient(135deg, #0056b3, #007bff);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.bookmark-tools .btn-outline-secondary {
  background: white;
  border: 2px solid #6c757d;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bookmark-tools .btn-outline-secondary:hover {
  background: #6c757d;
  color: white;
}

.bookmark-tools .btn-outline-secondary[data-state="on"] {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

/* دسته‌بندی‌های بوکمارک */
.category-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.category-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-toggle:hover {
  background: #f8f9fa;
  border-color: #007bff;
}

.category-toggle input[type="checkbox"] {
  margin: 0;
}

.category-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #ccc;
}

.category-name {
  font-size: 12px;
  font-weight: 500;
}

/* لیست بوکمارک‌ها */
.bookmark-category {
  margin-bottom: 16px;
}

.category-title {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #dee2e6;
}

.bookmark-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  margin-bottom: 4px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.bookmark-item:hover {
  background: #f8f9fa;
  border-color: #007bff;
  transform: translateX(-2px);
}

.bookmark-info {
  flex-grow: 1;
}

.bookmark-info strong {
  display: block;
  font-size: 13px;
  color: #212529;
  margin-bottom: 2px;
}

.bookmark-info small {
  font-size: 11px;
  color: #6c757d;
}

.bookmark-actions {
  display: flex;
  gap: 4px;
}

.btn-goto,
.btn-delete {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-goto {
  background: #17a2b8;
  color: white;
}

.btn-goto:hover {
  background: #138496;
  transform: scale(1.1);
}

.btn-delete {
  background: #dc3545;
  color: white;
}

.btn-delete:hover {
  background: #c82333;
  transform: scale(1.1);
}

.btn-goto i,
.btn-delete i {
  font-size: 12px;
}

/* استایل‌های responsive */
@media (max-width: 768px) {
  .bookmark-tools {
    flex-direction: column;
    align-items: stretch;
  }
  
  .bookmark-tools .btn {
    text-align: center;
  }
  
  .category-toggles {
    flex-direction: column;
  }
  
  .bookmark-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .bookmark-actions {
    align-self: flex-end;
  }
}

/* انیمیشن‌های اضافی */
.bookmark-item {
  animation: fadeInUp 0.3s ease-out;
}

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

/* استایل‌های ویجت مختصات */

.coordinates-widget {
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.coordinate-form {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 10px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  margin-bottom: 4px;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.btn-coordinate {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 8px 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-coordinate:hover {
  background: linear-gradient(135deg, #0056b3, #007bff);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.btn-coordinate.active {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.btn-coordinate.btn-tool {
  background: linear-gradient(135deg, #17a2b8, #138496);
}

.btn-coordinate.btn-tool:hover {
  background: linear-gradient(135deg, #138496, #17a2b8);
}

.btn-coordinate.btn-delete {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.btn-coordinate.btn-delete:hover {
  background: linear-gradient(135deg, #c82333, #dc3545);
}

.btn.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #dc3545);
}

.form-spacer {
  height: 20px;
  border-bottom: 1px dashed #dee2e6;
  margin: 20px 0;
}

.coordinate-form p {
  margin: 12px 0 8px 0;
  font-size: 14px;
  color: #495057;
}

.coordinate-form span {
  font-weight: 600;
  color: #007bff;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 3px;
}

/* استایل‌های responsive */
@media (max-width: 768px) {
  .coordinate-form {
    padding: 12px;
  }
  
  .form-group input {
    font-size: 16px; /* جلوگیری از zoom در iOS */
  }
  
  .btn-coordinate {
    width: 100%;
    justify-content: center;
    margin: 4px 0;
  }
  
  .btn.btn-danger {
    width: 100%;
    justify-content: center;
  }
}

/* انیمیشن‌های اضافی */
.coordinate-form {
  animation: fadeInUp 0.3s ease-out;
}

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

/* استایل‌های خاص برای نتایج */
.coordinate-form p span {
  transition: all 0.3s ease;
}

.coordinate-form p span:not(:empty) {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border: 1px solid #007bff;
}

/* استایل‌های ویجت ترسیم پلیگون - فقط برای فرم ویجت ترسیم اعمال شود */

.widget-form[data-widget="draw"] .draw-widget {
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.widget-form[data-widget="draw"] .draw-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.widget-form[data-widget="draw"] .draw-tools button {
  width: 40px;
  height: 40px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 16px;
  color: #495057;
}

.widget-form[data-widget="draw"] .draw-tools button:hover {
  border-color: #007bff;
  background: #f8f9fa;
  color: #007bff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.widget-form[data-widget="draw"] .draw-tools button.active {
  border-color: #28a745;
  background: #28a745;
  color: white;
  box-shadow: 0 2px 8px rgba(40,167,69,0.3);
}

.widget-form[data-widget="draw"] .draw-tools button i {
  font-size: 16px;
}

.widget-form[data-widget="draw"] .draw-geojson-tools {
  margin-top: 15px;
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

.widget-form[data-widget="draw"] .draw-geojson-tools h4 {
  margin-bottom: 10px;
  font-size: 14px;
  color: #495057;
  font-weight: 600;
}

.widget-form[data-widget="draw"] .btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.widget-form[data-widget="draw"] .btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.widget-form[data-widget="draw"] .btn-success:hover {
  background: linear-gradient(135deg, #20c997, #28a745);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

.widget-form[data-widget="draw"] .btn-warning {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: white;
}

.widget-form[data-widget="draw"] .btn-warning:hover {
  background: linear-gradient(135deg, #fd7e14, #ffc107);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255,193,7,0.3);
}

.widget-form[data-widget="draw"] .btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.widget-form[data-widget="draw"] .btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #dc3545);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220,53,69,0.3);
}

.widget-form[data-widget="draw"] .draw-controls {
  margin-top: 10px;
}

/* لیست ذخیره شده‌ها */
.widget-form[data-widget="draw"] #toolbar-saved-drawings-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  background: white;
}

.widget-form[data-widget="draw"] .saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease;
}

.widget-form[data-widget="draw"] .saved-item:hover {
  background-color: #f8f9fa;
}

.widget-form[data-widget="draw"] .saved-item:last-child {
  border-bottom: none;
}

.widget-form[data-widget="draw"] .item-name {
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  flex-grow: 1;
}

.widget-form[data-widget="draw"] .item-date {
  font-size: 11px;
  color: #6c757d;
  margin: 0 8px;
}

.widget-form[data-widget="draw"] .item-actions {
  display: flex;
  gap: 4px;
}

.widget-form[data-widget="draw"] .item-actions button {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.widget-form[data-widget="draw"] .item-actions button:first-child {
  background: #17a2b8;
  color: white;
}

.widget-form[data-widget="draw"] .item-actions button:first-child:hover {
  background: #138496;
  transform: scale(1.1);
}

.widget-form[data-widget="draw"] .item-actions button:last-child {
  background: #dc3545;
  color: white;
}

.widget-form[data-widget="draw"] .item-actions button:last-child:hover {
  background: #c82333;
  transform: scale(1.1);
}

.widget-form[data-widget="draw"] .item-actions button i {
  font-size: 10px;
}

/* استایل‌های responsive */
@media (max-width: 768px) {
  .widget-form[data-widget="draw"] .draw-tools {
    justify-content: center;
  }
  
  .widget-form[data-widget="draw"] .draw-tools button {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .widget-form[data-widget="draw"] .draw-geojson-tools > div {
    flex-direction: column;
    align-items: stretch;
  }
  
  .widget-form[data-widget="draw"] .btn {
    justify-content: center;
    margin: 2px 0;
  }
  
  .widget-form[data-widget="draw"] .saved-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .widget-form[data-widget="draw"] .item-actions {
    align-self: flex-end;
  }
}

/* انیمیشن‌های اضافی */
.widget-form[data-widget="draw"] .draw-tools button {
  animation: fadeInUp 0.3s ease-out;
}

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

/* استایل‌های خاص برای حالت‌های مختلف */
.widget-form[data-widget="draw"] .draw-tools button[title*="چندضلعی"] {
  border-color: #ff0000;
}

.widget-form[data-widget="draw"] .draw-tools button[title*="دایره"] {
  border-color: #00ff00;
}

.widget-form[data-widget="draw"] .draw-tools button[title*="مستطیل"] {
  border-color: #0000ff;
}

.widget-form[data-widget="draw"] .draw-tools button[title*="ویرایش"] {
  border-color: #ffc107;
}

.widget-form[data-widget="draw"] .draw-tools button[title*="حذف"] {
  border-color: #dc3545;
}

/* استایل‌های ویجت ترسیم خط */

.draw-line-widget {
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.draw-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.draw-tools button {
  width: 40px;
  height: 40px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 16px;
  color: #495057;
}

.draw-tools button:hover {
  border-color: #ff6600;
  background: #f8f9fa;
  color: #ff6600;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(255,102,0,0.2);
}

.draw-tools button.active {
  border-color: #ff6600;
  background: #ff6600;
  color: white;
  box-shadow: 0 2px 8px rgba(255,102,0,0.3);
}

.draw-tools button i {
  font-size: 16px;
}

.draw-geojson-tools {
  margin-top: 15px;
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

.draw-geojson-tools h4 {
  margin-bottom: 10px;
  font-size: 14px;
  color: #495057;
  font-weight: 600;
}

.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #20c997, #28a745);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #fd7e14, #ffc107);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255,193,7,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #dc3545);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220,53,69,0.3);
}

.draw-controls {
  margin-top: 10px;
}

/* لیست ذخیره شده‌ها */
#toolbar-saved-lines-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  background: white;
}

.saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease;
}

.saved-item:hover {
  background-color: #f8f9fa;
}

.saved-item:last-child {
  border-bottom: none;
}

.item-name {
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  flex-grow: 1;
}

.item-date {
  font-size: 11px;
  color: #6c757d;
  margin: 0 8px;
}

.item-actions {
  display: flex;
  gap: 4px;
}

.item-actions button {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.item-actions button:first-child {
  background: #17a2b8;
  color: white;
}

.item-actions button:first-child:hover {
  background: #138496;
  transform: scale(1.1);
}

.item-actions button:last-child {
  background: #dc3545;
  color: white;
}

.item-actions button:last-child:hover {
  background: #c82333;
  transform: scale(1.1);
}

.item-actions button i {
  font-size: 10px;
}

/* استایل‌های responsive */
@media (max-width: 768px) {
  .draw-tools {
    justify-content: center;
  }
  
  .draw-tools button {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .draw-geojson-tools > div {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn {
    justify-content: center;
    margin: 2px 0;
  }
  
  .saved-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .item-actions {
    align-self: flex-end;
  }
}

/* انیمیشن‌های اضافی */
.draw-tools button {
  animation: fadeInUp 0.3s ease-out;
}

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

/* استایل‌های خاص برای ابزارهای خط */
.draw-tools button[title*="خط"] {
  border-color: #ff6600;
}

.draw-tools button[title*="ویرایش"] {
  border-color: #ffc107;
}

.draw-tools button[title*="حذف"] {
  border-color: #dc3545;
}

/* تمایز بصری برای ابزارهای خط */
.draw-line-widget .draw-tools button:hover {
  border-color: #ff6600;
  color: #ff6600;
}

.draw-line-widget .draw-tools button.active {
  border-color: #ff6600;
  background: #ff6600;
}

/* استایل‌های ویجت اندازه‌گیری */

.measure-widget {
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.measure-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.measure-tools button {
  width: 50px;
  height: 50px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 20px;
  color: #495057;
}

.measure-tools button:hover {
  border-color: #007bff;
  background: #f8f9fa;
  color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}

.measure-tools button.active {
  border-color: #28a745;
  background: #28a745;
  color: white;
  box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.measure-tools button i {
  font-size: 20px;
}

.measure-tools select {
  padding: 8px 12px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.measure-tools select:hover {
  border-color: #007bff;
  background: #f8f9fa;
}

.measure-tools select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #dc3545);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220,53,69,0.3);
}

/* نتایج اندازه‌گیری */
#toolbar-measure-results {
  margin-top: 15px;
  font-size: 14px;
  line-height: 1.6;
}

#toolbar-measure-results > div {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

#toolbar-measure-results .alert-warning {
  background: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

#toolbar-measure-results .alert-info {
  background: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

#toolbar-measure-results strong {
  color: #155724;
  font-weight: 600;
}

/* راهنمای استفاده */
.measure-tools + p {
  margin-top: 10px;
  font-size: 13px;
  color: #6c757d;
  line-height: 1.5;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 4px solid #007bff;
}

/* استایل‌های responsive */
@media (max-width: 768px) {
  .measure-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .measure-tools button {
    width: 100%;
    height: 44px;
    justify-content: center;
  }
  
  .measure-tools select {
    width: 100%;
    min-width: auto;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .measure-tools button {
    height: 40px;
    font-size: 16px;
  }
  
  .measure-tools button i {
    font-size: 16px;
  }
  
  .measure-tools select {
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* انیمیشن‌های اضافی */
.measure-tools button {
  animation: fadeInUp 0.3s ease-out;
}

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

/* استایل‌های خاص برای حالت‌های مختلف */
.measure-tools button[title*="شروع"] {
  border-color: #28a745;
}

.measure-tools button[title*="پایان"] {
  border-color: #ffc107;
}

/* استایل‌های popup اندازه‌گیری */
.leaflet-measure-resultpopup {
  font-size: 16px !important;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #007bff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-measure-resultpopup span {
  font-size: 16px !important;
}

.leaflet-measure-resultpopup .leaflet-popup-content {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #495057;
}

/* استایل‌های لیبل‌های اندازه‌گیری */
.measure-label {
  font-size: 16px !important;
  font-weight: bold;
  color: #000000;
  text-shadow: 1px 1px 2px #ffffff, -1px -1px 2px #ffffff;
  background: none;
  border: none;
  padding: 2px 5px;
}

.measure-area-label {
  font-size: 18px !important;
  font-weight: bold;
  color: #000000;
  text-shadow: 1px 1px 2px #ffffff, -1px -1px 2px #ffffff;
  background: none;
  border: none;
  padding: 2px 5px;
}

/* استایل‌های خطوط اندازه‌گیری */
.leaflet-measure-path-temp {
  stroke: #ff0000 !important;
  stroke-width: 3 !important;
  stroke-dasharray: 5, 5 !important;
}

.leaflet-measure-path {
  stroke: #00ff00 !important;
  stroke-width: 2 !important;
  fill-opacity: 0.2 !important;
}

/* تنظیمات برای RTL */
.measure-tools {
  direction: rtl;
}

.measure-tools select {
  text-align: right;
  direction: rtl;
}

/* استایل‌های ویجت خط‌کش */

.ruler-widget {
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.ruler-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.ruler-tools button {
  height: 50px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #495057;
  padding: 0 15px;
  font-size: 16px;
}

#toolbar-ruler-start {
  width: 60px;
  font-size: 24px;
}

.ruler-tools button:hover {
  border-color: #007bff;
  background: #f8f9fa;
  color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}

.ruler-tools button.active {
  border-color: #28a745;
  background: #28a745;
  color: white;
  box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.ruler-tools button i {
  font-size: inherit;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #dc3545);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220,53,69,0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #fd7e14, #ffc107);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255,193,7,0.3);
}

/* نتایج خط‌کش */
#ruler-results {
  margin-top: 15px;
  font-size: 14px;
  line-height: 1.6;
}

#ruler-results > div {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

#ruler-results .alert-info {
  background: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

#ruler-results strong {
  color: #155724;
  font-weight: 600;
}

/* راهنمای استفاده */
.ruler-tools + p {
  margin-top: 10px;
  font-size: 13px;
  color: #6c757d;
  line-height: 1.5;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 4px solid #007bff;
}

/* استایل‌های responsive */
@media (max-width: 768px) {
  .ruler-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .ruler-tools button {
    width: 100%;
    height: 44px;
    justify-content: center;
  }
  
  #toolbar-ruler-start {
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .ruler-tools button {
    height: 40px;
    font-size: 14px;
  }
  
  #toolbar-ruler-start {
    font-size: 20px;
  }
  
  .ruler-tools button i {
    font-size: 16px;
  }
}

/* انیمیشن‌های اضافی */
.ruler-tools button {
  animation: fadeInUp 0.3s ease-out;
}

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

/* استایل‌های خاص برای حالت‌های مختلف */
.ruler-tools button[title*="شروع"] {
  border-color: #28a745;
}

.ruler-tools button[title*="پایان"] {
  border-color: #ffc107;
}

/* استایل‌های خطوط و نشانگرهای خط‌کش */
.leaflet-interactive.ruler-line {
  stroke: #ff0000 !important;
  stroke-width: 3 !important;
  stroke-opacity: 0.8 !important;
}

.leaflet-interactive.ruler-marker {
  fill: #ff0000 !important;
  fill-opacity: 0.8 !important;
  stroke: #ffffff !important;
  stroke-width: 2 !important;
}

/* استایل‌های popup نتایج */
.leaflet-popup-content {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #495057;
}

.leaflet-popup-content strong {
  color: #155724;
  font-weight: 600;
}

/* تنظیمات برای RTL */
.ruler-tools {
  direction: rtl;
}

/* استایل‌های خاص برای نتایج */
#ruler-results div[style*="background: #d4edda"] {
  background: #d4edda !important;
  border: 1px solid #c3e6cb !important;
  color: #155724;
}

#ruler-results div[style*="background: #d4edda"] strong {
  color: #0f5132;
}

/* حالت فعال خط‌کش */
.ruler-active .leaflet-container {
  cursor: crosshair !important;
}

/* استایل‌های اضافی برای بهبود UX */
.ruler-tools button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ruler-tools button:disabled:hover {
  border-color: #dee2e6;
  background: white;
  color: #495057;
  transform: none;
  box-shadow: none;
}

/* استایل‌های لیبل‌های لایه */
.layer-label {
  font-size: 12px;
  font-weight: 600;
  color: #111;
  text-shadow: 1px 1px 2px #fff;
  background: rgba(255,255,255,0.6);
  border-radius: 4px;
  padding: 1px 4px;
  border: 1px solid rgba(0,0,0,0.1);
}

/* اعمال رنگ‌های سفارشی برای لیبل‌ها */
.layer-label[style*="color"] {
  text-shadow: 1px 1px 2px #fff, -1px -1px 2px #fff;
}

/* بهبود نمایش رنگ‌های سفارشی */
.leaflet-tooltip {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 600;
  text-shadow: 1px 1px 2px #fff, -1px -1px 2px #fff;
}

/* استایل برای لیبل‌های با رنگ سفارشی */
.custom-color-label {
  font-weight: bold !important;
  text-shadow: 1px 1px 2px #fff, -1px -1px 2px #fff !important;
}

/* بهبود نمایش لیبل‌های رنگی */
.leaflet-tooltip.custom-color-label {
  background: rgba(255,255,255,0.95);
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* استایل‌های Modal اطلاعات توصیفی */
#featureModal .modal-body {
  max-height: 70vh !important;
  overflow-y: auto !important;
}

#featureModal .modal-body img {
  max-width: 100% !important;
  max-height: 300px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  transition: transform 0.2s ease !important;
}

#featureModal .modal-body img:hover {
  transform: scale(1.05) !important;
}

/* راست‌چین کردن عناوین پراپرتی‌ها در جدول */
#featureModal .modal-body table th {
  text-align: right !important;
  direction: rtl !important;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif !important;
  background-color: #f8f9fa !important;
  font-weight: bold !important;
  padding: 8px 12px !important;
}

#featureModal .modal-body table td {
  text-align: right !important;
  direction: rtl !important;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif !important;
  padding: 8px 12px !important;
}

/* استایل‌های Modal گالری تصاویر */
#imageGalleryModal .modal-dialog {
  max-width: 90% !important;
}

#imageGalleryModal .carousel-inner {
  background: #f8f9fa;
  border-radius: 4px;
}

#imageGalleryModal .carousel-control {
  background: rgba(0,0,0,0.3) !important;
  width: 50px !important;
}

#imageGalleryModal .carousel-control:hover {
  background: rgba(0,0,0,0.5) !important;
}

#imageGalleryModal .carousel-indicators {
  bottom: -40px !important;
}

#imageGalleryModal .carousel-indicators li {
  background-color: #007bff !important;
  border: 1px solid #007bff !important;
}

#imageGalleryModal .carousel-indicators .active {
  background-color: #0056b3 !important;
}

/* ========= IMPORT NAVBAR AND SEARCH STYLES ========= */

/* ========= IMPORT WIDGET CSS ========= */


#searchContainer {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
}

#map {
  height: calc(100vh - 45px);
  width: 100%;
  position: absolute;
  top: 45px;
  left: 0;
  right: 0;
  bottom: 0;
}

#table {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}

#table tr {
  cursor: pointer;
}


.loading-indicator {
  position: absolute;
  width: 220px;
  height: 19px;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -110px;
  z-index: 20001;
}

.loading-bar {
  width: 100%;
}

.rule-value-container {
  max-height: 100px;
  width: 350px;
  overflow: auto;
}

.tab-content {
  padding-top: 10px;
}

.fa-white {
  color: white;
}

.info-control {
  padding: 6px 8px;
  font: 14px/16px 'Tahoma', Arial, Helvetica, sans-serif;
  background: white;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  border-radius: 5px;
  text-align: right;
}

.leaflet-control-layers {
  overflow: auto;
}

.leaflet-control-layers label {
  font-weight: normal;
  margin-bottom: 0px;
  text-align: right;
}

.leaflet-control-layers-selector {
  top: 0px;
  margin-left: 5px;
  margin-right: 0;
}

.navbar .navbar-brand {
  font-weight: bold;
  font-size: 25px;
  color: white;
  text-align: right;
}

.navbar-brand img {
  height: 100%;
  margin-top: -5px;
  margin-left: 10px;
  margin-right: 0;
  display: inline;
}

.navbar-nav img {
  height: 40px;
  margin-top: -12px;
  margin-bottom: -10px;
}


@media print {
  .navbar {
    display: none !important;
  }
  .leaflet-control-container {
    display: none !important;
  }
}

#table-container {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  position: relative;
  box-shadow: none;
  overflow: hidden;
}

/* استایل‌های دکمه close جدول */
.close-table-btn {
  background-color: #d9534f !important;
  border-color: #d43f3a !important;
  color: white !important;
}

.close-table-btn:hover,
.close-table-btn:focus,
.close-table-btn:active {
  background-color: #c9302c !important;
  border-color: #ac2925 !important;
  color: white !important;
}

/* #table-container {
  height: 55%;
  padding: 5px;
  position: relative;
  box-shadow: inset 0 8px 8px -8px #696868;
  display: block !important;  
  visibility: visible !important;  
  overflow: auto;  
} */

#table {
  width: 100% !important; /* عرض کامل */
  display: block !important; /* اطمینان از نمایش */
  visibility: visible !important; /* اطمینان از نمایش */
  height: auto !important; /* ارتفاع خودکار */
}


.draw-tools button {
  margin: 5px;
  padding: 10px;
  font-size: 18px;
  background-color: #f0f0f0;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.draw-tools button:hover {
  background-color: #ddd;
}

.leaflet-control-scale {
  font-size: 14px; /* اندازه فونت */
  padding: 5px 10px; /* پدینگ کادر */
}

.leaflet-control-scale-line {
  height: 8px; /* ارتفاع خط */
  border-width: 2px; /* ضخامت خط */
  display: flex; /* از flex استفاده کن برای چیدمان */
  align-items: center; /* عمودی وسط‌چین */
  margin-top: 5px; /* فاصله از بالا برای هر خط */
}

/* اضافه کردن فاصله بین خط و متن */
.leaflet-control-scale-line::before {
  content: ""; /* یه فضای خالی قبل از متن */
  width: 25px; /* فاصله افقی بین خط و عدد */
}


.leaflet-tooltip {
  font-size: 12px;
  background-color: #fff;
  border: 2px solid #333;
  border-radius: 5px;
  padding: 2px;
}

.result-tooltip {
  background-color: #ffcc00;
  border-color: #ff9900;
}

.moving-tooltip {
  background-color: #00ccff;
  border-color: #0099ff;
}

.leaflet-tooltip {
  direction: rtl;
  text-align: right;
}

.leaflet-tooltip.moving-tooltip {
  direction: rtl;
  text-align: right;
}

.leaflet-tooltip.result-tooltip {
  direction: rtl;
  text-align: right;
}

.print-tools button {
  font-size: 24px;
  margin: 5px;
  padding: 5px;
  background: #f0f0f0;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 4px;
}
.print-tools button:hover {
  background: #e0e0e0;
}

#layer-dropdown {
  border-radius: 5px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #333;
}
#layer-table-container {
  max-height: 400px;
  overflow-y: auto;
}


/* کرسر برای زوم جعبه‌ای */
.zoom-in-cursor { cursor: zoom-in !important; }
.zoom-out-cursor { cursor: zoom-out !important; }

/* استایل پنجره زوم */
.leaflet-zoom-box {
    position: absolute;
    border: 2px dashed blue;
    background: rgba(0, 0, 255, 0.2);
    pointer-events: none;
    z-index: 1000;
}

/* جلوگیری از انتخاب عناصر هنگام درگ */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* دکمه‌های زوم جعبه‌ای */
.leaflet-control-box-zoom-in,
.leaflet-control-box-zoom-out {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    text-align: center;
    font-size: 18px !important;
    color: black !important;
    background: white !important;
    border-radius: 4px !important;
    border: 1px solid #ccc !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important; /* حذف فاصله داخلی */
}

/* تنظیم اندازه آیکون داخل دکمه */
.leaflet-control-box-zoom-in i,
.leaflet-control-box-zoom-out i {
    font-size: 16px !important; /* کوچکتر کردن آیکون */
    margin: 0 !important;
    padding: 0 !important;
}


.leaflet-control-box-zoom-in:hover,
.leaflet-control-box-zoom-out:hover {
    background: #f4f4f4 !important;
}

.large-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.large-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 0px; /* کاهش padding */
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.coordinate-form {
  margin: 10px 0; /* کاهش margin */
  font-size: 14px;
}

.form-group {
  margin-bottom: 10px; /* کاهش margin */
}

.coordinate-form label {
  display: inline-block;
  width: 150px;
  margin-right: 10px;
  font-weight: bold;
}

.coordinate-form input {
  height: 22px;
  padding: 5px;
  margin-right: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.btn-coordinate {
  padding: 8px 15px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
}

.btn-coordinate:hover {
  background-color: #45a049;
}

.form-spacer {
  height: 10px; /* کاهش فاصله */
  border-bottom: 1px solid #c40808;
  margin: 10px 0; /* کاهش margin */
}

#utm-result, #latlng-result {
  font-weight: bold;
  color: #333;
}

.leaflet-popup-content {
  font-size: 16px !important; /* اندازه فونت دلخواه */
  line-height: 1.5; /* فاصله خطوط */
}

.leaflet-popup-content-wrapper {
  padding: 10px; /* فاصله داخلی */
}

.btn-delete {
  background-color: #ff4444;
  color: white;
  border: none;
}

.btn-delete:hover {
  background-color: #cc0000;
}

.btn-tool {
  background-color: #ee0ed0; /* رنگ سبز برای تمایز */
  color: white;
  border: none;
  margin: 5px;
  padding: 5px 10px;
  font-size: 14px;
}

.btn-tool:hover {
  background-color: #45a049; /* رنگ تیره‌تر در هاور */
}

.btn-tool.active {
  background-color: #2196F3; /* رنگ آبی وقتی فعاله */
}

#bookmarks-list ul {
  list-style: none;
  padding: 0;
}

#bookmarks-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

#bookmarks-list li button {
  margin-left: 5px;
  padding: 8px 15px; /* اندازه پدینگ بزرگ‌تر */
  background-color: #f44336; /* رنگ قرمز برای حذف */
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px; /* اندازه فونت دکمه */
  border-radius: 4px; /* گوشه‌های گرد */
}

#bookmarks-list li button.zoom-to {
  background-color: #2196f3; /* رنگ آبی برای بزرگ‌نمایی */
}

#bookmarks-list li button:hover {
  opacity: 0.8;
}
#bookmarks-list p {
  font-size: 16px; /* اندازه فونت بزرگ‌تر */
  color: #666; /* رنگ مناسب‌تر */
  padding: 10px; /* فاصله داخلی */
  text-align: center; /* مرکزیت متن */
}
#bookmarks-list li span {
  font-size: 13px; /* اندازه فونت بزرگ‌تر (می‌تونید 18px یا بیشتر امتحان کنید) */
  color: #333; /* رنگ متن برای خوانایی بهتر */
  margin-right: 10px; /* فاصله بین نام و مختصات */
}

/* src/css/app.css */
.leaflet-control-geocoder-form input {
  font-size: 16px !important;
  height: 36px !important;
  padding: 5px 10px !important;
}
.leaflet-control-geocoder-alternatives li {
  font-size: 16px !important;
  padding: 8px 12px !important;
}

.opacity-slider-container {
  transition: all 0.3s ease; /* انیمیشن برای نمایش/مخفی کردن */
}

.large-text {
  font-size: 16px !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}


.form-check {
  align-items: center; /* مطمئن می‌شیم همه عناصر تو یه خط باشن */
}



.btn-descriptive-table {
  padding: 2px 8px; /* عرض و ارتفاع کمتر */
  font-size: 12px; /* متن کوچکتر */
  white-space: nowrap; /* جلوگیری از شکستن متن */
  height: 24px; /* ارتفاع ثابت برای هماهنگی */
}

.large-text {
  font-size: 16px !important;
  margin-right: 10px; /* فاصله بیشتر اگه لازم بود */
}

.change-password-btn,
.logout-btn-sidebar {
  width: 100%; /* عرض کامل */
  padding: 10px 15px; /* فاصله داخلی */
  margin: 10px 0; /* فاصله خارجی */
  font-size: 16px; /* اندازه فونت */
  font-weight: bold; /* ضخامت فونت */
  color: #ece8e8; /* رنگ متن */
  border: none; /* حذف حاشیه */
  border-radius: 5px; /* گوشه‌های گرد */
  cursor: pointer; /* تغییر شکل نشانگر ماوس */
  transition: background-color 0.3s ease; /* انیمیشن تغییر رنگ */
}

.change-password-btn {
  background-color: #4CAF50; /* رنگ سبز */
}

.change-password-btn:hover {
  background-color: #45a049; /* رنگ سبز تیره‌تر هنگام hover */
}

.logout-btn-sidebar {
  background-color: #f44336; /* رنگ قرمز */
}

.logout-btn-sidebar:hover {
  background-color: #d32f2f; /* رنگ قرمز تیره‌تر هنگام hover */
}

.coordinatedImagePreviewControlMainDiv {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  max-width: 80%;
  max-height: 200px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  z-index: 2000; /* مقدار بالا برای قرار گرفتن روی همه عناصر */
}

.coordinatedImagePreviewControlUl {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  gap: 10px;
}

.coordinatedImagePreviewControlLi {
  display: inline-block;
}

.example-image {
  width: 150px;
  height: 100px;
  object-fit: cover;
}

/* تنظیم جهت باز شدن منوی دراپ‌داون به سمت راست */
.dropdown-menu-right {
  left: auto !important;
  right: -10px !important; /* فاصله منو از دکمه - بسته به نیاز تنظیم کن */
  transform: translateX(100%); /* مطمئن می‌شیم منو کاملاً به سمت راست بره */
}

/* تنظیم z-index برای نمایش روی سایدبار */
.dropdown-menu {
  min-width: 200px;
  z-index: 2000 !important; /* z-index بالا برای نمایش روی سایدبار */
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0,0,0,.175);
}

/* تنظیم موقعیت دراپ‌داون */
.dropdown {
  position: relative;
}

  /* بقیه استایل‌ها */
  .layer-item {
    width: 100%;
    display: block;
  }

/* ===== Final overrides to enforce desktop navbar behavior ===== */
@media (min-width: 992px) {
  /* Hide hamburger on desktop conclusively */
  .navbar-toggler {
    display: none !important;
  }
  /* Ensure collapse content is visible and flex on desktop */
  .navbar-collapse.collapse,
  .navbar-collapse.show {
    display: flex !important;
    align-items: center !important;
  }
}

.d-flex.align-items-center {
  align-items: center;
  flex-wrap: nowrap !important;
}

.form-check {
  flex-grow: 1;
  align-items: center;
  display: flex;
}

.dropdown {
  flex-shrink: 0;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  padding: 2px 8px;
}

.dropdown-item .opacity-slider-container {
  padding: 10px;
  background-color: #fff;
}

.dropdown-item .form-range {
  width: 100%;
}

.btn-default {
  background-color: #fff;
  border: 1px solid #ccc;
}

#layer-checkboxes .d-flex {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

#layer-checkboxes .form-check {
  margin-bottom: 0 !important;
}

.dropdown-item:hover {
  background-color: #d0d0cd !important; /* رنگ پس‌زمینه آبی روشن */
  color: #ed0606 !important; /* رنگ متن سفید */
  border-radius: 4px; /* گوشه‌های گرد برای ظاهر بهتر */
  transition: background-color 0.2s ease; /* انیمیشن نرم برای تغییر رنگ */
}

.custom-label {
  background-color: transparent; /* پس‌زمینه شفاف */
  color: #151414; /* رنگ متن تیره */
  font-size: 25px; /* اندازه فونت */
  font-weight: bold; /* متن بولد */
  padding: 1px 1px; /* فاصله داخلی */
  pointer-events: none; /* جلوگیری از تداخل با کلیک */
}

#toggle-all-layers {
  margin-right: 5px;
}

#toggle-all-layers + label {
  font-weight: bold;
  color: #1a3c34;
  font-size: 16px;
}

#coordinatedImagePreviewControlOpenButton,
#coordinatedImagePreviewControlCloseButton {
    display: none;
}


.time-display {
    background: #222;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    color: white;
    margin: 0 10px;
    display: inline-block;
    vertical-align: middle;
    line-height: 20px;
    margin-top: 5px;
    padding-top: 15px;
}


.layer-label {
  font-size: 12px;
  font-weight: 600;
  color: #111;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.1);
  padding: 1px 1px;
  border-radius: 3px;
}


/* Responsive Styles - Removed conflicting padding */
/* src/css/app.css یا src/css/loading.css  
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* پس‌زمینه نیمه‌شفاف  
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3; /* رنگ روشن  
  border-top: 4px solid #3498db; /* رنگ اصلی  
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

*/


#loading-mask {
  background-color: rgba(0, 0, 0, 0.5);
}

/* استایل‌های موجود */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* پس‌زمینه نیمه‌شفاف */
  z-index: 9999;
  display: flex;
  flex-direction: column; /* تغییر جهت به عمودی */
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3; /* رنگ روشن */
  border-top: 4px solid #3498db; /* رنگ اصلی */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* استایل پیام */
.loading-message {
  margin-top: 20px; /* فاصله از اسپینر */
  font-size: 24px; /* اندازه فونت */
  color: #fff; /* رنگ متن */
  font-weight: bold; /* متن ضخیم */
  text-align: center;
}

/* انیمیشن اسپینر */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@font-face {
  font-family: Nahid;
  src: url(..//assets/Nahid-FD-WOL.eot);
  src: url(..//assets/Nahid-FD-WOL.eot?#iefix) format('embedded-opentype'),
       url(..//assets/Nahid-FD-WOL.woff) format('woff2'),
       url(..//assets/Nahid-FD-WOL.woff) format('woff'),
       url(..//assets/Nahid-FD-WOL.ttf) format('truetype');
  font-weight: normal;
}


.leaflet-container .leaflet-control-mouseposition {
  background-color: rgba(255, 255, 255, 0.85); /* پس‌زمینه کمی شفاف‌تر برای کنتراست بهتر */
  box-shadow: 0 0 5px #888; /* سایه تیره‌تر برای وضوح بیشتر */
  padding: 2px 8px; /* کمی بیشتر برای خوانایی بهتر */
  margin: 0;
  color: #444343; /* متن تیره‌تر */
  font: bold 16px/2 "Nahid", Arial, Helvetica, sans-serif; /* ضخیم‌تر و کمی بزرگ‌تر */
  border-radius: 4px; /* کمی گردی برای زیباتر شدن */
}

/* .leaflet-container .leaflet-control-mouseposition {
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 5px #bbb;
  padding: 5px;
  color: #333;
  font: 14px/1.5 "Nahid", Arial, Helvetica, sans-serif;
  white-space: nowrap;
  direction: ltr;
} */

/* مخفی کردن مختصات UTM در سایز موبایل */
@media (max-width: 768px) {
  .leaflet-container .leaflet-control-mouseposition {
    /* مخفی کردن کامل در موبایل */
    display: none !important;
  }
}

/* مخفی کردن مختصات UTM در سایز تبلت */
@media (max-width: 1024px) and (min-width: 769px) {
  .leaflet-container .leaflet-control-mouseposition {
    /* نمایش فقط مختصات جغرافیایی بدون UTM */
    font-size: 14px !important;
    padding: 2px 6px !important;
  }
  
  /* مخفی کردن بخش UTM در تبلت */
  .leaflet-container .leaflet-control-mouseposition::after {
    content: "" !important;
  }
}

@font-face {
  font-family: Nahid;
  src: url(..//assets/Nahid-FD-WOL.eot);
  src: url(..//assets/Nahid-FD-WOL.eot?#iefix) format('embedded-opentype'),
       url(..//assets/Nahid-FD-WOL.woff) format('woff2'),
       url(..//assets/Nahid-FD-WOL.woff) format('woff'),
       url(..//assets/Nahid-FD-WOL.ttf) format('truetype');
  font-weight: normal;
}

* {
  direction: rtl;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
}

/* استایل‌های نوار تولبار ویجت‌ها */
.widget-toolbar {
  position: absolute;
  top: 60px; /* زیر ناوبار */
  right: 10px !important;
  left: auto !important;
  background: transparent; /* حذف پس‌زمینه */
  border: none; /* حذف حاشیه */
  border-radius: 0;
  padding: 5px;
  box-shadow: none; /* حذف سایه */
  z-index: 1000;
  display: flex !important;
  visibility: visible !important;
  flex-direction: row; /* تغییر به افقی */
  gap: 8px; /* افزایش فاصله بین دکمه‌ها */
  flex-wrap: wrap; /* برای ریسپانسیو */
  max-width: calc(100vw - 20px); /* محدود کردن عرض */
  transition: all 0.3s ease; /* انیمیشن نرم */
}

.widget-toolbar .widget-button {
  width: 45px;
  height: 45px;
  border: 2px solid #a19a9a; /* حاشیه نازک خاکستری */
  border-radius: 8px;
  background: white; /* پس‌زمینه سفید */
  color: #333;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0; /* جلوگیری از کوچک شدن */
  margin: 0; /* حذف margin اضافی */
}

/* استایل‌های Storage Monitor */
.storage-monitor {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e0e0e0;
  margin-left: 8px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.storage-monitor i {
  margin-left: 4px;
  font-size: 10px;
}

.storage-monitor.storage-normal {
  color: #28a745;
  border-color: #28a745;
}

.storage-monitor.storage-warning {
  color: #ffc107;
  border-color: #ffc107;
  background: rgba(255, 193, 7, 0.1);
}

.storage-monitor.storage-critical {
  color: #dc3545;
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* استایل‌های هدر ویجت */
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.widget-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* سایه ملایم */
}

/* رنگی کردن آیکون‌های ویجت */
.widget-toolbar .widget-button i {
  font-size: 18px;
  transition: color 0.3s ease;
  filter: drop-shadow(0px 1px 1px rgba(0,0,0,0.1)); /* سایه ملایم‌تر */
}

/* رنگ‌های مختلف برای آیکون‌های مختلف */
.widget-toolbar .widget-button[data-widget="maps"] i {
  color: #28a745; /* سبز برای نقشه‌ها */
}

.widget-toolbar .widget-button[data-widget="basemaps"] i {
  color: #6f42c1; /* بنفش برای تصاویر ماهواره */
}

.widget-toolbar .widget-button[data-widget="bookmarks"] i {
  color: #fd7e14; /* نارنجی برای بوک‌مارک */
}

.widget-toolbar .widget-button[data-widget="descriptive-search"] i {
  color: #20c997; /* فیروزه‌ای برای جستجو */
}

.widget-toolbar .widget-button[data-widget="coordinates"] i {
  color: #6610f2; /* بنفش تیره برای مختصات */
}

.widget-toolbar .widget-button[data-widget="measure"] i {
  color: #e83e8c; /* صورتی برای اندازه‌گیری */
}

.widget-toolbar .widget-button[data-widget="draw"] i {
  color: #dc3545; /* قرمز برای ترسیم */
}

.widget-toolbar .widget-button[data-widget="ruler"] i {
  color: #ffc107; /* زرد برای خط‌کش */
}

.widget-toolbar .widget-button[data-widget="output"] i {
  color: #000000; /* مشکی برای پرینت تا با پس‌زمینه سفید دیده شود */
}

.widget-toolbar .widget-button[data-widget="user-panel"] i {
  color: #343a40; /* خاکستری تیره برای کاربر */
}

.widget-toolbar .widget-button[data-widget="settings"] i {
  color: #6c757d; /* خاکستری برای تنظیمات */
}

.widget-toolbar .widget-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: #f8f9fa; /* پس‌زمینه خاکستری روشن در hover */
  border-color: #007bff; /* حاشیه آبی در hover */
}

.widget-toolbar .widget-button.active {
  background: #e3f2fd; /* پس‌زمینه آبی روشن برای active */
  border-color: #2196f3; /* حاشیه آبی برای active */
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(33, 150, 243, 0.3);
}

.widget-toolbar .widget-button.minimized {
  background: #fff3e0; /* پس‌زمینه نارنجی روشن برای minimized */
  border-color: #ff9800; /* حاشیه نارنجی برای minimized */
  transform: scale(0.95);
  opacity: 0.8;
}

.widget-toolbar .widget-button .tooltip {
  position: absolute;
  bottom: -40px; /* زیر دکمه */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 1001;
}

.widget-toolbar .widget-button:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.widget-toolbar .widget-button .tooltip::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.8);
}

/* استایل‌های فرم ویجت */
.widget-form {
  position: fixed;
  top: 120px; /* زیر ناوبار و تولبار */
  right: 20px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  min-width: 320px; /* کاهش عرض */
  max-width: 450px; /* کاهش حداکثر عرض */
  max-height: 70vh; /* کاهش ارتفاع */
  overflow: visible;
  display: none;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.widget-form.dragging {
  cursor: move;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  transform: scale(1.02);
}

.widget-form.minimized {
  display: none !important;
  pointer-events: none !important;
}

.widget-form.active {
  display: block;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.widget-form .form-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px; /* کاهش padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  border-radius: 6px 6px 0 0;
}

.widget-form .form-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  color: white;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
}

.widget-form .form-header .header-buttons {
  display: flex;
  gap: 5px;
}

.widget-form .form-header .minimize-btn,
.widget-form .form-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 14px; /* کاهش اندازه آیکون */
  cursor: pointer;
  padding: 0;
  width: 24px; /* کاهش اندازه */
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.widget-form .form-header .minimize-btn:hover,
.widget-form .form-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.widget-form .form-content {
  padding: 15px; /* کاهش padding */
  max-height: calc(70vh - 60px); /* تطبیق با ارتفاع جدید */
  overflow-y: auto;
  min-height: 150px; /* کاهش حداقل ارتفاع */
  background: white;
  font-size: 14px; /* کاهش اندازه فونت */
}

/* استایل‌های آیکون‌های کوچک شده */
.minimized-widget-icon {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 1500;
  transition: all 0.3s ease;
  transform: scale(0.8);
  animation: minimizeIn 0.3s ease-out forwards;
}

.minimized-widget-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.minimized-widget-icon .minimized-tooltip {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.minimized-widget-icon:hover .minimized-tooltip {
  opacity: 1;
  visibility: visible;
}

/* استایل‌های محتوای داخلی فرم */
.widget-form .large-content {
  width: 100%;
  font-family: 'Vazir', Arial, sans-serif;
}

.widget-form .form-group {
  margin-bottom: 10px; /* کاهش فاصله */
}

.widget-form .form-group label {
  display: block;
  margin-bottom: 3px; /* کاهش فاصله */
  font-weight: bold;
  color: #333;
  font-size: 13px; /* کاهش اندازه فونت */
}

.widget-form .form-group input,
.widget-form .form-group select {
  width: 100%;
  padding: 6px 10px; /* کاهش padding */
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px; /* کاهش اندازه فونت */
}

.widget-form .btn-coordinate,
.widget-form .btn {
  padding: 8px 16px; /* کاهش padding */
  margin: 3px; /* کاهش margin */
  border: none;
  border-radius: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  font-size: 13px; /* کاهش اندازه فونت */
  transition: all 0.3s ease;
}

/* دکمه‌های غیرفعال‌سازی */
.widget-form .btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.widget-form .btn-danger:hover {
  background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%);
  transform: translateY(-1px);
}

/* بهبود ظاهر عناصر فرم */
.widget-form {
  direction: rtl;
  text-align: right;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
}

.widget-form label {
  font-size: 14px !important;
  color: #555 !important;
  font-weight: 500;
  margin-bottom: 5px;
  display: block;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
}

.widget-form input[type="text"],
.widget-form input[type="number"],
.widget-form select {
  font-size: 14px !important;
  padding: 8px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  background: #fff !important;
  transition: border-color 0.3s ease;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
}

.widget-form input[type="text"]:focus,
.widget-form input[type="number"]:focus,
.widget-form select:focus {
  border-color: #667eea !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.widget-form .form-group {
  margin-bottom: 12px;
}

.widget-form p {
  font-size: 13px !important;
  color: #666 !important;
  line-height: 1.4;
  margin: 10px 0;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
}

/* بهبود ظاهر چک‌باکس‌ها */
.widget-form input[type="checkbox"] {
  margin-left: 8px !important;
  transform: scale(1.1);
}

/* بهبود ظاهر لیست لایه‌ها */
.widget-form #toolbar-layer-checkboxes {
  font-size: 14px !important;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
}

/* عرض بیشتر برای فرم نقشه‌ها */
.widget-form[data-widget="maps"] {
  min-width: 450px;
  max-width: 500px;
}

.widget-form[data-widget="maps"] .large-content {
  padding: 15px;
}

/* تنظیمات موبایل برای فرم نقشه‌ها و مختصات */
@media (max-width: 768px) {
  .widget-form[data-widget="maps"],
  .widget-form[data-widget="coordinates"] {
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    right: 10px !important;
    left: 10px !important;
    width: calc(100vw - 20px) !important;
  }
}

@media (max-width: 480px) {
  .widget-form[data-widget="maps"],
  .widget-form[data-widget="coordinates"] {
    min-width: calc(100vw - 10px) !important;
    max-width: calc(100vw - 10px) !important;
    right: 5px !important;
    left: 5px !important;
    width: calc(100vw - 10px) !important;
  }
}

.toggle-all-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.toggle-all-btn:hover {
  background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.toggle-all-btn[data-state="off"] {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.toggle-all-btn[data-state="off"]:hover {
  background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.toggle-all-btn i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.toggle-all-btn[data-state="off"] i {
  transform: rotate(180deg);
}

.widget-form .layer-item {
  margin-bottom: 8px !important;
  padding: 5px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.widget-form .layer-item:hover {
  background-color: #f0f0f0;
}

/* بهبود چیدمان لایه‌ها - سه نقطه در کنار نام */
.widget-form .layer-item .d-flex {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  width: 100%;
  direction: rtl;
}

.widget-form .layer-item .form-check {
  flex: 1;
  display: flex !important;
  align-items: center !important;
  margin-right: 0 !important;
  direction: rtl;
  text-align: right;
}

.widget-form .layer-item .form-check input[type="checkbox"] {
  margin-right: 0 !important;
  margin-left: 8px !important;
  order: 1;
}

.widget-form .layer-item .form-check label {
  order: 2;
  flex: 1;
  text-align: right;
  direction: rtl;
}

.widget-form .layer-item .dropdown {
  flex-shrink: 0;
  margin-right: 8px !important;
  margin-left: 0 !important;
  order: 0;
}

.widget-form .layer-item .dropdown button {
  padding: 4px 6px !important;
  font-size: 14px !important;
  border: 1px solid #ddd !important;
  background: white !important;
  border-radius: 3px !important;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-form .layer-item .dropdown button::before {
  content: "⋮";
  font-size: 16px;
  color: #666;
  line-height: 1;
}

/* بهبود ظاهر دکمه‌های ابزارها */
.widget-form .draw-tools button,
.widget-form .measure-tools button,
.widget-form .ruler-tools button,
.widget-form .print-tools button {
  font-size: 20px !important;
  padding: 12px !important;
  margin: 4px !important;
  min-width: 50px;
  min-height: 50px;
  border-radius: 6px !important;
  transition: all 0.3s ease;
}

.widget-form .draw-tools button:hover,
.widget-form .measure-tools button:hover,
.widget-form .ruler-tools button:hover,
.widget-form .print-tools button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* بهبود ظاهر select ها */
.widget-form .measure-tools select,
.widget-form .ruler-tools select {
  font-size: 14px !important;
  padding: 6px 10px !important;
  margin: 0 5px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  background: white !important;
}

/* بهبود فاصله‌گذاری */
.widget-form .large-content {
  padding: 15px;
}

.widget-form .draw-controls,
.widget-form .measure-tools,
.widget-form .ruler-tools,
.widget-form .print-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
}

/* بهبود ظاهر فرم مختصات */
.widget-form .coordinate-form {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  margin: 10px 0;
  border: 1px solid #e9ecef;
}

.widget-form .coordinate-form .form-group {
  margin-bottom: 10px;
}

.widget-form .coordinate-form label {
  font-size: 13px !important;
  color: #495057 !important;
  margin-bottom: 4px;
}

.widget-form .coordinate-form input {
  font-size: 13px !important;
  padding: 6px 8px !important;
  width: 100% !important;
  max-width: 150px;
}

.widget-form .btn-coordinate {
  font-size: 13px !important;
  padding: 8px 12px !important;
  margin: 8px 4px !important;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.widget-form .btn-coordinate:hover {
  background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
  transform: translateY(-1px);
}

.widget-form .btn-coordinate.btn-tool {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.widget-form .btn-coordinate.btn-tool:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.widget-form .btn-coordinate.btn-delete {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.widget-form .btn-coordinate.btn-delete:hover {
  background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
}

.widget-form .form-spacer {
  height: 15px;
  border-bottom: 1px solid #dee2e6;
  margin: 15px 0;
}

/* بهبود ظاهر تصاویر ماهواره */
.widget-form .basemap-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-form .basemap-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.widget-form .basemap-item:hover {
  background-color: #f8f9fa;
}

.widget-form .basemap-item input[type="radio"] {
  margin-left: 10px;
  margin-right: 0;
}

.widget-form .basemap-item label {
  font-size: 14px !important;
  margin: 0 !important;
  cursor: pointer;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
}

/* بهبود ظاهر دکمه بوکمارک */
.widget-form .bookmark-btn {
  font-size: 16px !important;
  padding: 12px 20px !important;
  font-weight: bold;
  border-radius: 6px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
  width: 100%;
  margin-bottom: 15px;
}

.widget-form .bookmark-btn:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* بهبود تولتیپ دکمه‌های تولبار */
.widget-button[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: "Nahid", Tahoma, Geneva, Verdana, sans-serif;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.widget-button[title]:hover::before {
  content: '';
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.9);
  z-index: 1001;
}

.widget-button {
  position: relative;
}

.widget-form .btn-coordinate:hover,
.widget-form .btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-1px);
}

/* استایل‌های خاص ابزارها */
.widget-form .measure-tools,
.widget-form .draw-tools,
.widget-form .ruler-tools,
.widget-form .print-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.widget-form .coordinate-form {
  border: 1px solid #eee;
  padding: 15px;
  border-radius: 6px;
  margin: 10px 0;
  background: #fafafa;
}

.widget-form .form-spacer {
  height: 20px;
  border-bottom: 1px solid #eee;
  margin: 20px 0;
}

.widget-form .btn-tool {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.widget-form .btn-delete {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.widget-form .user-panel-content {
  text-align: center;
}

.widget-form .layer-item {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.widget-form .layer-item:last-child {
  border-bottom: none;
}

/* استایل‌های ریسپانسیو */
@media (max-width: 768px) {
  .widget-toolbar {
    top: 55px !important;
    right: 5px !important;
    left: auto !important;
    padding: 5px;
    gap: 5px; /* کاهش فاصله */
    flex-wrap: wrap; /* اجازه شکستن به چند سطر */
    justify-content: flex-start; /* سمت راست */
    display: flex !important;
    visibility: visible !important;
  }
  
  .widget-toolbar .widget-button {
    width: 40px;
    height: 40px;
  }
}

/* بهبود نمایش در صفحات کوچک */
@media (max-width: 480px) {
  .widget-toolbar {
    top: 55px !important;
    right: 5px !important;
    left: auto !important;
    padding: 3px;
    gap: 3px; /* کاهش فاصله */
    display: flex !important;
    visibility: visible !important;
    justify-content: space-around; /* توزیع یکنواخت */
    gap: 2px; /* کاهش فاصله */
  }
  
  .widget-toolbar .widget-button {
    width: 35px;
    font-size: 14px;
    margin: 1px;
  }
  
  .widget-toolbar .widget-button .tooltip {
    bottom: -35px;
    font-size: 10px;
    padding: 3px 6px;
  }
  
  .widget-form {
    min-width: calc(100vw - 10px);
    right: 5px;
    left: 5px;
  }
}

/* انیمیشن‌های ورود و خروج */
.widget-form.active {
  animation: slideIn 0.3s ease-out forwards;
}

/* انیمیشن ورود تولبار */
.widget-toolbar {
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.5s ease;
}

.widget-toolbar.toolbar-loaded {
  opacity: 1;
  transform: translateY(0);
}

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

.widget-form.closing {
  animation: slideOut 0.3s ease-in;
  pointer-events: none !important;
}

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

@keyframes minimizeIn {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Toolbar visible on all devices */
@media (max-width: 1024px) {
  .widget-toolbar {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    right: 5px !important;
    left: auto !important;
    top: 55px !important;
  }

  .widget-form,
  .minimized-widget-icon {
    display: block !important;
    visibility: visible !important;
  }
}

