/* ===== TOGGLE BUTTON CSS - TÜM TOGGLE BUTTON STİLLERİ ===== */

/* Sidebar Toggle Button temel stilleri sidebar.css'de */

/* Sidebar Toggle Button in Topbar */
.tkgm-topbar .sidebar-toggle-btn {
  display: flex !important;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: center;
  justify-content: center;
}

.sidebar.active ~ .tkgm-topbar .sidebar-toggle-btn {
  display: none !important;
}

.sidebar .sidebar-toggle-btn {
  display: none !important;
}

.sidebar.active .sidebar-header-tkgm .sidebar-toggle-btn {
  display: flex !important;
}

/* Sidebar Toggle Button States */
#sidebar-toggle {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  display: flex !important;
}

.sidebar.active ~ #sidebar-toggle {
  display: none !important;
}

/* Close Button */
.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  position: absolute;
  right: 19px;
  top: 12px;
  transition: background 0.15s, transform 0.17s;
  padding: 2px 7px;
  border-radius: 8px;
  z-index: 1200002;
}

.close-btn:hover {
  background: #1c273e22;
  transform: scale(1.18) rotate(90deg);
}

/* Genel Toggle Button Stilleri */
.toggle-btn {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  color: #212529;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 4px 10px;
  min-width: 40px;
  font-weight: 600;
  font-family: 'Inter', 'Poppins', Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  margin: 2px;
  font-size: 0.88em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible !important;
  flex-shrink: 0;
  cursor: pointer;
  text-align: center;
  opacity: 1;
  visibility: visible;
}

.toggle-btn:hover {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #fff;
  border-color: #007bff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
  opacity: 1;
  visibility: visible;
}

/* ===== UNIFIED ACTION BAR ===== */
/* Tek bar - Pro mod (lacivert) varsayılan, Basit mod (.mode-simple) beyaz */

/* Unified bar container */
#top-button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  padding: 2px 4px;
  margin: 0;
  width: 100%;
  max-width: 100%;
}

#top-button-container .toggle-btn,
#top-button-container .parameters {
  margin: 2px;
  flex-shrink: 0;
}

/* --- PRO MOD (lacivert tema - varsayılan) --- */
#top-button-container:not(.mode-simple) .toggle-btn,
#top-button-container:not(.mode-simple) .parameters {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  color: #e2e8f0;
  border: 1px solid #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#top-button-container:not(.mode-simple) .toggle-btn:hover,
#top-button-container:not(.mode-simple) .parameters:hover {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  color: #fff;
  border-color: #64748b;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

#top-button-container:not(.mode-simple) .toggle-btn.active,
#top-button-container:not(.mode-simple) .parameters.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* --- BASİT MOD (beyaz tema - .mode-simple) --- */
#top-button-container.mode-simple .toggle-btn,
#top-button-container.mode-simple .parameters {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  color: #212529;
  border: 2px solid #e9ecef;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#top-button-container.mode-simple .toggle-btn:hover,
#top-button-container.mode-simple .parameters:hover {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #fff;
  border-color: #007bff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

#top-button-container.mode-simple .toggle-btn.active,
#top-button-container.mode-simple .parameters.active {
  background: linear-gradient(135deg, #4a90e2 0%, #1e3a8a 100%);
  border-color: #1e3a8a;
  color: white;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

/* Ada Parsel Sorgu — toolbar'ın solunda sabit kalsın, kaydırma ile kaybolmasın */
#proAdaParselSorguBtn.pp-ada-parsel-toolbar-btn {
  flex-shrink: 0 !important;
  position: sticky !important;
  left: 0 !important;
  z-index: 3 !important;
  min-width: max-content !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#top-button-container.mode-simple #proAdaParselSorguBtn.pp-ada-parsel-toolbar-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #fff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
}

#top-button-container:not(.mode-simple) #proAdaParselSorguBtn.pp-ada-parsel-toolbar-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  color: #fff !important;
  border-color: #60a5fa !important;
}

#proAdaParselSorguBtn.pp-ada-parsel-toolbar-btn:hover {
  filter: brightness(1.06);
}

/* Button separator (ayraç çizgisi) */
.btn-separator {
  width: 1px;
  height: 20px;
  background: #dee2e6;
  margin: 0 2px;
  flex-shrink: 0;
}

