/* ============================================================
 * DOSYA ADI: arama-motoru.css
 * YOLU: /assets/css/arama-motoru.css
 * MİMARİ: Zırhlı Ahtapot - B Katmanı (Stil Yönetimi)
 * ============================================================ */

.search-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.search-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  align-items: flex-end;
  position: relative; /* Panel konumlandırması için kritik */
}

.filter-item {
  flex: 1 1 150px; /* Yan yana hizalama için esneklik */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-item label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-left: 4px;
}

.filter-item select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #f9f9f9;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none; /* Varsayılan oku gizle */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 10px auto;
}

.filter-item select:focus {
  outline: none;
  border-color: #2d67f5;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(45, 103, 245, 0.1);
}

.filter-item select:disabled {
  background-color: #eee;
  color: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Arama Butonu */
.btn-search {
  flex: 0 0 auto;
  padding: 12px 32px;
  background-color: #2d67f5;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  height: 46px; /* Select yüksekliği ile aynı hizalama */
}

.btn-search:hover {
  background-color: #1a4bd6;
}

/* ============================================================
 * MAHALLE PANELİ (Pop-up / Dropdown)
 * ============================================================ */
#neighborhood-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  margin-top: 8px;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 4px;
}

.mh-button-bar {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.btn-select-all, .btn-clear-all {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ddd;
  background: #fff;
  transition: all 0.2s;
}

.btn-select-all:hover { background: #eef4ff; border-color: #2d67f5; color: #2d67f5; }
.btn-clear-all:hover { background: #fff0f0; border-color: #dc3545; color: #dc3545; }

.mh-items {
  max-height: 250px;
  overflow-y: auto;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.mh-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
}

.mh-check {
  accent-color: #2d67f5;
  width: 16px;
  height: 16px;
}

.panel-footer {
  padding: 12px;
  text-align: right;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

.panel-footer button {
  background: #2d67f5;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

/* ============================================================
 * RESPONSIVE AYARLAR
 * ============================================================ */

/* Tablet */
@media (max-width: 992px) {
  .search-container {
    padding: 15px;
  }
  
  .filter-item {
    flex: 1 1 45%; /* Tablette yan yana 2'li */
  }
  
  .btn-search {
    flex: 1 1 100%; /* Buton tam genişlik */
    margin-top: 10px;
  }
}

/* Mobil */
@media (max-width: 576px) {
  .search-wrapper {
    padding: 5px;
  }

  .search-container {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .filter-item {
    flex: 1 1 100%; /* Mobilde alt alta */
    width: 100%;
  }

  .btn-search {
    width: 100%;
    padding: 14px;
  }

  /* Mobilde Mahalle Paneli Bottom-Sheet */
  #neighborhood-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    margin-top: 0;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    animation: slideUp 0.3s ease-out;
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .mh-items {
    grid-template-columns: 1fr; /* Mobilde tek sütun */
  }
}