/* ============================================================
   Kozyatagi.com.tr - Özel Firma Rehberi & Harita Navigasyonu Stilleri
   Ultra Hızlı, 100% Mobil Uyumlu (Mobile-First Ergonomi)
============================================================ */

:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --secondary: #0f172a;
  --accent-google: #2563eb;
  --accent-yandex: #dc2626;
  --accent-whatsapp: #16a34a;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --sidebar-width: 420px;
  --header-height: 58px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
  z-index: 1000;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--secondary);
}

.logo-badge {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: -0.5px;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.1;
}

.logo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: var(--secondary);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.btn-header:hover {
  background: #e2e8f0;
}

.btn-header-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-header-primary:hover {
  background: var(--primary-dark);
}

/* Layout (Split Screen) */
.split-container {
  display: flex;
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Sol Sidebar (Masaüstü) */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 500;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.04);
}

.sidebar-header {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

/* Arama ve Filtreler */
.search-box-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.search-input {
  width: 100%;
  padding: 10px 70px 10px 36px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 16px; /* iOS Safari otomatik zoom'u önler */
  outline: none;
  transition: border-color 0.2s;
  background: #f8fafc;
}

.search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
}

.search-geo-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #e0f2fe;
  color: var(--primary);
  border: 1px solid #bae6fd;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  z-index: 5;
}

.search-geo-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

.search-suggest-header {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f1f5f9;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.filter-field-group {
  width: 100%;
  margin-top: 8px;
}

.select-filter {
  width: 100%;
  height: 40px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16'><path fill='%2364748b' d='M8 11.5l-5-5h10l-5 5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.select-filter:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

/* Seçilebilir & Yazılabilir Arama Kutuları (Custom Combobox) */
.custom-combo-container {
  position: relative;
  width: 100%;
  margin-top: 8px;
}

.custom-combo-input {
  width: 100%;
  height: 40px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  cursor: text;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16'><path fill='%2364748b' d='M8 11.5l-5-5h10l-5 5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.custom-combo-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.combo-clear-btn {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  display: none;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  border-radius: 50%;
  background: #f1f5f9;
  z-index: 5;
}

.combo-clear-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.custom-combo-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.14);
  scrollbar-width: thin;
}

.custom-combo-option {
  padding: 8px 12px;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.15s;
}

.custom-combo-option:hover, .custom-combo-option.highlighted {
  background-color: #f0f9ff;
  color: var(--primary);
}

.custom-combo-option.option-reset {
  background: #f8fafc;
  font-weight: 700;
  color: #0284c7;
  border-bottom: 1.5px solid #e2e8f0;
}
.custom-combo-option.option-reset:hover {
  background: #e0f2fe;
}

/* Kategori Hapları (Pills) */
.category-pills-bar {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  overflow-x: auto;
  white-space: nowrap;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-pills-bar::-webkit-scrollbar {
  display: none;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.category-pill:hover, .category-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Firma Listesi */
.firm-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.firm-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.firm-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.firm-card.selected {
  border-color: var(--primary);
  background-color: #f0f9ff;
  border-width: 2px;
}

/* Kompakt Tek Satır Firma Listesi */
.firm-compact-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px !important;
  margin-bottom: 6px !important;
  border-radius: 10px !important;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  gap: 10px;
}

.firm-compact-row:hover {
  border-color: #0284c7;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.firm-compact-row.selected {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.f-compact-main {
  flex: 1;
  min-width: 0;
}

.f-compact-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.f-compact-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.f-compact-sub {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.f-compact-kat {
  color: #0284c7;
  font-weight: 600;
}

.f-compact-dot {
  color: #cbd5e1;
}

.f-compact-bolge {
  color: #64748b;
}

.f-compact-action {
  flex-shrink: 0;
}

.btn-compact-detail {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f8fafc;
  color: #0284c7;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid #cbd5e1;
}

.btn-compact-detail:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.badge-vip-mini {
  background: #fef08a;
  color: #854d0e;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1.2;
}

.firm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  gap: 8px;
}

.firm-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.3;
}

.badge-sponsored {
  background: #fef08a;
  color: #854d0e;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.firm-category {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.firm-address {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.firm-card-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.btn-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
  cursor: pointer;
  border: none;
  min-height: 36px;
  text-align: center;
}

.btn-card:active {
  transform: scale(0.98);
}

.btn-google {
  background: var(--accent-google);
  color: #ffffff;
}

.btn-yandex {
  background: var(--accent-yandex);
  color: #ffffff;
}

.btn-phone {
  background: #059669;
  color: #ffffff;
}

.btn-whatsapp {
  background: var(--accent-whatsapp);
  color: #ffffff;
}

/* Sağ Harita Alanı */
.map-container {
  flex: 1;
  height: 100%;
  position: relative;
  background: #e2e8f0;
}

#map {
  width: 100%;
  height: 100%;
}