/* Pro mod separator */
#top-button-container:not(.mode-simple) .btn-separator {
  background: #475569;
}

/* Basit mod separator */
#top-button-container.mode-simple .btn-separator {
  background: #dee2e6;
}

/* Üst menü geçiş animasyonları */
.topbar-menu { align-items: center; gap: 6px; }
.topbar-menu.animate-in { animation: topbarFadeDown 260ms ease forwards; }
.topbar-menu.animate-out { animation: topbarFadeUp 220ms ease forwards; }

@keyframes topbarFadeUp {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}
@keyframes topbarFadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Pop-in (fade + scale) - modern ve sade */
.topbar-menu .toggle-btn,
#top-button-container .toggle-btn {
  transform-origin: top center;
  transition: transform 260ms cubic-bezier(.22,.61,.36,1), opacity 220ms ease, box-shadow 240ms ease;
}

/* Toggle Button Icons */
.toggle-btn i {
  font-size: 1.1em;
  display: inline-block;
  color: inherit;
}
.toggle-btn.active {
  background: linear-gradient(135deg, #4a90e2 0%, #1e3a8a 100%);
  border-color: #1e3a8a;
  color: white;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

/* Clear button should not keep the shared active background. */
#top-button-container.mode-simple #action-bar-refresh-btn.active,
#top-button-container.mode-simple #action-bar-refresh-btn:active {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%) !important;
  color: #212529 !important;
  border-color: #e9ecef !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

#top-button-container:not(.mode-simple) #action-bar-refresh-btn.active,
#top-button-container:not(.mode-simple) #action-bar-refresh-btn:active {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Geolocation buttons: active state override (takip açıkken) */
.geo-btn.active,
.geo-btn[aria-pressed="true"],
#top-button-container .geo-btn.active,
#top-button-container .geo-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgb(40, 167, 69) 0%, rgb(32, 201, 151) 100%) !important;
  color: #fff !important;
  border-color: rgba(32, 201, 151, 0.85) !important;
  box-shadow: 0 2px 10px rgba(32,201,151,0.35) !important;
}

/* Geolocation buttons: passive state - basit mod */
#top-button-container.mode-simple .geo-btn:not(.active)[aria-pressed="false"] {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  color: #212529;
  border-color: #e9ecef;
}

/* Measurement Buttons (Cetvel ve Alan Ölçümü) */
.measurement-btn {
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Measurement butonları hover (sadece aktif DEĞİLse) */
.measurement-btn:hover:not(.active) {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  border-color: #4f46e5 !important;
  color: #fff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3), 0 4px 6px -2px rgba(99, 102, 241, 0.2) !important;
}

/* Cetvel butonu aktif durumu (mavi) - !important ile zorla */
.measurement-btn[data-action="toggle-ruler"].active {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
  border-color: #2563EB !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

/* Cetvel butonu aktif + hover (daha parlak mavi) */
.measurement-btn[data-action="toggle-ruler"].active:hover {
  background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%) !important;
  border-color: #3B82F6 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5) !important;
}

/* Alan ölçüm butonu aktif durumu (turuncu) - !important ile zorla */
.measurement-btn[data-action="toggle-area"].active {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%) !important;
  border-color: #EA580C !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4) !important;
}

/* Alan ölçüm butonu aktif + hover (daha parlak turuncu) */
.measurement-btn[data-action="toggle-area"].active:hover {
  background: linear-gradient(135deg, #FB923C 0%, #F97316 100%) !important;
  border-color: #F97316 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.5) !important;
}

/* Silgi butonu özel stili (kırmızı) */
.measurement-btn[data-action="clear-measurements"] {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border-color: #e9ecef;
  color: #212529;
}

.measurement-btn[data-action="clear-measurements"]:hover {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  border-color: #DC2626;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.2);
}

/* Silgi butonu asla aktif durumuna geçmez */
.measurement-btn[data-action="clear-measurements"].active {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border-color: #e9ecef;
  color: #212529;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Silgi butonu SVG ikonu */
.measurement-btn[data-action="clear-measurements"] svg {
  fill: #212529;
}

.measurement-btn[data-action="clear-measurements"]:hover svg {
  fill: #ffffff;
}

/* Silgi butonu aktif olsa bile normal görünsün */
.measurement-btn[data-action="clear-measurements"].active svg {
  fill: #212529;
}

/* Pro mod için silgi butonu - koyu arka plan üzerinde açık renkli */
#top-button-container:not(.mode-simple) .measurement-btn[data-action="clear-measurements"] {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  border-color: #475569;
  color: #e2e8f0;
}

#top-button-container:not(.mode-simple) .measurement-btn[data-action="clear-measurements"]:hover {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  border-color: #DC2626;
  color: #fff;
}

