/**
 * 検索システム v2 スタイル
 *
 * @package LocalTrainSearch
 */

/* 検索セクション v2 */
.search-section-v2 {
  background-color: #fff;
  padding: 30px;
  margin: 30px 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-header {
  margin-bottom: 30px;
}

.search-header h2 {
  margin-bottom: 20px;
  font-size: 24px;
  color: #2c3e50;
  border-bottom: 3px solid #3498db;
  padding-bottom: 10px;
}

.search-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-button {
  padding: 10px 20px;
  border: 2px solid #3498db;
  background-color: #fff;
  color: #3498db;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s;
}

.tab-button:hover {
  background-color: #f0f8ff;
}

.tab-button.active {
  background-color: #3498db;
  color: #fff;
}

/* 検索フォーム v2 */
.search-form-v2 {
  display: none;
}

.search-form-v2.active {
  display: block;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #2c3e50;
  font-size: 14px;
}

/* 駅入力（サジェスト） */
.station-input-group {
  position: relative;
}

.station-autocomplete-wrapper {
  position: relative;
}

.station-autocomplete {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.station-autocomplete:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.autocomplete-suggestions ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.suggestion-item {
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.suggestion-item:hover {
  background-color: #f8f9fa;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-name {
  font-size: 14px;
  color: #333;
}

.suggestion-loading,
.suggestion-no-results,
.suggestion-error {
  padding: 12px 15px;
  text-align: center;
  color: #7f8c8d;
  font-size: 14px;
}

.suggestion-error {
  color: #e74c3c;
}

/* Swapボタン */
.swap-button {
  width: 48px;
  height: 48px;
  border: 2px solid #3498db;
  background-color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.swap-button:hover {
  background-color: #3498db;
  color: #fff;
  transform: rotate(180deg);
}

.swap-button svg {
  width: 20px;
  height: 20px;
}

/* 検索ボタン */
.search-button-primary {
  width: 100%;
  padding: 15px;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 10px;
}

.search-button-primary:hover {
  background-color: #2980b9;
}

/* 検索条件バー（固定表示） */
.search-conditions-bar {
  position: sticky;
  top: 0;
  background-color: #2c3e50;
  color: #fff;
  padding: 15px 30px;
  margin: 20px -30px -30px;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.conditions-content {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.condition-item {
  font-size: 14px;
}

.condition-separator {
  font-size: 18px;
  color: #3498db;
}

.clear-search-btn {
  margin-left: auto;
  padding: 5px 15px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s;
}

.clear-search-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* ローディング */
.search-loading {
  text-align: center;
  padding: 40px 20px;
  background-color: #fff;
  border-radius: 8px;
  margin: 20px 0;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 検索結果コンテナ */
.search-results-container {
  background-color: #fff;
  padding: 30px;
  margin: 30px 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-results-container h3 {
  margin-bottom: 20px;
  font-size: 20px;
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

/* 時刻検索結果（テーブル） */
.timetable-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.timetable-results-table thead {
  background-color: #34495e;
  color: #fff;
}

.timetable-results-table th {
  padding: 12px 15px;
  text-align: left;
  font-weight: bold;
}

.timetable-results-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
}

.timetable-results-table tbody tr:hover {
  background-color: #f8f9fa;
}

.timetable-results-table td {
  padding: 12px 15px;
}

/* 時刻検索結果（カード） */
.timetable-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3498db;
}

.train-number {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
}

.train-type {
  font-size: 14px;
  padding: 4px 12px;
  background-color: #3498db;
  color: #fff;
  border-radius: 4px;
}

.card-body {
  margin-bottom: 15px;
}

.time-info {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.time-item {
  text-align: center;
  flex: 1;
}

.time-label {
  display: block;
  font-size: 12px;
  color: #7f8c8d;
  margin-bottom: 5px;
}

.time-value {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #7f8c8d;
}

/* 運賃検索結果 */
.fare-display-card {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: #fff;
}

.fare-route {
  margin-bottom: 20px;
  font-size: 18px;
}

.fare-from,
.fare-to {
  display: inline-block;
  padding: 8px 15px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-weight: bold;
}

.fare-arrow {
  margin: 0 15px;
  font-size: 24px;
}

.fare-amount {
  margin: 15px 0;
}

.fare-label {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
  opacity: 0.9;
}

.fare-value {
  display: block;
  font-size: 36px;
  font-weight: bold;
}

.fare-amount.child {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* 定期運賃検索結果 */
.commuter-display-card {
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.commuter-route {
  text-align: center;
  margin-bottom: 30px;
  font-size: 18px;
  color: #2c3e50;
}

.commuter-from,
.commuter-to {
  font-weight: bold;
  padding: 5px 10px;
  background-color: #fff;
  border-radius: 4px;
  display: inline-block;
}

.commuter-arrow {
  margin: 0 15px;
  font-size: 20px;
  color: #3498db;
}

.commuter-fares {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.commuter-fare-item {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  text-align: center;
  transition: all 0.3s;
}

.commuter-fare-item:hover {
  border-color: #3498db;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.commuter-period {
  font-size: 14px;
  color: #7f8c8d;
  margin-bottom: 10px;
}

.commuter-amount {
  font-size: 28px;
  font-weight: bold;
  color: #e74c3c;
  margin-bottom: 10px;
}

.commuter-per-day {
  font-size: 12px;
  color: #7f8c8d;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
  
  .swap-button {
    align-self: center;
    margin: 10px 0;
  }
  
  .search-tabs {
    flex-direction: column;
  }
  
  .tab-button {
    width: 100%;
  }
  
  .conditions-content {
    flex-direction: column;
    text-align: center;
  }
  
  .clear-search-btn {
    margin-left: 0;
    margin-top: 10px;
  }
  
  .timetable-results-table {
    font-size: 12px;
  }
  
  .timetable-results-table th,
  .timetable-results-table td {
    padding: 8px 10px;
  }
  
  .commuter-fares {
    grid-template-columns: 1fr;
  }
}

