html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--cm-bg, #f5f7fa);
}

body {
  padding-top: var(--cm-map-header-h, 66px) !important;
  font-family: 'Cynetiq', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.map-page {
  background-color: var(--cm-bg, #f5f7fa);
}

/* Modal + tabs — Cynetiq (ported from CropMapApp cropmapping.css) */
.modal-content {
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: none;
  overflow: hidden;
  background: var(--cm-surface);
  color: var(--cm-text);
  font-family: 'Cynetiq', sans-serif;
}

.modal-header {
  background: linear-gradient(135deg, var(--cm-accent-start) 0%, var(--cm-accent-end) 100%);
  color: white;
  border: none;
  padding: 25px 30px;
  position: relative;
}

.modal-header .close {
  color: white;
  opacity: 0.8;
  text-shadow: none;
  font-size: 32px;
  font-weight: 300;
  transition: all 0.3s ease;
}

.modal-header .close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.modal-title {
  font-size: 24px;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  font-family: 'Cynetiq', sans-serif;
  color: #fff;
}

.modal-body {
  padding: 30px;
  background-color: var(--cm-surface);
  color: var(--cm-text);
  font-family: 'Cynetiq', sans-serif;
}

.modal-footer {
  border-top: 1px solid var(--cm-border);
  padding: 20px 30px;
  background-color: var(--cm-surface-2);
  font-family: 'Cynetiq', sans-serif;
}

.nav-tabs {
  border-bottom: 2px solid var(--cm-border);
  margin-bottom: 25px;
  background-color: var(--cm-surface);
  border-radius: 8px 8px 0 0;
  padding: 10px 10px 0 10px;
}

.nav-tabs > li > a {
  color: var(--cm-text-muted);
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
  border: none;
  margin-right: 5px;
  font-family: 'Cynetiq', sans-serif;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: var(--cm-primary);
  background-color: var(--cm-surface);
  border: none;
  border-bottom: 3px solid var(--cm-primary);
  font-weight: 600;
}

/* Atık Kodu Tooltip Stilleri */
.tooltip {
  z-index: 99999 !important;
}

.tooltip-inner {
  max-width: 350px !important;
  padding: 12px 15px !important;
  background-color: rgba(33, 37, 41, 0.95) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3) !important;
  text-align: left !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

.tooltip.top .tooltip-arrow {
  border-top-color: rgba(33, 37, 41, 0.95) !important;
}

.tooltip.bottom .tooltip-arrow {
  border-bottom-color: rgba(33, 37, 41, 0.95) !important;
}

.tooltip.left .tooltip-arrow {
  border-left-color: rgba(33, 37, 41, 0.95) !important;
}

.tooltip.right .tooltip-arrow {
  border-right-color: rgba(33, 37, 41, 0.95) !important;
}

/* Atık türü badge'lerinin hover efekti */
span[data-toggle="tooltip"] {
  transition: all 0.3s ease;
}

span[data-toggle="tooltip"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
}

# Map/table layout is owned by ui.css / mobile.css on map pages.
# Do not force percentage heights or absolute legend offsets here.
body.map-page #map-container,
body.map-page #table-container {
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  border: none;
  background: transparent;
  backdrop-filter: none;
}

body.map-page #table-container #toolbar {
  background: var(--cm-surface, #fff);
  color: var(--cm-text, #1a1a2e);
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--cm-border, #dee2e6);
}

body.map-page #table-container #toolbar .btn {
  background: var(--cm-surface-2, #eef1f5);
  border: 1px solid var(--cm-border, #dee2e6);
  color: var(--cm-text, #1a1a2e);
  font-weight: 500;
  border-radius: 6px;
}

body.map-page #table-container #toolbar .btn:hover {
  background: var(--cm-primary, #667eea);
  border-color: var(--cm-primary, #667eea);
  color: #fff;
  transform: none;
  box-shadow: none;
}

body.map-page #table-container #feature-count {
  color: var(--cm-text-muted, #6c757d);
}

/* Loc selects/buttons are styled by ui.css .cm-loc-bar — keep native chrome out of the way */
body.map-page #Iller2,
body.map-page #Ilceler2,
body.map-page #cropmap_btn,
body.map-page #remotesensing_btn {
  /* reset legacy absolute / glass styles when relocated into header */
  box-shadow: none;
  backdrop-filter: none;
}

#table-container #feature-count {
  color: white;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dropdown-menu {
  font-size: 12px;
  margin: -5px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: none;
}

#map {
  height: 100%;
  border-radius: 12px;
}

#table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

#table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

#table thead th {
  border: none !important;
  font-weight: 500;
  padding: 12px 8px;
  font-size: 13px;
}

#table tbody tr {
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#table tbody tr:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#table tbody td {
  padding: 10px 8px;
  vertical-align: middle;
  font-size: 12px;
}

#loading-mask {
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed !important;
  top: var(--cm-map-header-h, 66px) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: auto !important;
  z-index: 900 !important;
}