#top-button-container:not(.mode-simple) .measurement-btn[data-action="clear-measurements"] svg {
  fill: #e2e8f0;
}

#top-button-container:not(.mode-simple) .measurement-btn[data-action="clear-measurements"]:hover svg {
  fill: #ffffff;
}

/* Ölçüm butonları SVG ikonları */
.measurement-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.measurement-btn:hover svg,
.measurement-btn.active svg {
  fill: currentColor;
}

/* Curve Button Toggle */
.curveButton.toggle-btn { 
  padding: 10px 10px 6px 10px; 
  font-size: 0.97em;
}

/* Responsive Design for Toggle Buttons */
@media (max-width: 700px) {
  .sidebar-toggle-btn,
  .close-btn {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
}

@media (max-width: 600px) {
  #top-button-container .toggle-btn {
    min-width: 36px;
    font-size: 0.9em;
    padding: 6px 8px;
    overflow: visible !important;
  }
}

@media (max-width: 400px) {
  #top-button-container .toggle-btn {
    width: 32px;
    height: 32px;
    padding: 6px;
    font-size: 12px;
  }
}

/* === Gelişmiş Topbar için Sağdaki Kaydırmalı Anahtar === */
#top-advanced-switch {
  position: fixed;
  top: 60px; /* tkgm-topbar yüksekliğiyle hizalı */
  right: 12px;
  z-index: 2000001; /* topbar ve toolbar üstünde, sidebar altında */
  width: 58px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%); /* Kapalı: kırmızı */
  box-shadow: 0 2px 10px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 0;
  display: none !important; /* Varsayılan: TKGM modunda gizli ve JS gösteremesin */
}

#top-advanced-switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transform: translateX(0);
  transition: transform 200ms ease;
}

#top-advanced-switch.on {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%); /* Açık: yeşil */
}

#top-advanced-switch.on .knob {
  transform: translateX(30px);
}

/* === Unified Topbar tema geçiş animasyonu === */
#top-button-container {
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  will-change: auto;
  box-sizing: border-box;
}

/* === Topbar Dropdown stilleri sidebar.css'e taşındı === */

/* Sorgularım alt menüsü - burada özel stiller */
#my-queries-submenu .dropdown-menu {
  left: auto;
  right: 100%;
  top: 0;
  min-width: 320px;
}

.topbar-dropdown #myQueriesList {
  max-height: 80vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.topbar-dropdown #myQueriesList .toggle-btn.has-del {
  position: relative;
  padding-right: 28px;
}

.topbar-dropdown #myQueriesList .query-del {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  line-height: 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  user-select: none;
}

.topbar-dropdown #myQueriesList .query-del:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar-dropdown .dropdown-menu .toggle-btn {
  width: 100%;
  justify-content: flex-start;
  margin: 0;
  box-sizing: border-box;
  font-family: var(--pp-font-body, 'IBM Plex Sans', sans-serif) !important;
  font-weight: 400 !important;
  font-size: 11px !important;
  padding: 6px 10px !important;
}

.topbar-dropdown .dropdown-menu .toggle-btn span {
  font-weight: 400 !important;
  font-size: 11px !important;
}

.topbar-dropdown .dropdown-menu .toggle-btn i,
.topbar-dropdown .dropdown-menu .toggle-btn svg {
  font-size: 12px !important;
  width: 14px !important;
  height: 14px !important;
}

/* Unified Bar Butonları - Hem Basit hem Pro modda aynı boyut */
nav#top-menu-bar #top-button-container .toggle-btn,
nav#top-menu-bar #top-button-container .parameters,
nav#top-menu-bar #top-button-container .action-bar-link,
#top-button-container > .toggle-btn,
#top-button-container > .parameters,
#top-button-container > a.toggle-btn {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  min-width: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2px 6px !important;
  font-family: var(--pp-font-body, 'IBM Plex Sans', sans-serif) !important;
  font-weight: 400 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  gap: 3px !important;
  cursor: pointer !important;
  user-select: none !important;
  white-space: nowrap !important;
}

