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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
  background: #000;
}

/* === 모드 탭 === */
#mode-tabs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  background: #1a1a2e;
  border-bottom: 1px solid #333;
}

.mode-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab.active {
  color: #fff;
  background: #1a73e8;
}

/* === 상단 상태바 === */
#status-bar {
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(26, 115, 232, 0.95);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#status-bar.active {
  background: rgba(52, 168, 83, 0.95);
}

#status-icon {
  font-size: 20px;
}

#status-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === 네비 턴바이턴 배너 === */
#navi-banner {
  position: fixed;
  top: 84px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(26, 50, 100, 0.95);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: opacity 0.3s, transform 0.3s;
}

#navi-banner.hidden {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

#navi-turn-icon {
  font-size: 44px;
  min-width: 56px;
  text-align: center;
}

#navi-turn-info {
  flex: 1;
}

#navi-turn-dist {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

#navi-turn-text {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 2px;
}

/* === 지도 === */
#map {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* === 자막 오버레이 === */
#subtitle-overlay {
  position: fixed;
  bottom: 200px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  transition: opacity 0.5s, transform 0.5s;
}

#subtitle-overlay.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

#subtitle-overlay.visible {
  opacity: 1;
  transform: translateY(0);
}

#subtitle-text {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 16px 24px;
  border-radius: 16px;
  font-size: 40px;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
  max-width: 100%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: subtitlePulse 0.3s ease-out;
}

@keyframes subtitlePulse {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* === 검색 패널 === */
#search-panel {
  position: fixed;
  top: 84px;
  left: 0;
  right: 0;
  z-index: 1050;
  padding: 12px 16px;
  transition: opacity 0.3s;
}

#search-panel.hidden {
  opacity: 0;
  pointer-events: none;
}

#search-box {
  display: flex;
  gap: 8px;
}

#search-input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  outline: none;
}

#search-input:focus {
  box-shadow: 0 4px 16px rgba(26,115,232,0.4);
}

#search-btn {
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  background: #1a73e8;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#search-results {
  margin-top: 8px;
  background: rgba(255,255,255,0.97);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  max-height: 50vh;
  overflow-y: auto;
}

#search-results.hidden {
  display: none;
}

.search-result-item {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.15s;
}

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

.search-result-item:active {
  background: #e8f0fe;
}

.search-result-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.search-result-addr {
  font-size: 13px;
  color: #888;
  margin-top: 3px;
}

/* === 하단 컨트롤 (공통) === */
.controls-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  transition: opacity 0.3s, transform 0.3s;
}

.controls-panel.hidden {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

#info-panel, #navi-info-panel {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.info-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.info-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

#btn-start, #navi-start-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #1a73e8;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#btn-start:active, #navi-start-btn:active {
  transform: scale(0.98);
}

#btn-start.running {
  background: #ea4335;
}

#navi-start-btn.navigating {
  background: #ea4335;
}

#navi-start-btn.ready {
  background: #34a853;
}

/* 목적지 표시 */
#navi-dest-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: #e8f0fe;
  border-radius: 10px;
}

#navi-dest-display.hidden {
  display: none;
}

#navi-dest-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #1a73e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#navi-cancel-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  background: #ea4335;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

#interval-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: #666;
}

#interval-select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #f5f5f5;
  color: #333;
}

/* === 마커 === */
.current-location-marker {
  width: 20px;
  height: 20px;
  background: #1a73e8;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.3), 0 2px 8px rgba(0,0,0,0.3);
}

.current-location-marker.active {
  animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
  0% { box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.3), 0 2px 8px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(26, 115, 232, 0.1), 0 2px 8px rgba(0,0,0,0.3); }
  100% { box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.3), 0 2px 8px rgba(0,0,0,0.3); }
}

.dest-marker {
  width: 32px;
  height: 32px;
  font-size: 28px;
  line-height: 32px;
  text-align: center;
}

/* === 경로 라인 === */
.leaflet-interactive {
  stroke-linecap: round;
  stroke-linejoin: round;
}