#loading-mask[aria-hidden="true"],
#loading-mask.is-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.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 {
  right: 9px;
  top: -6px;
  padding: 6px 8px;
  font:
    14px/16px Arial,
    Helvetica,
    sans-serif;
  background: white;
  background: rgba(255, 255, 255);
  box-shadow: 0 0 15px rgba(0, 0, 0);
  border-radius: 5px;
}

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

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

.leaflet-control-layers-selector {
  top: 0px;
}

.navbar .navbar-brand {
  font-weight: bold;
  font-size: 25px;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  height: 60px;
  line-height: 30px;
  padding: 15px 20px;
}

.dropdown-menu > li > a:hover {
  background-color: var(--cm-primary, #667eea);
  color: white;
}

/* ===== NAVBAR STYLES ===== */
.navbar-inverse {
  background: linear-gradient(135deg, var(--cm-accent-start, #667eea) 0%, var(--cm-accent-end, #764ba2) 100%) !important;
  background-color: transparent !important;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  min-height: var(--cm-map-header-h, 66px);
}

.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
  border-color: transparent !important;
}

.navbar-inverse .navbar-toggle {
  border-color: rgba(255, 255, 255, 0.3);
}

.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
  background-color: rgba(255, 255, 255, 0.15);
}

.navbar {
  background: linear-gradient(135deg, var(--cm-accent-start, #667eea) 0%, var(--cm-accent-end, #764ba2) 100%) !important;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  min-height: var(--cm-map-header-h, 66px);
}

.navbar-nav>li {
  display: flex;
  align-items: center;
}

/* Mobile hamburger: full-width stacked menu buttons (CropMap-style) */
@media (max-width: 767px) {
  body.map-page .navbar-nav > li {
    display: block !important;
    width: 100% !important;
  }

  body.map-page .navbar-nav > li > a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

.navbar-nav>li>a {
  color: rgba(255, 255, 255, 0.9) !important;
  transition: all 0.3s ease;
  padding: 20px 20px !important;
  font-size: 14px;
  font-weight: 500;
  height: 60px;
  display: flex;
  align-items: center;
  line-height: 1;
}

.navbar-nav>li>a:hover {
  color: white !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 6px;
}

.navbar-toggle {
  border-color: rgba(255, 255, 255, 0.3) !important;
  margin-top: 13px;
}

.navbar-toggle:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.navbar-toggle .icon-bar {
  background-color: white !important;
}

.navbar-collapse {
  max-height: none !important;
}

@media (max-width: 767px) {
  .navbar-nav {
    margin: 7.5px 0;
  }

  .navbar-nav>li>a {
    padding: 12px 15px !important;
    height: auto;
  }
}

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

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

@media (max-width: 992px) {
  .navbar .navbar-brand {
    font-size: 18px;
  }

  body {
    overflow-y: auto;
  }

  .fixed-table-toolbar {
    display: block !important;
  }

  .fixed-table-container {
    padding-bottom: 15px !important;
  }
}

@media (max-width: 768px) {
  .modal-dialog {
    margin: 10px;
  }

  .modal-body {
    padding: 15px;
  }
}

@media print {
  .navbar {
    display: none !important;
  }

  .leaflet-control-container {
    display: none !important;
  }
}

#Iller2,
#Ilceler2 {
  font-family: inherit;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 10px 15px;
  text-align: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  font-weight: 500;
}

/* Relocated into .cm-nav-actions via ui.js — do not float over the map */
#Iller2,
#Ilceler2 {
  position: static;
}

#Iller2:focus,
#Ilceler2:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

#Iller2:hover,
#Ilceler2:hover {
  border-color: #667eea;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#cropmap_btn,
#remotesensing_btn {
  height: 40px;
  min-width: 110px;
  width: auto;
  padding: 0 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: inherit;
  color: white;
  border: none;
  border-radius: 8px;
  outline: none;
  position: static;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
}

#remotesensing_btn:hover,
#cropmap_btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

#remotesensing_btn:active,
#cropmap_btn:active {
  transform: translateY(0);
}

/* Legend Stilleri */
.legend {
  background: white;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  padding: 10px;
  font:
    12px/14px Arial,
    Helvetica,
    sans-serif;
  max-width: 200px;
}

.legend h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 8px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}

.legend-label {
  font-size: 11px;
  color: #333;
  line-height: 1.2;
}

/* Company Popup Stilleri */
.company-popup {
  max-width: 300px;
}

.company-popup h4 {
  margin: 0 0 10px 0;
  color: #2e86ab;
  font-size: 16px;
}

.company-popup p {
  margin: 5px 0;
  font-size: 13px;
}

.company-popup strong {
  color: #333;
}