/* ========================================
   Reset & Base Styles
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* Hidden attribute support */
[hidden] {
  display: none !important;
}

/* ========================================
   Container & Layout
   ======================================== */

.container {
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  padding: 1rem;
}

/* ========================================
   Map Section
   ======================================== */

.map-section {
  width: 100%;
  background-color: #f5f5f5;
  position: relative; /* 経路クリアボタンの基準点 */
}

/* 地図コンテナ - モバイル（768px未満）: 40vh */
.map-container {
  width: 100%;
  height: 40vh;
  min-height: 300px;
  position: relative;
}

/* Leaflet controls styling for mobile - タッチ操作しやすいサイズ */
.leaflet-control-zoom {
  margin: 10px !important;
}

.leaflet-control-zoom a {
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 20px !important;
}

/* 最小幅320pxでの表示確保 */
@media (max-width: 320px) {
  .map-container {
    min-height: 250px;
  }
}

/* ========================================
   Header
   ======================================== */

.header {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: white;
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.header-subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ========================================
   Sections
   ======================================== */

.search-section,
.results-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #0066cc;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 0.5rem;
}

/* ========================================
   Form Styles
   ======================================== */

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-help {
  font-size: 0.8125rem;
  color: #666;
}

/* ========================================
   Autocomplete
   ======================================== */