nav#top-menu-bar #top-button-container .toggle-btn span,
nav#top-menu-bar #top-button-container .parameters span,
nav#top-menu-bar #top-button-container .action-bar-link span,
#top-button-container > .toggle-btn span,
#top-button-container > .parameters span,
#top-button-container > a.toggle-btn span {
  font-weight: 400 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}

nav#top-menu-bar #top-button-container .toggle-btn i,
nav#top-menu-bar #top-button-container .parameters i,
#top-button-container > .toggle-btn i,
#top-button-container > .parameters i {
  font-size: 11px !important;
}

nav#top-menu-bar #top-button-container .toggle-btn svg,
nav#top-menu-bar #top-button-container .parameters svg,
#top-button-container > .toggle-btn svg,
#top-button-container > .parameters svg {
  width: 14px !important;
  height: 14px !important;
}

/* Action Bar Link Butonları (hamburger menüden taşınan linkler) */
.action-bar-link {
  text-decoration: none !important;
  white-space: nowrap;
}

/* Action bar - 3D Harita, Sokak Görüntüsü, Görüntü Al, Hisseli Parsellere Böl, 3D Model, Mahalle Bilgileri, Fiyat Haritası
   Tıklamada ( :active ) ve .active sınıfında aktif renk alamaz */
#top-button-container .map-3d-toggle,
#top-button-container #street-view-menu-btn,
#top-button-container #pp-screenshot-map-btn,
#top-button-container #hisseli-parsel-btn,
#top-button-container .action-bar-link {
  /* :active - tıklama anında varsayılan görünüm korunur */
}
#top-button-container .map-3d-toggle:active,
#top-button-container #street-view-menu-btn:active,
#top-button-container #pp-screenshot-map-btn:active,
#top-button-container #hisseli-parsel-btn:active,
#top-button-container .action-bar-link:active {
  /* Pro mod - varsayılan lacivert renk */
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  transform: none !important;
}
#top-button-container.mode-simple .map-3d-toggle:active,
#top-button-container.mode-simple #street-view-menu-btn:active,
#top-button-container.mode-simple #pp-screenshot-map-btn:active,
#top-button-container.mode-simple #hisseli-parsel-btn:active,
#top-button-container.mode-simple .action-bar-link:active {
  /* Basit mod - varsayılan beyaz renk */
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%) !important;
  color: #212529 !important;
  border-color: #e9ecef !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  transform: none !important;
}
#top-button-container:not(.mode-simple) .map-3d-toggle.active,
#top-button-container:not(.mode-simple) #street-view-menu-btn.active,
#top-button-container:not(.mode-simple) #pp-screenshot-map-btn.active,
#top-button-container:not(.mode-simple) #hisseli-parsel-btn.active,
#top-button-container:not(.mode-simple) .action-bar-link.active {
  /* .active sınıfı - Pro modda lacivert kalır (mavi aktif renk yok) */
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}
#top-button-container.mode-simple .map-3d-toggle.active,
#top-button-container.mode-simple #street-view-menu-btn.active,
#top-button-container.mode-simple #pp-screenshot-map-btn.active,
#top-button-container.mode-simple #hisseli-parsel-btn.active,
#top-button-container.mode-simple .action-bar-link.active {
  /* .active sınıfı - Basit modda beyaz kalır (mavi aktif renk yok) */
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%) !important;
  border-color: #e9ecef !important;
  color: #212529 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Parametreler Dropdown İçindeki Butonlar */
[data-role="param-menu"] button,
[data-role="param-view-menu"] button,
[data-role="param-roads-menu"] button,
[data-role="param-list"] button,
.submenu-parent {
  font-family: var(--pp-font-body, 'IBM Plex Sans', sans-serif) !important;
  font-weight: 400 !important;
  font-size: 12px !important;
}

[data-role="param-menu"] .param-label,
[data-role="param-view-menu"] .param-label,
[data-role="param-roads-menu"] .param-label,
[data-role="param-list"] .param-label {
  font-weight: 400 !important;
  font-size: 12px !important;
}

