:root {
  --brand: #0045ad;
  --bg-dim: rgba(0, 0, 0, 0.8);
  --card-bg: #fff;
  --text: #111;
  --muted: #666;
  --error: #d93025;
  --radius: 8px;
  --shadow: 0 0 24px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
   --table-height: 300px;   
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  padding: 0;
}

.app-hidden {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

.app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.app-loader.is-hidden {
  display: none;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #ccc;
  border-top-color: #4287f5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#particles-js {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: var(--card-bg);
  color: var(--text);
  width: min(520px, 92vw);
  max-width: 560px;
  min-width: 300px;
  padding: 24px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  font-family: var(--font);
}

.login-title {
  margin: 0 0 12px 0;
  font-size: 22px;
  font-weight: 700;
}

.login-input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #ccc;
  outline: none;
  font-family: inherit;
  font-size: 14px;
}

.login-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 69, 173, 0.12);
}

.login-error {
  color: var(--error);
  margin-top: 6px;
  font-size: 13px;
}

.login-btn {
  width: 100%;
  padding: 11px;
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  margin-top: 8px;
}

.login-btn:hover {
  filter: brightness(1.05);
}

.login-btn:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .login-card {
    width: 90%;
  }
}

.header-container {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0045ad 0%, #0066cc 100%);
  padding: 10px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #fff;
  z-index: 1000;
}

.logo-box {
  margin-right: 20px;
}

.logo-box img {
  height: 60px;
  display: block;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box input {
  width: 300px;
  padding: 8px 16px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #3c83f2;
  outline: none;
}

#suggestionList {
  position: absolute;
  top: 105%;
  left: 0;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0;
  margin-top: 5px;
  list-style: none;
  display: none;
  z-index: 100000!important;
}

#suggestionList li {
  padding: 10px 16px;
  cursor: pointer;
  color: #0045ad;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

#suggestionList li:hover {
  background: #f0f4ff;
}

.view-toggle {
  margin-left: 20px;
}

.view-toggle button {
  background-color: #3c83f2;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.view-toggle button:hover {
  background-color: #2d6cd1;
}

#appRoot {
  height: 100vh;
}

#map {
  position: relative;
  height: calc(100vh - 80px);
  width: 100%;
}

#map.isTableShown {
  height: calc(100vh - 80px - var(--table-height));
  top: 0;
  z-index: 12312;
}
#buttons.isTableShown {
  bottom: calc(var(--table-height) + 20px);
}

#toolbar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

#toolbar button {
  border: none;
  width: 40px;
  height: 40px;
  box-shadow: 0 2px 3px #00000032;
  font-size: 1rem;
}

#advancedTableContainer {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--table-height);
  max-height: 60vh;
  min-height: 150px;
  background: #fff;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  z-index: 1500;
  border-top: 1px solid #ddd;
  overflow: hidden;
}
.table-resize-handle {
  height: 6px;
  cursor: row-resize;
  background: #ddd;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
}
#tableHeader {
  position: sticky;
  top: 6px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  background: #f9f9f9;
  border-bottom: 1px solid #ccc;
  font-size: 14px;
}

#tableHeader button ,#filterSection button {
  background: #0045ad;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  margin-left: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

#tableHeader button:hover {
  background: #003380;
}



.table-close-btn {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.table-close-btn:hover {
  color: #d00;
}

#columnsPanel {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  padding: 10px;
  z-index: 123123;
}

#tableScrollWrapper {
  height: calc(100% - 6px - 40px);
  overflow-y: auto;
  overflow-x: auto;
  padding-bottom: 5px;
}

#customTable {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

#customTable thead tr:nth-child(1) th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #e9eef9;
  color: #000;
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}

#customTable thead tr:nth-child(2) th {
  position: sticky;
  top: 28px;
  z-index: 4;
  background: #0045ad;
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  white-space: nowrap;
}

#customTable td {
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: center;
}

#customTable tr:nth-child(even) {
  background: #f8f8f8;
}

#customTable tr:hover {
  background: #eaf1ff;
}

/* Measurement nəticələri pəncərəsi - sol tərəfdə */
#measurementResults {
  position: absolute;
  bottom: 200px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: none;
  min-width: 200px;
  z-index: 20000;
}