.autocomplete-wrapper {
  position: relative;
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #0066cc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
  z-index: 100;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestions-list:empty {
  display: none;
}

.suggestion-item {
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:focus {
  background-color: #f0f7ff;
}

.suggestion-item-active {
  background-color: #e6f2ff;
}

.suggestion-item-empty {
  color: #999;
  cursor: default;
  font-style: italic;
}

.suggestion-item-empty:hover {
  background-color: white;
}

/* ========================================
   Radio Buttons
   ======================================== */

.time-options {
  border: none;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  transition: all 0.2s;
  min-height: 44px;
}

.radio-label:hover {
  border-color: #0066cc;
  background-color: #f0f7ff;
}

.radio-input {
  margin-right: 0.75rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.radio-input:checked + .radio-text {
  font-weight: 600;
  color: #0066cc;
}

.radio-label:has(.radio-input:checked) {
  border-color: #0066cc;
  background-color: #e6f2ff;
}

.radio-text {
  font-size: 1rem;
}

/* ========================================
   Time Picker
   ======================================== */

.time-picker {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 4px;
}

.time-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.time-input {
  width: 80px;
  padding: 0.75rem;
  font-size: 1.125rem;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 4px;
}

.time-input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.time-separator {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  min-width: 44px;
}

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

.btn-primary {
  background-color: #0066cc;
  color: white;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background-color: #0052a3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-secondary {
  background-color: white;
  color: #0066cc;
  border: 2px solid #0066cc;
  width: 100%;
  margin-top: 1rem;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #f0f7ff;
}

/* ボタンコンテナ - 検索ボタンと同じ幅を保証 */
.button-container {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* 地図選択ボタン */
.btn-map-select {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background-color: white;
  color: #0066cc;
  border: 2px solid #0066cc;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.btn-map-select:hover:not(:disabled) {
  background-color: #f0f7ff;
}

.btn-map-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-map-select.map-selection-active {
  background-color: #0066cc;
  color: white;
}

.btn-map-select.map-selection-active:hover:not(:disabled) {
  background-color: #0052a3;
}

/* ========================================
   Error Messages
   ======================================== */

.error-message {
  display: none;
  padding: 0.875rem;
  background-color: #fee;
  border: 2px solid #fcc;
  border-radius: 4px;
  color: #c33;
  font-weight: 600;
  margin-bottom: 1rem;
}

.error-message:not(:empty) {
  display: block;
}

/* ========================================
   Retry Button
   ======================================== */

.retry-button {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 1rem auto;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.retry-button:hover {
  background-color: #0052a3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.retry-button:active {
  transform: translateY(1px);
}

/* ========================================
   Loading
   ======================================== */

.loading {
  display: none;
  text-align: center;
  padding: 2rem;
}

.loading-text {
  color: #666;
  font-size: 0.9375rem;
}

/* ========================================
   Initial Loading Screen
   ======================================== */

/* ローディング画面のオーバーレイ（スケルトン型） */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  z-index: 9999;
  transition: opacity 0.3s ease-out;
  overflow-y: auto;
}

/* フェードアウトアニメーション */
.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* スケルトンコンテナ */
.skeleton-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* スケルトンヘッダー */
.skeleton-header {
  padding: 1.5rem 0;
  margin-bottom: 1rem;
}

/* スケルトン地図セクション */
.skeleton-map-section {
  margin-bottom: 1.5rem;
}

.skeleton-map {
  width: 100%;
  height: 400px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.5s infinite;
}

/* スケルトンメイン */
.skeleton-main {
  padding: 1rem 0;
}

.skeleton-search-section {
  max-width: 800px;
  margin: 0 auto;
}

/* スケルトンライン（基本要素） */
.skeleton-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.5s infinite;
  margin-bottom: 0.75rem;
}

/* シマーアニメーション（光が流れる効果） */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* スケルトン要素のサイズ */
.skeleton-title {
  height: 32px;
  width: 200px;
  margin-bottom: 0.5rem;
}

.skeleton-subtitle {
  height: 20px;
  width: 150px;
}

.skeleton-section-title {
  height: 28px;
  width: 120px;
  margin-bottom: 1.5rem;
}

.skeleton-label {
  height: 18px;
  width: 100px;
  margin-bottom: 0.5rem;
}

.skeleton-input {
  height: 44px;
  width: 100%;
  margin-bottom: 0.5rem;
}

.skeleton-button {
  height: 36px;
  width: 140px;
  margin-bottom: 0.75rem;
}

.skeleton-submit-button {
  height: 48px;
  width: 100%;
  max-width: 300px;
  margin: 1.5rem auto 0;
}

/* スケルトンラジオグループ */
.skeleton-radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.skeleton-radio {
  height: 20px;
  width: 80px;
  margin-bottom: 0;
}

/* スケルトンフォームグループ */
.skeleton-form-group {
  margin-bottom: 1.5rem;
}

/* エラー表示（スケルトン表示時は中央に配置） */
.loading-screen .loading-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
}

/* エラー表示 */
.loading-error {
  margin-top: 1.5rem;
}

.loading-error .error-message {
  color: #d32f2f;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.loading-error .retry-button {
  padding: 0.75rem 1.5rem;
  background-color: #2c5aa0;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  min-height: 44px;
  transition: all 0.2s;
}

.loading-error .retry-button:hover {
  background-color: #1e3a6f;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loading-error .retry-button:active {
  transform: translateY(1px);
}

.loading-error .retry-button:focus-visible {
  outline: 3px solid #2c5aa0;
  outline-offset: 2px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .skeleton-container {
    padding: 0.5rem;
  }
  
  .skeleton-header {
    padding: 1rem 0;
  }
  
  .skeleton-map {
    height: 300px;
  }
  
  .skeleton-title {
    height: 28px;
    width: 160px;
  }
  
  .skeleton-subtitle {
    height: 18px;
    width: 120px;
  }
  
  .skeleton-section-title {
    height: 24px;
    width: 100px;
  }
  
  .skeleton-radio-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .skeleton-radio {
    width: 100%;
  }
  
  .loading-screen .loading-error {
    padding: 1.5rem;
    margin: 0 1rem;
    max-width: calc(100% - 2rem);
  }
  
  .loading-error .error-message {
    font-size: 0.9375rem;
  }
  
  .loading-error .retry-button {
    font-size: 0.9375rem;
    padding: 0.75rem 1.25rem;
  }
}

/* アクセシビリティ: アニメーション削減 */
@media (prefers-reduced-motion: reduce) {
  .loading-screen {
    transition: none;
  }
  
  .skeleton-line,
  .skeleton-map {
    animation: none;
    background: #f0f0f0;
  }
}

/* ========================================
   Results
   ======================================== */

.results-container {
  min-height: 200px;
}

.results-placeholder {
  text-align: center;
  color: #999;
  padding: 3rem 1rem;
  font-size: 0.9375rem;
}

.results-list-scrollable {
  max-height: 650px; /* 約5件分の高さ（各アイテム約120px + gap 1rem） */
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #888 #f5f5f5;
}

/* スクロールバーのスタイリング（Webkit系ブラウザ） */
.results-list-scrollable::-webkit-scrollbar {
  width: 8px;
}

.results-list-scrollable::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

.results-list-scrollable::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.results-list-scrollable::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.no-results-message {
  text-align: center;
  color: #999;
  padding: 3rem 1rem;
  font-size: 0.9375rem;
}

.result-item {
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s;
  background-color: white;
}

.result-item:hover {
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
  transform: translateY(-2px);
}

/* 時刻情報コンテナ */
.result-time-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.result-departure-time,
.result-arrival-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.result-time-label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.result-time-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0066cc;
}

.result-arrow {
  font-size: 1.5rem;
  color: #999;
  flex-shrink: 0;
}

/* 詳細情報コンテナ */
.result-details-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-duration,
.result-fare,
.result-operator,
.result-route {
  display: flex;
  align-items: baseline;
  font-size: 0.875rem;
}

.result-detail-label {
  color: #666;
  margin-right: 0.5rem;
  font-weight: 500;
  min-width: 70px;
}

.result-detail-value {
  color: #333;
  font-weight: 600;
}

.result-duration .result-detail-value {
  color: #0066cc;
}

.result-fare .result-detail-value {
  color: #e65100;
}

/* 経由バス停 */
.result-via-stops {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e0e0e0;
}

.result-via-stops-list {
  display: block;
  font-size: 0.875rem;
  color: #666;
  font-weight: 400;
  line-height: 1.5;
  word-break: break-word;
}

/* アクションボタンコンテナ */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* 地図で表示ボタン */
.map-display-button {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background-color: white;
  color: #0066cc;
  border: 2px solid #0066cc;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.map-display-button:hover {
  background-color: #f0f7ff;
  box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.map-display-button:active {
  transform: translateY(1px);
}

.map-display-button:focus-visible {
  outline: 3px solid #0066cc;
  outline-offset: 2px;
}

/* カレンダーに登録ボタン */
.add-to-calendar-button {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background-color: white;
  color: #28a745;
  border: 2px solid #28a745;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.add-to-calendar-button:hover {
  background-color: #f0fff4;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.add-to-calendar-button:active {
  transform: translateY(1px);
}

.add-to-calendar-button:focus-visible {
  outline: 3px solid #28a745;
  outline-offset: 2px;
}

/* レスポンシブ対応 */
@media (min-width: 768px) {
  .result-actions {
    flex-direction: row;
  }
  
  .map-display-button,
  .add-to-calendar-button {
    flex: 1;
  }
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background-color: #333;
  color: white;
  padding: 1.5rem 1rem;
  text-align: center;
  margin-top: auto;
}

.footer-text {
  font-size: 0.875rem;
}

.footer-link {
  color: white;
  text-decoration: none;
  margin: 0 0.5rem;
}

.footer-link:hover {
  text-decoration: underline;
}

/* ========================================
   Tablet Styles (768px+)
   ======================================== */

@media (min-width: 768px) {
  /* タブレット・PC（768px以上）: 地図高さ60vh */
  .map-container {
    height: 60vh;
  }

  .main {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }

  .search-section {
    position: sticky;
    top: 2rem;
  }

  .header-title {
    font-size: 2rem;
  }

  .header-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .btn-primary {
    width: auto;
    min-width: 200px;
  }

  .btn-secondary {
    width: auto;
    min-width: 200px;
  }
}

/* ========================================
   Desktop Styles (1024px+)
   ======================================== */

@media (min-width: 1024px) {
  .container {
    max-width: 1400px;
    margin: 0 auto;
  }

  .main {
    padding: 2rem 3rem;
    grid-template-columns: 400px 1fr;
    gap: 3rem;
  }

  .header {
    padding: 2rem 3rem;
  }

  .header-title {
    font-size: 2.5rem;
  }

  .search-section,
  .results-section {
    padding: 2rem;
  }

  .radio-group {
    grid-template-columns: repeat(3, 1fr);
  }

  .result-item {
    padding: 1.5rem;
  }

  .result-time-value {
    font-size: 1.75rem;
  }

  .result-time-label {
    font-size: 0.875rem;
  }

  .result-arrow {
    font-size: 2rem;
  }

  .result-duration,
  .result-fare,
  .result-operator,
  .result-route {
    font-size: 1rem;
  }

  .result-detail-label {
    min-width: 80px;
  }

  /* Desktop hover effects */
  .form-input:hover {
    border-color: #999;
  }

  .suggestion-item {
    cursor: pointer;
  }

  .footer-link:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
  }
}

/* ========================================
   Accessibility
   ======================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles for keyboard navigation */
*:focus-visible {
  outline: 3px solid #0066cc;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid currentColor;
  }
  
  .result-item {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Route Display
   ======================================== */

/* 経路をクリアボタン - 地図コンテナ内の右上に固定 */
.btn-clear-route {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background-color: white;
  color: #d32f2f;
  border: 2px solid #d32f2f;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-clear-route:hover {
  background-color: #d32f2f;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-clear-route:active {
  transform: translateY(1px);
}

/* 現在地ボタン（Leafletコントロールとして） */
.current-location-control {
  margin: 10px;
}

.current-location-button {
  width: 44px;
  height: 44px;
  background-color: white;
  border: 2px solid #333;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.current-location-button:hover {
  background-color: #f0f0f0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.current-location-button:active {
  transform: translateY(1px);
}

.current-location-button .location-icon {
  font-size: 1.5rem;
  color: #333;
  line-height: 1;
}

/* 現在地マーカー */
.current-location-icon {
  background: transparent;
  border: none;
}

.current-location-marker {
  font-size: 1.5rem;
  color: #0066cc;
  text-shadow: 0 0 3px white, 0 0 6px white;
}

/* 位置情報エラー通知 */
.location-error-notification {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 10px;
  max-width: 300px;
}

/* 経路ポップアップ */
.route-popup {
  min-width: 200px;
}

.route-popup-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.25rem;
}

.route-popup-name {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.25rem;
}

.route-popup-time {
  font-size: 0.875rem;
  color: #0066cc;
  font-weight: 600;
}

/* 経路矢印マーカー */
.route-arrow-marker {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* バス停マーカー */
.bus-stop-marker {
  background: transparent;
  border: none;
}

/* バス停ポップアップ */
.bus-stop-popup {
  min-width: 250px;
}

.popup-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0066cc;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 0.5rem;
}

.popup-info {
  margin-bottom: 1rem;
}

.popup-info p {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #333;
}

.popup-info strong {
  font-weight: 600;
  color: #666;
}

.route-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.route-list li {
  padding: 0.25rem 0;
  font-size: 0.875rem;
  color: #333;
}

.route-list li:before {
  content: "• ";
  color: #0066cc;
  font-weight: bold;
  margin-right: 0.5rem;
}

.popup-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popup-button {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.popup-button-primary {
  background-color: #0066cc;
  color: white;
}

.popup-button-primary:hover {
  background-color: #0052a3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.popup-button-secondary {
  background-color: white;
  color: #0066cc;
  border: 2px solid #0066cc;
}

.popup-button-secondary:hover {
  background-color: #f0f7ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.popup-button:active {
  transform: translateY(1px);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

/* ========================================
   Responsive Adjustments for Route Display
   ======================================== */

@media (max-width: 767px) {
  .btn-clear-route {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    top: 60px;
    right: 10px;
  }
  
  .route-popup {
    min-width: 180px;
  }
  
  .bus-stop-popup {
    min-width: 200px;
  }
  
  /* モバイル用のポップアップスタイル（さらに小さく） */
  .mobile-popup .leaflet-popup-content-wrapper {
    padding: 0.375rem;
  }
  
  .mobile-popup .leaflet-popup-content {
    margin: 0.375rem;
    font-size: 0.75rem; /* 12px */
  }
  
  .mobile-popup .bus-stop-popup {
    min-width: 140px;
    max-width: 150px;
  }
  
  .mobile-popup .popup-title {
    font-size: 0.8125rem; /* 13px */
    margin-bottom: 0.375rem;
    padding-bottom: 0.25rem;
  }
  
  .mobile-popup .popup-info {
    margin-bottom: 0.5rem;
  }
  
  .mobile-popup .popup-info p {
    margin-bottom: 0.25rem;
    font-size: 0.6875rem; /* 11px */
    line-height: 1.4;
  }
  
  .mobile-popup .popup-info strong {
    font-size: 0.6875rem; /* 11px */
  }
  
  .mobile-popup .route-list {
    margin-top: 0.25rem;
  }
  
  .mobile-popup .route-list li {
    padding: 0.125rem 0;
    font-size: 0.6875rem; /* 11px */
  }
  
  .mobile-popup .popup-buttons {
    gap: 0.25rem;
  }
  
  .mobile-popup .popup-button {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem; /* 12px */
    min-height: 32px;
  }
}

@media (min-width: 768px) {
  .btn-clear-route {
    top: 10px;
    right: 10px;
  }
}

/* ========================================
   Map Error Messages
   ======================================== */

/* ライブラリ読み込みエラー */
.map-error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background-color: #fff3e0;
  border: 2px solid #ff9800;
  border-radius: 8px;
  margin: 1rem;
}

.map-error-message .error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.map-error-message h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e65100;
  margin-bottom: 0.5rem;
}

.map-error-message p {
  font-size: 0.9375rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.map-error-message .retry-button {
  max-width: 200px;
  margin: 0 auto;
}

/* データ読み込みエラー通知 */
.map-data-error {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 10px;
  max-width: 300px;
}

.error-notification {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
}

.error-notification .error-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.error-notification .error-text {
  font-size: 0.875rem;
  color: #d32f2f;
  font-weight: 600;
  line-height: 1.4;
}

/* タイル読み込みエラー通知 */
.tile-error-notification {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 10px;
  max-width: 350px;
}

.notification-content {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
}

.notification-content .notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.notification-content .notification-text {
  font-size: 0.875rem;
  color: #0066cc;
  font-weight: 500;
  line-height: 1.4;
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
  .map-error-message {
    padding: 1.5rem 1rem;
    margin: 0.5rem;
  }
  
  .map-error-message .error-icon {
    font-size: 2.5rem;
  }
  
  .map-error-message h3 {
    font-size: 1.125rem;
  }
  
  .map-error-message p {
    font-size: 0.875rem;
  }
  
  .map-data-error,
  .tile-error-notification {
    max-width: calc(100vw - 20px);
  }
  
  .error-notification,
  .notification-content {
    padding: 0.5rem 0.75rem;
  }
  
  .error-notification .error-text,
  .notification-content .notification-text {
    font-size: 0.8125rem;
  }
}

/* ========================================
   Timetable Tab Content
   ======================================== */

.timetable-tab-content {
  display: block;
}

.timetable-tab-content[hidden] {
  display: none;
}

/* ========================================
   現在地表示機能
   ======================================== */

/* 現在地ボタン（Leafletコントロールとして） */
.current-location-control {
  margin: 10px;
}

.current-location-button {
  width: 44px;
  height: 44px;
  background: white;
  border: 2px solid #333;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.current-location-button:hover {
  background-color: #f5f5f5;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.current-location-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.current-location-button:focus {
  outline: 2px solid #2196F3;
  outline-offset: 2px;
}

.current-location-button .location-icon {
  font-size: 22px;
  color: #333;
  line-height: 1;
}

/* 現在地マーカー */
.current-location-marker {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #2196F3;
  text-shadow: 0 0 3px white, 0 0 6px white;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.current-location-icon {
  background: transparent !important;
  border: none !important;
}

/* 位置情報エラー通知 */
.location-error-notification {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 10px;
  max-width: 350px;
  border-left: 4px solid #f44336;
}

.location-error-notification .notification-content {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
}

.location-error-notification .notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.location-error-notification .notification-text {
  font-size: 0.875rem;
  color: #d32f2f;
  font-weight: 500;
  line-height: 1.4;
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
  .current-location-control {
    margin: 8px;
  }
  
  .current-location-button {
    width: 44px;
    height: 44px;
  }
  
  .current-location-button .location-icon {
    font-size: 20px;
  }
  
  .location-error-notification {
    max-width: calc(100vw - 20px);
  }
  
  .location-error-notification .notification-content {
    padding: 0.5rem 0.75rem;
  }
  
  .location-error-notification .notification-text {
    font-size: 0.8125rem;
  }
}

/* ========================================
   Safari Warning Dialog Styles
   ======================================== */

/* オーバーレイ */
.safari-warning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ダイアログ本体 */
.safari-warning-dialog {
  background: white;
  border-radius: 8px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
}

/* アニメーション定義 */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* アクセシビリティ対応: アニメーション削減 */
@media (prefers-reduced-motion: reduce) {
  .safari-warning-dialog {
    animation: none;
  }
  
  @keyframes slideIn {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ヘッダー */
.safari-warning-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.safari-warning-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.safari-warning-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

/* ボディ */
.safari-warning-body {
  padding: 1.5rem;
}

.safari-warning-message {
  font-size: 1rem;
  color: #333;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.safari-warning-recommendation {
  font-size: 1rem;
  color: #0066cc;
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
}

/* フッター */
.safari-warning-footer {
  padding: 1.5rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* チェックボックスとラベル */
.safari-warning-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
  color: #666;
  min-height: 44px;
  padding: 0.5rem 0;
}

.safari-warning-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.safari-warning-checkbox:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* OKボタン */
.safari-warning-ok-button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s;
}

.safari-warning-ok-button:hover {
  background-color: #0052a3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.safari-warning-ok-button:active {
  transform: translateY(1px);
}

.safari-warning-ok-button:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* レスポンシブデザイン: モバイル（767px以下） */
@media (max-width: 767px) {
  .safari-warning-dialog {
    max-width: 100%;
  }
  
  .safari-warning-header {
    padding: 1.25rem;
  }
  
  .safari-warning-title {
    font-size: 1.125rem;
  }
  
  .safari-warning-body {
    padding: 1.25rem;
  }
  
  .safari-warning-message,
  .safari-warning-recommendation {
    font-size: 0.9375rem;
  }
  
  .safari-warning-footer {
    padding: 1.25rem;
  }
}

/* ========================================
   Calendar Modal Styles
   ======================================== */

/* カレンダーモーダルのオーバーレイ */
.calendar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.calendar-modal[hidden] {
  display: none;
}

/* カレンダーモーダルのコンテンツ */
.calendar-modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* カレンダーモーダルのヘッダー */
.calendar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.calendar-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.calendar-close-button {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.calendar-close-button:hover {
  background-color: #f5f5f5;
  color: #333;
}

.calendar-close-button:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* カレンダーモーダルのボディ */
.calendar-modal-body {
  padding: 1.5rem;
}

.calendar-modal-description {
  font-size: 0.9375rem;
  color: #666;
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

/* カレンダーオプション */
.calendar-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calendar-option-button {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background-color: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  text-align: left;
  width: 100%;
}

.calendar-option-button:hover {
  background-color: #e3f2fd;
  border-color: #0066cc;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.calendar-option-button:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.calendar-option-button:active {
  transform: translateY(0);
}

.calendar-option-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.calendar-option-text {
  font-weight: 500;
  color: #333;
  line-height: 1.4;
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
  .calendar-modal {
    padding: 0.5rem;
  }
  
  .calendar-modal-content {
    max-width: 100%;
  }
  
  .calendar-modal-header {
    padding: 1rem 1.25rem;
  }
  
  .calendar-modal-title {
    font-size: 1.125rem;
  }
  
  .calendar-modal-body {
    padding: 1.25rem;
  }
  
  .calendar-modal-description {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
  }
  
  .calendar-option-button {
    padding: 0.875rem 1rem;
    gap: 0.875rem;
  }
  
  .calendar-option-icon {
    font-size: 1.5rem;
  }
  
  .calendar-option-text {
    font-size: 0.9375rem;
  }
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
  .calendar-modal-content {
    background-color: #2c2c2c;
  }
  
  .calendar-modal-header {
    border-bottom-color: #444;
  }
  
  .calendar-modal-title {
    color: #f5f5f5;
  }
  
  .calendar-close-button {
    color: #ccc;
  }
  
  .calendar-close-button:hover {
    background-color: #3c3c3c;
    color: #f5f5f5;
  }
  
  .calendar-modal-description {
    color: #ccc;
  }
  
  .calendar-option-button {
    background-color: #3c3c3c;
    border-color: #555;
  }
  
  .calendar-option-button:hover {
    background-color: #1a3a5c;
    border-color: #4a90e2;
  }
  
  .calendar-option-text {
    color: #f5f5f5;
  }
}

/* ========================================
   Trip Timetable Display Styles
   ======================================== */

/* 時刻表セクション */
.trip-timetable {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
}

/* 時刻表ヘッダー */
.timetable-header {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0066cc;
}

.timetable-header strong {
  color: #0066cc;
}

.route-info {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  margin-top: 0.25rem;
}

/* 時刻表コンテンツ */
.timetable-content {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
}

/* スクロールバーのスタイリング（Webkit系ブラウザ） */
.timetable-content::-webkit-scrollbar {
  width: 8px;
}

.timetable-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.timetable-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.timetable-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 時刻表停車バス停リスト */
.timetable-stops {
  line-height: 1.8;
}

/* 停車バス停アイテム */
.stop-item {
  display: inline;
  font-size: 0.875rem;
  color: #333;
  margin: 0 0.25rem;
}

/* 矢印 */
.stop-arrow {
  display: inline;
  color: #999;
  margin: 0 0.5rem;
  font-weight: 400;
}

/* 現在位置のバス停 */
.current-stop {
  font-weight: 700;
  color: #0066cc;
  background-color: #e3f2fd;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* 現在地マーカー */
.current-marker {
  color: #ff6b6b;
  font-size: 0.875rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

/* 折りたたみリンク */
.timetable-toggle {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0066cc;
  text-decoration: underline;
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.2s;
}

.timetable-toggle:hover {
  color: #0052a3;
  text-decoration: none;
  background-color: #f0f7ff;
  border-radius: 4px;
}

.timetable-toggle:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.timetable-toggle:active {
  transform: translateY(1px);
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
  .trip-timetable {
    padding: 0.875rem;
  }
  
  .timetable-header {
    font-size: 0.9375rem;
  }
  
  .route-info {
    font-size: 0.8125rem;
  }
  
  .stop-item {
    font-size: 0.8125rem;
  }
  
  .timetable-toggle {
    font-size: 0.8125rem;
    padding: 0.5rem;
  }
}

/* 車両マーカーの吹き出し内の時刻表テキスト */
.trip-timetable-text {
  margin-top: 10px;
  padding: 8px;
  background-color: #f5f5f5;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
}

.trip-timetable-text > div:last-child {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #888 #f5f5f5;
}

/* スクロールバーのスタイリング（Webkit系ブラウザ） */
.trip-timetable-text > div:last-child::-webkit-scrollbar {
  width: 8px;
}

.trip-timetable-text > div:last-child::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

.trip-timetable-text > div:last-child::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.trip-timetable-text > div:last-child::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ========================================
   運行情報表示（お知らせ）
   ======================================== */

.realtime-alerts-container {
  width: 100%;
  padding: 1rem;
  background-color: #fff;
  border-bottom: 2px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-section {
  margin-bottom: 1rem;
}

.alert-section:last-child {
  margin-bottom: 0;
}

.alert-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #333;
}

.alert-section-cancellation .alert-title {
  color: #d32f2f;
}

.alert-section-delay .alert-title {
  color: #f57c00;
}

.alert-card {
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  border-left: 4px solid;
  background-color: #fafafa;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.alert-card:last-child {
  margin-bottom: 0;
}

.alert-card-red {
  border-left-color: #d32f2f;
  background-color: #ffebee;
}

.alert-card-yellow {
  border-left-color: #f57c00;
  background-color: #fff3e0;
}

.alert-header {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.alert-card-red .alert-header {
  color: #d32f2f;
}

.alert-card-yellow .alert-header {
  color: #f57c00;
}

.alert-description {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

.alert-more-link {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0066cc;
  text-decoration: underline;
  border-radius: 4px;
  transition: all 0.2s;
}

.alert-more-link:hover {
  color: #0052a3;
  text-decoration: none;
  background-color: #f0f7ff;
}

.alert-more-link:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
  .realtime-alerts-container {
    padding: 0.75rem;
  }
  
  .alert-title {
    font-size: 0.9375rem;
  }
  
  .alert-card {
    padding: 0.75rem;
  }
  
  .alert-header {
    font-size: 0.875rem;
  }
  
  .alert-description {
    font-size: 0.8125rem;
  }
  
  .alert-more-link {
    font-size: 0.8125rem;
    padding: 0.5rem;
  }
}

/* ========================================
   方向選択UI（要件4.3）
   ======================================== */

.direction-selector {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.direction-selector-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.direction-options {
  display: flex;
  gap: 0.5rem;
}

.direction-button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.direction-button:hover {
  background-color: #e8e8e8;
  border-color: #ccc;
}

.direction-button.active {
  color: white;
  background-color: #0066cc;
  border-color: #0066cc;
}

.direction-button:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* 行き先表示のスタイル */
.result-headsign {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.result-headsign .result-detail-label {
  font-weight: 600;
  color: #666;
}

.result-headsign .result-detail-value {
  color: #0066cc;
  font-weight: 500;
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
  .direction-selector {
    top: 5px;
    right: 5px;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .direction-selector-label {
    font-size: 0.8125rem;
  }
  
  .direction-button {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}