/* Harita Popup Stilleri (Leaflet Custom) */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

.popup-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 3px;
}

.popup-category {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.popup-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.3;
}

.popup-route-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.popup-btn {
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  color: #fff;
}

/* Mobil Alt Segment Sekmeleri (Harita / Liste Seçici) */
.mobile-segment-bar {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 2500;
}

.segment-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.segment-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* Mobilde Harita Üzerinde Yüzen Önizleme Kartı (Pin Seçildiğinde) */
.mobile-firm-sheet {
  display: none;
  position: absolute;
  bottom: 74px;
  left: 12px;
  right: 12px;
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  z-index: 1500;
  border: 1px solid var(--border-color);
  animation: slideUp 0.25s ease-out;
}

.mobile-firm-sheet.show {
  display: block;
}

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

.sheet-close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  font-size: 1rem;
}

/* Sayfa Detay (Firma & Standalone sayfaları) */
.detail-container {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 14px;
  padding-bottom: 40px;
}

.detail-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  gap: 12px;
}

.detail-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 6px;
  line-height: 1.25;
}

.nav-buttons-large {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}

.btn-large-nav {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  transition: transform 0.15s;
  min-height: 48px;
}

/* ============================================================
   MOBİL EKRANLAR (max-width: 820px) - Kusursuz Deneyim
============================================================ */
@media (max-width: 820px) {
  :root {
    --header-height: 52px;
  }

  .app-header {
    padding: 0 12px;
  }

  .logo-text {
    font-size: 1.05rem;
  }

  .logo-sub {
    display: none; /* Mobilde dar alanda başlığı sadeleştir */
  }

  .btn-header {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .btn-header span {
    display: none; /* Mobilde buton metinlerini simgeye çevirebiliriz */
  }

  .split-container {
    position: relative;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
  }

  /* Mobil Segment Barı Aktif */
  .mobile-segment-bar {
    display: flex;
  }

  /* Harita Görünümü: Harita %100 kapsar */
  .map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
  }

  /* Liste Görünümü: Sidebar tam ekran overlay olur */
  .sidebar {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    display: none; /* Varsayılan veya JS ile kontrol */
    padding-bottom: 70px; /* Alt bar için boşluk */
  }

  .sidebar.mobile-active {
    display: flex;
  }

  /* Harita aktifken haritanın üstünde arama ve filtreler kompakt kalsın */
  .floating-mobile-search {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 800;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  }

  /* Firma Detay Sayfası Mobilde Tek Sütun Butonlar */
  .nav-buttons-large {
    grid-template-columns: 1fr;
  }

  .detail-card {
    padding: 16px;
  }

  .detail-title {
    font-size: 1.35rem;
  }
}

/* ============================================================
   İnteraktif Alt Navigasyon Barı & Dinamik Hap Butonlar (Quick Geo Pills)
============================================================ */
.quick-nav-bar {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex-shrink: 0;
}

.quick-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.quick-nav-title {
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.78rem;
}

.quick-nav-all-link {
  color: #0284c7;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.15s ease;
}

.quick-nav-all-link:hover {
  color: #0369a1;
  text-decoration: underline;
}

.quick-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 85px;
  overflow-y: auto;
}

.quick-geo-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease-in-out;
  user-select: none;
  line-height: 1.35;
}

.quick-geo-pill:hover {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #bae6fd;
  transform: translateY(-1px);
}

.quick-geo-pill.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.35);
  font-weight: 600;
}

.quick-nav-empty-note {
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 2px 0;
  font-style: italic;
}