#colorInfoPanel {
  position: absolute;
  display: none;
  right: 20px;
  top: 90px;
  background: linear-gradient(135deg, #0045ad 0%, #0066cc 100%);
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  max-width: 500px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  z-index: 20000;
  overflow: hidden;
}

#colorInfoPanel strong {
  color: white;
  font-size: 16px;
  display: block;
  padding: 14px 16px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.1);
}

#colorInfoContent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  max-height: 400px;
  overflow-y: auto;
}

#colorInfoContent::-webkit-scrollbar {
  width: 6px;
}

#colorInfoContent::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

#colorInfoContent::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#colorInfoContent::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.color-legend-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.color-legend-item:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.color-legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 2px solid rgba(0,0,0,0.1);
  margin-right: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
}


.buttons {
  width: 100%;
  position: fixed;
  z-index: 121233;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buttons > div {
  margin-right: 10px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #0045ad 0%, #0066cc 100%);
  box-shadow: 0 4px 8px rgba(0, 69, 173, 0.3);
  border-radius: 50%;
  transition: all .3s cubic-bezier(0.075, 0.82, 0.165, 1);
  position: relative;
}

.buttons > div .title {
  position: absolute;
  top: -70%;
  visibility: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 6px 14px;
  left: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(-50%);
  border-radius: 8px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

.buttons > div:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(0, 69, 173, 0.4);
}

.buttons > div:hover .title {
  visibility: visible;
}

.buttons > div.coords {
  width: max-content;
  border-radius: 12px;
  text-align: center;
  padding: 10px 30px;
  padding-top: 15px;
  color: #fff;
  background: linear-gradient(135deg, #0045ad 0%, #0066cc 100%);
}

.buttons > div a {
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: block;
  position: relative;
}

.buttons > div a img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#srDiv {
  height: 40px;
  padding: 10px;
}

.display-flex {
  display: flex;
}

.align-item-center {
  align-items: center;
}

.padding-10-20 {
  padding: 10px 20px;
}

.border-radius-100 {
  border-radius: 100px;
}

.padding-left-50 {
  padding-left: 50px;
}

.z-index-2 {
  z-index: 2;
}

.justify-content-space-bet {
  justify-content: space-between;
}

.justify-content-center {
  justify-content: center;
}

.postion-absolute {
  position: absolute;
}

.position-relative {
  position: relative;
}

.position-fixed {
  position: fixed;
}

.background-white {
  background-color: white;
}

.padding-8 {
  padding: 8px;
}

.border-radius {
  border-radius: 50%;
}

.margin-right {
  margin-right: 7%;
}

.full-screen {
  margin-left: 500px;
}

.layer-list {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  width: 22%;
  min-width: 280px;
  max-width: 350px;
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  position: fixed;
  top: 90px;
  right: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 69, 173, 0.1);
}

.layer-list.show {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  z-index: 123123;
}

.layer-list button {
  padding: 6px 12px;
  border: none;
  background-color: #f0f0f0;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.layer-list button:hover {
  background-color: #e0e0e0;
  transform: translateY(-1px);
}

