/* transport.css — 교통 정보 PWA 다크테마 + 접근성 */

/* ── 리셋 & 기본 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%; overflow: hidden;
}
body {
  font-family: -apple-system, 'Malgun Gothic', 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.6;
  color: #d4d4d4; background: #1a1a2e;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
#app {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}

/* ── 모드 탭 ── */
.mode-tabs {
  display: flex; gap: 0;
  background: #0f3460;
  border-bottom: 2px solid #16213e;
  flex-shrink: 0;
}
.mode-tab {
  flex: 1; padding: 12px 6px;
  text-align: center; font-size: 14px; font-weight: 600;
  color: #8899aa; cursor: pointer;
  border: none; background: transparent;
  transition: color .15s, background .15s;
  min-height: 48px;
}
.mode-tab:hover { color: #ccc; background: rgba(255,255,255,.05); }
.mode-tab.active {
  color: #fff; background: #16213e;
  border-bottom: 2px solid #5dade2;
}
.mode-tab:focus, .mode-tab:focus-visible {
  outline: 2px solid #5dade2; outline-offset: -2px;
}
.mode-tab .shortcut {
  font-size: 10px; color: #667; display: block;
}

/* ── 검색 바 ── */
.search-bar {
  padding: 10px 12px; flex-shrink: 0;
  display: flex; gap: 8px;
}
.search-bar input {
  flex: 1; padding: 12px 14px;
  font-size: 16px; border-radius: 10px;
  border: 1px solid #2a2a4e;
  background: #16213e; color: #e0e0e0;
}
.search-bar input::placeholder { color: #666; }
.search-bar input:focus {
  border-color: #5dade2;
  box-shadow: 0 0 0 2px rgba(93,173,226,.3);
  outline: none;
}
.search-btn {
  padding: 12px 16px; font-size: 15px; font-weight: 700;
  border: none; border-radius: 10px;
  background: #5dade2; color: #fff;
  cursor: pointer; white-space: nowrap;
  min-height: 48px;
}
.search-btn:active { background: #3498db; }

/* ── 아이템 리스트 ── */
.item-list {
  flex: 1; overflow-y: auto;
  padding: 0 8px 8px;
  -webkit-overflow-scrolling: touch;
}
.item-list[role="listbox"]:focus-visible {
  outline: none;
}
.item {
  padding: 14px 14px; border-radius: 10px;
  cursor: pointer; font-size: 15px;
  color: #d4d4d4; transition: background .1s;
  min-height: 48px;
}
.item:hover { background: rgba(255,255,255,.04); }
.item.sel {
  background: #0f3460; color: #fff;
  outline: 2px solid #5dade2; outline-offset: -2px;
}
.item .sub {
  font-size: 13px; color: #888; display: block;
}

/* ── 상세 뷰 컨테이너 ── */
.detail-view {
  flex: 1; overflow-y: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}

/* ── 카드 ── */
.card {
  background: #16213e;
  border-radius: 12px;
  padding: 16px 18px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.card-title {
  font-size: 16px; font-weight: 700;
  margin-bottom: 10px; color: #e0e0e0;
  display: flex; align-items: center; gap: 6px;
}
.card-title .sub {
  font-weight: 400; font-size: 13px; color: #888;
}

/* ── 경고 배너 ── */
.warn-banner {
  padding: 10px 14px; border-radius: 10px;
  font-weight: 700; font-size: 14px;
  text-align: center; margin-bottom: 10px; color: #fff;
}
.warn-end { background: #e74c3c; }
.warn-last { background: #e67e22; }

/* ── 버스 행 ── */
.bus-row {
  display: flex; align-items: center;
  gap: 12px; padding: 12px 0;
  border-bottom: 1px solid #2a2a4e;
}
.bus-row:last-child { border-bottom: none; }
.bus-stops {
  font-size: 28px; font-weight: 700;
  color: #e0e0e0; min-width: 54px;
  text-align: center; line-height: 1;
}
.bus-stops .unit {
  font-size: 12px; font-weight: 400;
  color: #888; display: block;
}
.bus-info { flex: 1; }
.bus-eta {
  font-size: 16px; font-weight: 700; color: #5dade2;
}
.bus-station {
  font-size: 14px; color: #aaa; margin-top: 2px;
}
.bus-plate {
  font-size: 13px; color: #888;
  font-family: 'D2Coding', 'Consolas', monospace;
}

/* ── 혼잡도 배지 ── */
.cr-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 12px;
  font-weight: 700; font-size: 12px; color: #fff;
  margin-left: 6px; vertical-align: middle;
}
.cr-good { background: #27ae60; }
.cr-normal { background: #f39c12; }
.cr-busy { background: #e74c3c; }
.cr-very-busy { background: #8e44ad; }

/* ── 운행 없음 ── */
.no-bus {
  text-align: center; padding: 30px;
  color: #888; font-size: 15px;
}

/* ── 즐겨찾기 행 ── */
.fav-row {
  display: flex; align-items: center;
  gap: 10px; padding: 14px 0;
  border-bottom: 1px solid #2a2a4e;
}
.fav-row:last-child { border-bottom: none; }
.fav-star { font-size: 20px; color: #f1c40f; }
.fav-route {
  font-size: 16px; font-weight: 700;
  color: #e0e0e0; min-width: 70px;
}
.fav-station { font-size: 14px; color: #aaa; flex: 1; }
.fav-eta { font-size: 15px; font-weight: 700; color: #5dade2; }
.fav-status { font-size: 13px; color: #999; }

/* ── 승차 중 카드 ── */
.riding-card { text-align: center; padding: 24px 18px; }
.riding-label { font-size: 14px; color: #999; margin-bottom: 2px; }
.riding-value { font-size: 17px; font-weight: 600; color: #e0e0e0; }
.riding-remaining {
  font-size: 48px; font-weight: 700;
  color: #5dade2; margin: 12px 0; line-height: 1;
}
.riding-remaining .unit {
  font-size: 16px; font-weight: 400; color: #888;
}

/* ── 도착 화면 ── */
.arrived { text-align: center; padding: 40px; }
.arrived-emoji { font-size: 48px; margin-bottom: 10px; }
.arrived-text { font-size: 20px; font-weight: 700; color: #2ecc71; }
.arrived-sub { font-size: 16px; color: #aaa; margin-top: 6px; }

/* ── 다중 노선 구분 ── */
.route-sep {
  font-size: 14px; font-weight: 700;
  color: #888; padding: 6px 0 2px;
}

/* ── 상태바 ── */
.status-bar {
  padding: 10px 12px; font-size: 13px;
  color: #888; background: #0f3460;
  border-top: 1px solid #16213e;
  min-height: 36px; flex-shrink: 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

/* ── 버튼 바 (상세 뷰) ── */
.action-bar {
  display: flex; gap: 0;
  background: #0f3460;
  border-top: 1px solid #16213e;
  flex-shrink: 0;
}
.action-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #8899aa;
  font-size: 14px; font-weight: 700;
  padding: 14px 6px;
  cursor: pointer;
  min-height: 52px;
  transition: color .15s, background .15s;
}
.action-btn:hover, .action-btn:active {
  color: #fff; background: rgba(255,255,255,.08);
}
.action-btn:focus-visible {
  outline: 2px solid #5dade2; outline-offset: -2px;
}
.action-btn.primary { color: #5dade2; }
.action-btn.danger { color: #e74c3c; }

/* ── 경로 결과 역 목록 ── */
.item-list .item[id] {
  /* 기본은 위에서 정의 */
}

/* ── 역 정보 행 ── */
.info-row {
  padding: 8px 0;
  font-size: 15px;
  color: #d4d4d4;
  border-bottom: 1px solid #2a2a4e;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  display: inline-block;
  min-width: 60px;
  font-weight: 700;
  color: #5dade2;
  margin-right: 10px;
}
.info-section {
  font-size: 14px;
  font-weight: 700;
  color: #888;
  padding: 12px 0 4px;
  border-top: 1px solid #2a2a4e;
  margin-top: 4px;
}

/* ── 숨김 ── */
.hidden { display: none !important; }

/* ── ARIA 포커스 스타일 ── */
:focus-visible {
  outline: 2px solid #5dade2;
  outline-offset: 2px;
}
