/* map-enhanced.css - 地図機能拡張スタイル */

/* 検索バー */
.map-search {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 10px;
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 600px;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 35px 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.search-input:focus {
  border-color: #ff6b35;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 5px;
}

.filter-btn,
.search-btn {
  padding: 10px 20px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.filter-btn:hover,
.search-btn:hover {
  background: #f5f5f5;
}

.search-btn {
  background: #ff6b35;
  color: white;
  border-color: #ff6b35;
}

.search-btn:hover {
  background: #e55a2b;
}

.filter-btn {
  position: relative;
}

.filter-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6b35;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
}

/* 検索候補 */
.search-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
}

.suggest-section {
  padding: 10px 0;
}

.suggest-section + .suggest-section {
  border-top: 1px solid #eee;
}

.suggest-title {
  padding: 5px 15px;
  font-size: 12px;
  color: #666;
  font-weight: bold;
}

.suggest-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.suggest-item {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.suggest-item:hover {
  background: #f5f5f5;
}

.suggest-icon {
  font-size: 18px;
}

.suggest-info {
  flex: 1;
}

.suggest-name {
  font-size: 14px;
  font-weight: 500;
}

.suggest-meta {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.no-results {
  padding: 20px;
  text-align: center;
  color: #999;
}

/* InfoWindow */
.info-window {
  min-width: 250px;
  padding: 15px;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.info-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.category {
  font-size: 12px;
  padding: 2px 8px;
  background: #f0f0f0;
  border-radius: 4px;
  white-space: nowrap;
}

.info-body {
  margin-bottom: 10px;
}

.rating {
  font-size: 14px;
  margin-bottom: 5px;
}

.status {
  margin-bottom: 5px;
}

.status .open {
  color: #4caf50;
  font-weight: 500;
}

.status .closed {
  color: #f44336;
  font-weight: 500;
}

.distance {
  font-size: 13px;
  color: #666;
}

.info-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.info-actions button {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
}

.info-actions button:hover {
  background: #f5f5f5;
}

.info-actions .btn-detail {
  background: #ff6b35;
  color: white;
  border-color: #ff6b35;
}

.info-actions .btn-detail:hover {
  background: #e55a2b;
}

/* フィルターモーダル */
.filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.filter-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.filter-modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.filter-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.filter-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.filter-section {
  margin-bottom: 25px;
}

.filter-section h4 {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #333;
}

.filter-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.filter-categories label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.filter-categories input[type='checkbox'] {
  width: 18px;
  height: 18px;
}

.filter-distance,
.filter-rating {
  display: flex;
  align-items: center;
  gap: 15px;
}

.distance-slider,
.rating-slider {
  flex: 1;
}

.distance-value,
.rating-value {
  min-width: 60px;
  text-align: right;
  font-size: 14px;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.filter-modal-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.filter-modal-footer button {
  padding: 10px 20px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.filter-reset {
  margin-right: auto;
}

.filter-apply {
  background: #ff6b35;
  color: white;
  border-color: #ff6b35;
}

.filter-apply:hover {
  background: #e55a2b;
}

/* 詳細パネル（デスクトップ） */
.detail-panel {
  position: fixed; /* absoluteからfixedに変更 */
  left: 0;
  top: 60px; /* ヘッダー分のオフセット */
  bottom: 0;
  width: 400px;
  background: white;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 500; /* z-indexを上げる */
  transform: translateX(-100%);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* オーバーフローを隔す */
}

.detail-panel.open {
  transform: translateX(0);
}

.detail-panel-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-panel-header h2 {
  margin: 0;
  font-size: 18px;
  flex: 1;
}

.detail-panel-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.detail-panel-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.detail-tab {
  flex: 1;
  padding: 15px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.detail-tab.active {
  border-bottom-color: #ff6b35;
  color: #ff6b35;
  font-weight: 500;
}

.detail-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: white; /* 背景色を明示的に設定 */
  min-height: 0; /* flexboxのオーバーフロー修正 */
}

.detail-panel-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

.detail-panel-footer button {
  flex: 1;
  padding: 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.detail-panel-footer .btn-primary {
  background: #ff6b35;
  color: white;
  border-color: #ff6b35;
}

/* ボトムシート（モバイル） */
@media (max-width: 768px) {
  .map-search {
    top: 10px;
    width: 95%;
    padding: 8px;
  }

  .search-input {
    font-size: 16px; /* iOS zoom防止 */
  }

  .bottom-sheet {
    position: fixed;
    bottom: 60px; /* タブバー分 */
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 90;
    transform: translateY(calc(100% - 120px));
    transition: transform 0.3s;
  }

  .bottom-sheet.half {
    transform: translateY(50%);
  }

  .bottom-sheet.full {
    transform: translateY(10%);
  }

  .bottom-sheet-handle {
    padding: 10px;
    text-align: center;
  }

  .bottom-sheet-bar {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto;
  }

  .bottom-sheet-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* 地図のカメラコントロールを非表示 */
button[aria-label='地図のカメラ コントロール'],
button[title='地図のカメラ コントロール'],
.gm-control-active[aria-label*='カメラ'],
.gm-control-active[title*='カメラ'] {
  display: none !important;
}