/* Filter Selector */
.filter-selector {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.filter-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: white;
  user-select: none;
  transition: all 0.2s ease;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-radio:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.filter-radio input[type="radio"] {
  cursor: pointer;
  width: 20px;
  height: 20px;
  accent-color: white;
  margin: 0;
  flex-shrink: 0;
}

.filter-radio input[type="radio"]:checked + span {
  font-weight: 600;
}

.filter-radio span {
  cursor: pointer;
  white-space: nowrap;
}

.layer-header {
  background: linear-gradient(135deg, #0045ad 0%, #0066cc 100%);
  color: white;
  padding: 0;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 69, 173, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.header-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.close-btn {
  cursor: pointer;
  font-size: 22px;
  font-weight: 300;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: white;
  background: transparent;
  padding: 0;
  border: none;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.close-btn:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.95);
}

.layer-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e8e8e8;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: white;
}

.layer-item:hover {
  background: linear-gradient(90deg, #f0f7ff 0%, #ffffff 100%);
  padding-left: 20px;
}

.layer-item:last-child {
  border-bottom: none;
}

.layer-item input {
  margin-right: 12px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #0045ad;
}

.layer-item label {
  flex: 1;
  cursor: pointer;
  font-weight: 500;
  color: #333;
}

.nested {
  margin-left: 24px;
  display: none;
  padding-left: 8px;
  border-left: 2px solid #e0e0e0;
}

.nested.show {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toggle-btn {
  cursor: pointer;
  margin-right: 10px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  border-radius: 4px;
  background: rgba(0, 69, 173, 0.1);
  color: #0045ad;
  font-weight: bold;
}

.toggle-btn:hover {
  background: rgba(0, 69, 173, 0.2);
}

.toggle-btn.open {
  transform: rotate(90deg);
  background: #0045ad;
  color: white;
}

#coordinateDisplay {
  background-color: #0045ad;
  border-radius: 20px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 14px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 30px;
}

#coordinateDisplay span {
  font-family: Arial, sans-serif;
}

/* ArcGIS Popup Müasir Dizayn */
.esri-popup__main-container {
  border-radius: 12px !important;
  box-shadow: none !important;
  overflow: hidden !important;
  width: 480px !important;
  max-width: 95vw !important;
  max-height: 45vh !important;
  min-height: 350px !important;
  border: none !important;
}

.esri-popup__header {
  background: linear-gradient(135deg, #0045ad 0%, #0066cc 100%) !important;
  padding: 20px !important;
  border: none !important;
}

.esri-popup__header-title {
  color: white !important;
  font-size: 20px !important;
  font-weight: 600 !important;
}

.esri-popup__content {
  padding: 0 !important;
  max-height: 45vh !important;
  overflow-y: auto !important;
  border: none !important;
}

.esri-popup__button {
  background: transparent !important;
  color: white !important;
}

.esri-popup__button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.esri-popup__pointer {
  background: #0045ad !important;
}

.esri-popup__pointer-direction {
  background: #0045ad !important;
}

/* Popup scroll bar */
.esri-popup__content::-webkit-scrollbar {
  width: 8px;
}

.esri-popup__content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.esri-popup__content::-webkit-scrollbar-thumb {
  background: #0045ad;
  border-radius: 4px;
}

.esri-popup__content::-webkit-scrollbar-thumb:hover {
  background: #003580;
}

.esri-ui-corner .esri-component > .esri-widget--panel,
.esri-ui-corner .esri-component.esri-widget--panel {
  width: 300px !important;
  position: relative;
  top: -60px !important;
}

.esri-ui-inner-container .esri-ui-corner-container > .esri-ui-top-left .esri-ui-corner {
  margin-top: 200px !important;
}

/* Popup Tabs Styling */
.popup-tabs-container {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  background: linear-gradient(to bottom, #fafafa, #f5f5f5);
  position: relative;
  z-index: 100;
  padding: 0;
  margin: 0;
}

.popup-tab-btn {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  position: relative;
  text-align: center;
  letter-spacing: 0.3px;
}

.popup-tab-btn:hover {
  background: rgba(0, 69, 173, 0.05);
  color: #0045ad;
}

.popup-tab-btn.active {
  color: #0045ad;
  border-bottom-color: #0045ad;
  background: white;
  font-weight: 700;
}

.popup-tab-content {
  display: none;
  padding: 18px;
  animation: fadeIn 0.3s ease;
}

.popup-tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.popup-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.popup-field {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
  border-left: 3px solid #0045ad;
  transition: all 0.2s ease;
}



.popup-field-label {
  font-size: 10px;
  font-weight: 700;
  color: #0045ad;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.popup-field-value {
  font-size: 13px;
  color: #333;
  word-break: break-word;
  line-height: 1.5;
  font-weight: 500;
}

/* Popup Tab 1 - Esas Məlumatlar Styling */
.popup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.popup-field-box {
  padding: 10px;
  border-radius: 6px;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.popup-field-box-label {
  font-size: 10px;
  opacity: 0.85;
  margin-bottom: 3px;
}

.popup-field-box-value {
  font-size: 13px;
  font-weight: 600;
}

.popup-full-width-field {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  border-left: 3px solid #0045ad;
}

.popup-full-width-field-label {
  font-size: 10px;
  color: #333;
  margin-bottom: 3px;
}

.popup-full-width-field-value {
  font-size: 12px;
  color: #333;
  line-height: 1.4;
}

/* Popup Field Box Gradients */
.gradient-purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-pink {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-cyan {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-green {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.gradient-coral {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.gradient-peach {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.gradient-teal {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}