/* Parametreler ana buton */
[data-role="param-toggle"] {
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  cursor: pointer !important;
  user-select: none !important;
}

/* Span elementi için toggle-btn ve pro-btn stillerini zaten miras alır */

/* Parametreler dropdown menü - görünürlük ve z-index garantisi */
[data-role="parameters-dropdown"] {
  position: relative !important;
  display: inline-block !important;
  overflow: visible !important;
  z-index: 999999 !important; /* En üstte olmalı */
  /* Hover köprüsü: buton ile menü arasındaki boşluğu kapsamak için padding */
  padding-bottom: 6px !important;
  margin-bottom: -6px !important; /* Görsel boşluk yaratmamak için negatif margin */
}

/* Parent container'ların overflow'unu override et */
#top-button-container,
.pp-toolbar {
  overflow: visible !important;
  overflow-y: visible !important; /* Menü görünsün */
}

/* Ana harita (index): toolbar tek satır — wrap yüzünden yükseklik şişmesini engelle */
body.pp-app #top-button-container {
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start;
  max-height: 44px;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: thin;
}

body.pp-app #top-button-container::-webkit-scrollbar {
  height: 4px;
}

body.pp-app nav#top-menu-bar.pp-toolbar {
  max-height: 48px;
  align-items: center;
}

/* Parametreler menü - default hidden (en yüksek specificity ile override edilebilir) */
div[data-role="param-menu"],
[data-role="parameters-dropdown"] > [data-role="param-menu"],
[data-role="parameters-dropdown"] [data-role="param-menu"] {
  display: none !important;
  position: fixed !important; /* absolute yerine fixed - parent overflow'dan etkilenmez */
  /* top ve left JavaScript'te hesaplanacak */
  z-index: 999999 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  margin-top: 0 !important;
  overflow: visible !important;
}

/* HOVER RULES - En yüksek specificity ve !important ile (mutlaka çalışmalı) */
div[data-role="parameters-dropdown"]:hover > div[data-role="param-menu"],
div[data-role="parameters-dropdown"]:hover div[data-role="param-menu"],
[data-role="parameters-dropdown"]:hover > [data-role="param-menu"],
[data-role="parameters-dropdown"]:hover [data-role="param-menu"],
[data-role="parameters-dropdown"]:hover ~ [data-role="param-menu"],
span[data-role="param-toggle"]:hover + div[data-role="param-menu"],
span[data-role="param-toggle"]:hover ~ div[data-role="param-menu"],
[data-role="param-toggle"]:hover + [data-role="param-menu"],
[data-role="param-toggle"]:hover ~ [data-role="param-menu"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
}

/* Menü üzerindeyken de açık kalsın */
div[data-role="param-menu"]:hover,
[data-role="param-menu"]:hover {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
}

/* Focus durumları */
[data-role="parameters-dropdown"]:focus-within [data-role="param-menu"],
[data-role="param-toggle"]:focus ~ [data-role="param-menu"] {
  display: block !important;
  z-index: 999999 !important;
}

/* Çizimleri Göster butonu */
[data-role="param-top-toggle"] {
  font-weight: 500 !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
  margin: 2px 0 4px !important;
}

/* Parametre menüsü - maksimum yükseklik ve scroll */
[data-role="param-menu"] {
  max-height: 60vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Parametre menüsündeki tüm butonları küçült */
[data-role="param-menu"] button,
[data-role="param-menu"] .submenu-parent {
  padding: 4px 8px !important;
  margin: 1px 0 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  min-height: auto !important;
}

/* Parametre menüsündeki icon'ları küçült */
[data-role="param-menu"] i,
[data-role="param-menu"] .fa,
[data-role="param-menu"] .fas {
  font-size: 11px !important;
  width: 12px !important;
  height: 12px !important;
}

/* Parametre label'ları küçült */
[data-role="param-menu"] .param-label {
  font-size: 11px !important;
  margin-left: 6px !important;
}

/* Alt menüleri de küçült */
[data-role="param-view-menu"] button,
[data-role="param-roads-menu"] button {
  padding: 4px 8px !important;
  margin: 1px 0 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}

[data-role="param-view-menu"] .param-label,
[data-role="param-roads-menu"] .param-label {
  font-size: 11px !important;
  margin-left: 6px !important;
}

/* P Butonu Genişliği - Diğer butonlarla aynı minimum genişlik */
#parcel_polygon {
  min-width: 32px !important;
  width: 32px !important;
  padding: 3px 6px !important;
}

/* Tüm Icon'ları Eşit Boyutta (unified bar) */
nav#top-menu-bar #top-button-container .toggle-btn i,
nav#top-menu-bar #top-button-container .toggle-btn svg,
nav#top-menu-bar #top-button-container .parameters i,
nav#top-menu-bar #top-button-container .parameters svg {
  width: 14px !important;
  height: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

/* 3D Yapı Butonu - Aktif durumu */
#tkgm3DBuildingBtn.active {
  background: #3b82f6 !important;
  color: white !important;
  border-color: #2563eb !important;
}

#tkgm3DBuildingBtn.active:hover {
  background: #2563eb !important;
}

/* ========================================
   NOTIFICATIONS DROPDOWN STYLES
   ======================================== */

/* Bildirim butonu - Stiller sidebar.css'de ortak tanımlı */
.notifications-btn {
  position: relative;
}

/* Bildirim badge */
.notifications-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid #1a2332;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Bildirimler dropdown - yüksek z-index (user-menu ile aynı seviye) */
#notifications-dropdown {
  z-index: 300000000000 !important;
  position: relative;
}

#notifications-dropdown.open {
  z-index: 3000000000000001 !important;
}

/* Bildirimler dropdown açıldığında menüyü göster */
#notifications-dropdown.open > .notifications-dropdown-menu {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Bildirimler dropdown menü - AÇIK TEMA (dark kullanılmıyor) */
.notifications-dropdown-menu,
#notifications-dropdown > .dropdown-menu,
#notifications-dropdown > .notifications-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 360px;
  max-width: 95vw;
  padding: 0;
  border-radius: 12px;
  background: #ffffff !important; /* Beyaz arka plan - dark değil */
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 3000001 !important;
}

/* Bildirimler başlık */
.notifications-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.notifications-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notifications-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.mark-all-read-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
}

.mark-all-read-btn:hover {
  background: #e2e8f0;
  color: #3b82f6;
}

.notifications-actions {
  display: flex;
  gap: 8px;
}

.notifications-action-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notifications-action-btn:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.notifications-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.notifications-action-btn--danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.notifications-action-btn--danger:hover:not(:disabled) {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

/* Bildirim listesi */
.notifications-list {
  max-height: 400px;
  overflow-y: auto;
}

.notifications-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.notifications-empty i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.notifications-empty span {
  font-size: 14px;
}

/* Bildirim öğesi */
.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-item.unread {
  background: #eff6ff;
}

.notification-item.unread:hover {
  background: #dbeafe;
}

.notification-item--selected,
.notification-item--selected:hover {
  background: #dbeafe;
}

.notification-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  padding-top: 2px;
}

.notification-select-checkbox {
  width: 14px;
  height: 14px;
  accent-color: #2563eb;
  cursor: pointer;
}

/* Bildirim icon */
.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
}

.notification-icon.icon-expert {
  background: #dbeafe;
  color: #2563eb;
}

.notification-icon.icon-success {
  background: #dcfce7;
  color: #16a34a;
}

.notification-icon.icon-coin {
  background: #fef3c7;
  color: #d97706;
}

.notification-icon.icon-warning {
  background: #fee2e2;
  color: #dc2626;
}

.notification-icon.icon-gift {
  background: #f3e8ff;
  color: #9333ea;
}

.notification-icon.icon-badge {
  background: #fce7f3;
  color: #db2777;
}

.notification-icon.icon-info {
  background: #e0f2fe;
  color: #0284c7;
}

.notification-icon.icon-default {
  background: #f1f5f9;
  color: #64748b;
}

.notification-icon i {
  font-size: 16px;
}

/* Bildirim içeriği */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-message {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Okunmamış nokta */
.notification-unread-dot {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  position: absolute;
  top: 16px;
  right: 16px;
}

/* Bildirimler footer */
.notifications-footer {
  padding: 12px 16px;
  text-align: center;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.notifications-footer a {
  color: #3b82f6;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.notifications-footer a:hover {
  text-decoration: underline;
}

/* Mobil responsive */
@media (max-width: 480px) {
  .notifications-dropdown-menu {
    width: calc(100vw - 20px);
    right: -50px;
  }
  
  .notifications-list {
    max-height: 350px;
  }
  
  .notification-item {
    padding: 10px 12px;
  }
  
  .notification-icon {
    width: 36px;
    height: 36px;
    margin-right: 10px;
  }
}

/* ===== ACTION BAR BUTONLARI - KÖŞE YUVARLAKLIĞI KALDIR ===== */
/* Not: Avatar/resim alanları bu kapsamın dışındadır. */
#top-button-container .toggle-btn,
#top-button-container .parameters,
#top-button-container .action-bar-link,
#top-button-container > a.toggle-btn,
nav#top-menu-bar #top-button-container .toggle-btn,
nav#top-menu-bar #top-button-container .parameters,
nav#top-menu-bar #top-button-container .action-bar-link,
[data-role="param-toggle"],
[data-role="param-top-toggle"] {
  border-radius: 0 !important;
}

/* ===== INDEX (pp-app): Ek araçlar paneli — zoom sağda; yatay kaydırma ===== */
.pp-toolbar-flex-spacer {
  flex: 1 1 0;
  min-width: 8px;
  height: 1px;
  align-self: center;
}

.pp-toolbar-extras-shell {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.pp-toolbar-slide-toggle {
  flex-shrink: 0;
}

/* Tıklamada «soru işareti» / titreme: hover translateY ve ikon transition yok */
#top-button-container.mode-simple .pp-toolbar-slide-toggle:hover,
#top-button-container.mode-simple .pp-toolbar-slide-toggle:active {
  transform: none !important;
}

#top-button-container:not(.mode-simple) .pp-toolbar-slide-toggle:hover,
#top-button-container:not(.mode-simple) .pp-toolbar-slide-toggle:active {
  transform: none !important;
}

.pp-toolbar-slide-toggle,
.pp-toolbar-slide-toggle i,
.pp-toolbar-slide-toggle svg {
  transition: none !important;
}

.pp-toolbar-extras {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    max-width 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    visibility 0s linear 0.38s;
}

.pp-toolbar-extras.pp-toolbar-extras--open {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(100%, 4800px);
  overflow-x: auto;
  overflow-y: visible;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  scrollbar-width: thin;
  transition:
    max-width 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    visibility 0s linear 0s;
}

.pp-toolbar-extras-auth-gate {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  flex-shrink: 0;
  min-height: 32px;
  min-width: min(100%, 520px);
  overflow: visible;
}

.pp-toolbar-extras-auth-gate .pp-capture-menu-wrap {
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

.pp-toolbar-extras-auth-gate--locked .toggle-btn,
.pp-toolbar-extras-auth-gate--locked .action-bar-link,
.pp-toolbar-extras-auth-gate--locked .pp-capture-menu-wrap,
.pp-toolbar-extras-auth-gate--locked .pp-capture-menu-wrap .toggle-btn {
  pointer-events: none !important;
}

.pp-toolbar-extras-auth-gate--locked .toggle-btn,
.pp-toolbar-extras-auth-gate--locked .action-bar-link,
.pp-toolbar-extras-auth-gate--locked .pp-capture-menu-wrap {
  opacity: 0.72 !important;
  filter: grayscale(0.12);
  cursor: not-allowed !important;
}

.pp-toolbar-extras-auth-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(1px);
  border-radius: 6px;
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: none;
}

.pp-toolbar-extras-auth-gate--locked .pp-toolbar-extras-auth-overlay {
  display: flex !important;
}

.pp-toolbar-extras-auth-gate--locked .pp-toolbar-extras-auth-overlay[hidden] {
  display: flex !important;
}

.pp-toolbar-extras-auth-overlay-text {
  margin: 0;
  padding: 4px 10px;
  font-family: var(--pp-font-body, 'IBM Plex Sans', sans-serif);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #1e40af;
  text-align: center;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.06);
}

@media (max-width: 900px) {
  .pp-toolbar-extras-auth-overlay-text {
    font-size: 10px;
    white-space: normal;
    max-width: 140px;
  }
}

.pp-toolbar-extras.pp-toolbar-extras--open::-webkit-scrollbar {
  height: 3px;
}

#map-zoom-indicator {
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .pp-toolbar-extras.pp-toolbar-extras--open {
    max-width: 100%;
  }
}