/* ==========================================
   Google Maps-like Neighborhood Guide
   ========================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  color: #202124;
  background: #fff;
}

/* --- Full-screen Map --- */
#map-container {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0;
}

/* Light map - remove any dark filters */
.leaflet-tile-pane {
  filter: none !important;
}

/* Clean Leaflet controls */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
  border-radius: 8px !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  font-size: 18px !important;
  color: #5f6368 !important;
  background: #fff !important;
  border-bottom: 1px solid #e8eaed !important;
}
.leaflet-control-zoom a:hover {
  background: #f8f9fa !important;
}

/* Map Style Switcher */
.map-style-switcher {
  display: flex;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  overflow: hidden;
  margin-bottom: 8px;
}
.map-style-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  background: #fff;
  color: #5f6368;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border-right: 1px solid #e8eaed;
  white-space: nowrap;
}
.map-style-btn:last-child {
  border-right: none;
}
.map-style-btn:hover {
  background: #f1f3f4;
}
.map-style-btn.active {
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 500;
}
.map-style-btn span {
  pointer-events: none;
}

/* Leaflet popup - Google style */
.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15) !important;
  padding: 0 !important;
  overflow: hidden;
}
.leaflet-popup-content {
  margin: 0 !important;
  font-family: 'Noto Sans Thai', sans-serif !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  min-width: 200px;
}
.leaflet-popup-tip {
  box-shadow: 0 2px 12px rgba(0,0,0,0.15) !important;
}
.leaflet-popup-close-button {
  color: #5f6368 !important;
  font-size: 20px !important;
  padding: 8px !important;
  width: 32px !important;
  height: 32px !important;
}

/* Popup inner content */
.popup-inner {
  padding: 16px;
}
.popup-title {
  font-weight: 600;
  font-size: 15px;
  color: #202124;
  margin-bottom: 2px;
}
.popup-subtitle {
  font-size: 12px;
  color: #70757a;
  margin-bottom: 8px;
}
.popup-info {
  font-size: 13px;
  color: #5f6368;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.popup-note {
  background: #fef7e0;
  border-left: 3px solid #fbbc04;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #5f6107;
  margin: 8px 0;
}
.popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.popup-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: #1a73e8;
  color: #fff !important;
  border-radius: 20px;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s;
}
.popup-nav-btn:hover {
  background: #1557b0;
}
.leaflet-popup-content .popup-actions a.popup-nav-btn,
.leaflet-popup-content .popup-actions a.popup-nav-btn:visited,
.leaflet-popup-content .popup-actions a.popup-nav-btn:hover,
.leaflet-popup-content .popup-actions a.popup-nav-btn:active {
  color: #fff !important;
  text-decoration: none !important;
}

/* --- Map Markers --- */
.center-marker {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #ea4335;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  animation: center-pulse 2s ease-in-out infinite;
}

@keyframes center-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 0 rgba(234,67,53,0.3); }
  50% { box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 12px rgba(234,67,53,0); }
}

/* 7-Eleven marker */
.seven-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff0000 0%, #ff6600 30%, #00814a 70%, #00814a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.seven-marker:hover,
.seven-marker.selected {
  transform: scale(1.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.seven-logo {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  font-family: Arial, sans-serif;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.seven-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

/* 7-Eleven logo in place cards */
.seven-card-icon {
  background: #fff !important;
  border: 2px solid #00814a;
}
.seven-card-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
}

/* 7-Eleven logo in detail panel */
.seven-detail-icon {
  background: #fff !important;
  border: 2px solid #00814a;
}
.seven-detail-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 4px;
}

/* Café marker */
.cafe-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #795548;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cafe-marker:hover,
.cafe-marker.selected {
  transform: scale(1.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.cafe-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Café logo in place cards */
.cafe-card-icon {
  background: #795548 !important;
}
.cafe-card-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* Café logo in detail panel */
.cafe-detail-icon {
  background: #795548 !important;
}
.cafe-detail-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.house-marker {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #4285f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.place-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.place-marker:hover,
.place-marker.selected {
  transform: scale(1.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 1000 !important;
}

/* --- Icon Button --- */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: #5f6368;
  transition: background 0.2s;
}
.icon-btn:hover {
  background: #f1f3f4;
}

/* --- Sidebar --- */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 400px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.collapsed {
  transform: translateX(-400px);
}

#sidebar-header {
  padding: 16px 16px 8px;
  border-bottom: 1px solid #e8eaed;
}
.sidebar-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  color: #202124;
}
.sidebar-logo .material-symbols-outlined {
  color: #ea4335;
  font-size: 24px;
}
.sidebar-greeting {
  font-size: 13px;
  color: #5f6368;
  margin-top: 8px;
  padding-bottom: 4px;
}

/* Search */
.sidebar-search {
  position: relative;
  padding: 12px 16px;
}
.sidebar-search .search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #5f6368;
  font-size: 20px;
  pointer-events: none;
}
.sidebar-search input {
  width: 100%;
  padding: 10px 40px 10px 44px;
  border: none;
  border-radius: 24px;
  background: #f1f3f4;
  font-size: 14px;
  font-family: inherit;
  color: #202124;
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.sidebar-search input:focus {
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}
.sidebar-search input::placeholder {
  color: #9aa0a6;
}
.search-clear {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.search-clear .material-symbols-outlined {
  font-size: 18px;
}

/* Category Chips */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 16px 12px;
}
.chip-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  background: #f1f3f4;
  border: 1px solid #dadce0;
  font-size: 13px;
  font-family: inherit;
  color: #5f6368;
  cursor: pointer;
  transition: all 0.2s;
}
.category-chip:hover {
  background: #e8eaed;
}
.category-chip.active {
  background: #e8f0fe;
  border-color: #1a73e8;
  color: #1a73e8;
  font-weight: 500;
}

/* Place List */
.place-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #dadce0 transparent;
}
.place-list::-webkit-scrollbar {
  width: 6px;
}
.place-list::-webkit-scrollbar-thumb {
  background: #dadce0;
  border-radius: 3px;
}

.place-card {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.place-card:hover {
  background: #f8f9fa;
}
.place-card.selected {
  background: #e8f0fe;
}
.place-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}
.place-card-info {
  flex: 1;
  min-width: 0;
}
.place-card-name {
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 2px;
  line-height: 1.3;
}
.place-card-meta {
  font-size: 12px;
  color: #70757a;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.place-card-note {
  background: #fef7e0;
  border-left: 3px solid #fbbc04;
  padding: 5px 10px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #5f6107;
  margin-top: 6px;
  line-height: 1.4;
}
.place-card-distance {
  font-size: 12px;
  color: #70757a;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

.no-results {
  padding: 40px 16px;
  text-align: center;
  color: #9aa0a6;
  font-size: 14px;
}

/* --- Sidebar Toggle Button --- */
.sidebar-toggle {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 450;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  transition: background 0.2s;
}
.sidebar-toggle:hover {
  background: #f8f9fa;
}

/* --- Detail Panel --- */
.detail-panel {
  position: fixed;
  left: 0;
  top: 0;
  width: 400px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transform: translateX(-400px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.detail-panel.visible {
  transform: translateX(0);
}
.detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #e8eaed;
}
.detail-header-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}
.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

.detail-place-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin-bottom: 16px;
}
.detail-place-name {
  font-size: 20px;
  font-weight: 600;
  color: #202124;
  margin-bottom: 4px;
}
.detail-place-name-en {
  font-size: 13px;
  color: #70757a;
  margin-bottom: 12px;
}
.detail-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 16px;
}
.detail-friend-note {
  background: #fef7e0;
  border-left: 4px solid #fbbc04;
  padding: 12px 16px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 20px;
}
.detail-friend-note-label {
  font-size: 11px;
  font-weight: 600;
  color: #f9a825;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.detail-friend-note-text {
  font-size: 14px;
  color: #5f6107;
  line-height: 1.5;
}
.detail-info-list {
  list-style: none;
  margin-bottom: 20px;
}
.detail-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
  color: #3c4043;
}
.detail-info-item .material-symbols-outlined {
  color: #5f6368;
  font-size: 20px;
}
.detail-info-item a {
  color: #1a73e8;
  text-decoration: none;
}
.detail-info-item a:hover {
  text-decoration: underline;
}
.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.detail-nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: 24px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.detail-nav-btn.primary {
  background: #1a73e8;
  color: #fff;
}
.detail-nav-btn.primary:hover {
  background: #1557b0;
}
.detail-nav-btn.secondary {
  background: #f1f3f4;
  color: #1a73e8;
}
.detail-nav-btn.secondary:hover {
  background: #e8eaed;
}

/* --- FABs --- */
.fab-container {
  position: fixed;
  bottom: 32px;
  right: 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fab {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  transition: all 0.2s;
}
.fab:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  background: #f8f9fa;
}
.fab-emergency {
  background: #db4437;
  color: #fff;
}
.fab-emergency:hover {
  background: #c62828;
}
.fab-notes {
  background: #fbbc04;
  color: #202124;
}
.fab-notes:hover {
  background: #f9a825;
}

/* Note cards */
.note-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fef7e0;
  border-radius: 12px;
  margin-bottom: 12px;
}
.note-card-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.note-card-info {
  flex: 1;
}
.note-card-title {
  font-weight: 600;
  font-size: 14px;
  color: #202124;
  margin-bottom: 4px;
}
.note-card-text {
  font-size: 13px;
  color: #5f6368;
  line-height: 1.5;
}

/* --- Overlays --- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.overlay-panel {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.overlay.visible .overlay-panel {
  transform: translateY(0);
}
.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid #e8eaed;
}
.overlay-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #202124;
}
.overlay-header h2 .material-symbols-outlined {
  font-size: 24px;
}
.overlay-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
}

/* Transport route card */
.transport-card {
  padding: 16px;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  margin-bottom: 12px;
  transition: background 0.15s;
}
.transport-card:hover {
  background: #f8f9fa;
}
.transport-card-dest {
  font-weight: 600;
  font-size: 15px;
  color: #202124;
  margin-bottom: 4px;
}
.transport-card-note {
  font-size: 12px;
  color: #1a73e8;
  margin-bottom: 8px;
}
.transport-card-meta {
  font-size: 13px;
  color: #5f6368;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.transport-card-actions {
  display: flex;
  gap: 8px;
}

/* Roads section in transport overlay */
.roads-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e8eaed;
}
.roads-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: #202124;
  margin-bottom: 12px;
}
.road-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f3f4;
}
.road-name {
  font-size: 14px;
  font-weight: 500;
  color: #202124;
}
.road-desc {
  font-size: 12px;
  color: #70757a;
}

/* Emergency card */
.emergency-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.emergency-card:hover {
  background: #fce8e6;
}
.emergency-card-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.emergency-card-info {
  flex: 1;
  min-width: 0;
}
.emergency-card-name {
  font-size: 14px;
  font-weight: 500;
  color: #202124;
}
.emergency-card-desc {
  font-size: 12px;
  color: #70757a;
}
.emergency-card-number {
  font-size: 16px;
  font-weight: 600;
  color: #db4437;
  white-space: nowrap;
}

/* --- Mobile Bottom Sheet --- */
.bottom-sheet {
  display: none;
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* ==========================================
   Mobile Responsive
   ========================================== */
@media (max-width: 768px) {
  /* Hide desktop sidebar */
  #sidebar {
    display: none;
  }
  #sidebar-toggle {
    display: none !important;
  }

  /* Detail panel full width on mobile */
  .detail-panel {
    width: 100%;
    transform: translateX(-100%);
  }

  /* Show bottom sheet */
  .bottom-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 450;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
    max-height: 85vh;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    touch-action: none;
  }
  .bottom-sheet.collapsed {
    transform: translateY(calc(100% - 160px));
  }
  .bottom-sheet.half {
    transform: translateY(50%);
  }
  .bottom-sheet.full {
    transform: translateY(0);
  }

  .bottom-sheet-handle-area {
    padding: 8px 0;
    cursor: grab;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
  }
  .bottom-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #dadce0;
  }
  .bottom-sheet-header {
    flex-shrink: 0;
  }
  .bottom-sheet-greeting {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    padding: 4px 16px 0;
  }
  .bottom-sheet .place-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* FABs adjust */
  .fab-container {
    bottom: 176px;
    right: 12px;
  }

  /* Overlay full width */
  .overlay-panel {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  #sidebar {
    width: 340px;
  }
  .detail-panel {
    width: 340px;
    transform: translateX(-340px);
  }
}

/* ==========================================
   Dark Mode
   ========================================== */

/* Dark mode toggle button */
.dark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: #5f6368;
  font-size: 20px;
  transition: background 0.2s, color 0.2s;
}
.dark-toggle:hover {
  background: #f1f3f4;
}
body.dark .dark-toggle {
  color: #e8eaed;
}
body.dark .dark-toggle:hover {
  background: #3d3d3d;
}

/* Body dark base */
body.dark {
  color: #e8eaed;
  background: #1e1e1e;
}

/* Sidebar */
body.dark #sidebar {
  background: #1e1e1e;
  box-shadow: 2px 0 12px rgba(0,0,0,0.4);
}
body.dark #sidebar-header {
  border-bottom-color: #3d3d3d;
}
body.dark .sidebar-logo {
  color: #e8eaed;
}
body.dark .sidebar-greeting {
  color: #9aa0a6;
}

/* Search */
body.dark .sidebar-search input {
  background: #2d2d2d;
  color: #e8eaed;
  box-shadow: none;
}
body.dark .sidebar-search input:focus {
  background: #3d3d3d;
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
body.dark .sidebar-search input::placeholder {
  color: #6b6b6b;
}
body.dark .sidebar-search .search-icon {
  color: #9aa0a6;
}

/* Category chips */
body.dark .category-chip {
  background: #2d2d2d;
  border-color: #3d3d3d;
  color: #9aa0a6;
}
body.dark .category-chip:hover {
  background: #3d3d3d;
}
body.dark .category-chip.active {
  background: #1a3a5c;
  border-color: #4285f4;
  color: #8ab4f8;
}

/* Place cards */
body.dark .place-card {
  border-bottom-color: #2d2d2d;
}
body.dark .place-card:hover {
  background: #2d2d2d;
}
body.dark .place-card.selected {
  background: #1a3a5c;
}
body.dark .place-card-name {
  color: #e8eaed;
}
body.dark .place-card-meta {
  color: #9aa0a6;
}
body.dark .place-card-distance {
  color: #9aa0a6;
}
body.dark .place-card-note {
  background: #3a3520;
  border-left-color: #f9a825;
  color: #fdd663;
}
body.dark .no-results {
  color: #6b6b6b;
}

/* Detail panel */
body.dark .detail-panel {
  background: #1e1e1e;
  box-shadow: 2px 0 12px rgba(0,0,0,0.4);
}
body.dark .detail-header {
  border-bottom-color: #3d3d3d;
}
body.dark .detail-header-title {
  color: #e8eaed;
}
body.dark .detail-place-name {
  color: #e8eaed;
}
body.dark .detail-place-name-en {
  color: #9aa0a6;
}
body.dark .detail-friend-note {
  background: #3a3520;
  border-left-color: #f9a825;
}
body.dark .detail-friend-note-label {
  color: #fdd663;
}
body.dark .detail-friend-note-text {
  color: #fdd663;
}
body.dark .detail-info-item {
  border-bottom-color: #2d2d2d;
  color: #e8eaed;
}
body.dark .detail-info-item .material-symbols-outlined {
  color: #9aa0a6;
}
body.dark .detail-info-item a {
  color: #8ab4f8;
}
body.dark .detail-nav-btn.secondary {
  background: #2d2d2d;
  color: #8ab4f8;
}
body.dark .detail-nav-btn.secondary:hover {
  background: #3d3d3d;
}

/* Icon buttons */
body.dark .icon-btn {
  color: #9aa0a6;
}
body.dark .icon-btn:hover {
  background: #3d3d3d;
}

/* Sidebar toggle */
body.dark .sidebar-toggle {
  background: #2d2d2d;
  color: #e8eaed;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
body.dark .sidebar-toggle:hover {
  background: #3d3d3d;
}

/* FABs */
body.dark .fab {
  background: #2d2d2d;
  color: #e8eaed;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
body.dark .fab:hover {
  background: #3d3d3d;
}
body.dark .fab-emergency {
  background: #c62828;
  color: #fff;
}
body.dark .fab-emergency:hover {
  background: #b71c1c;
}
body.dark .fab-notes {
  background: #f9a825;
  color: #202124;
}
body.dark .note-card {
  background: #3a3520;
}
body.dark .note-card-title {
  color: #e8eaed;
}
body.dark .note-card-text {
  color: #9aa0a6;
}

/* Overlays */
body.dark .overlay-panel {
  background: #1e1e1e;
}
body.dark .overlay-header {
  border-bottom-color: #3d3d3d;
}
body.dark .overlay-header h2 {
  color: #e8eaed;
}
body.dark .transport-card {
  border-color: #3d3d3d;
}
body.dark .transport-card:hover {
  background: #2d2d2d;
}
body.dark .transport-card-dest {
  color: #e8eaed;
}
body.dark .transport-card-note {
  color: #8ab4f8;
}
body.dark .transport-card-meta {
  color: #9aa0a6;
}
body.dark .roads-section {
  border-top-color: #3d3d3d;
}
body.dark .roads-section h3 {
  color: #e8eaed;
}
body.dark .road-item {
  border-bottom-color: #2d2d2d;
}
body.dark .road-name {
  color: #e8eaed;
}
body.dark .road-desc {
  color: #9aa0a6;
}
body.dark .emergency-card {
  border-color: #3d3d3d;
}
body.dark .emergency-card:hover {
  background: #3d2020;
}
body.dark .emergency-card-name {
  color: #e8eaed;
}
body.dark .emergency-card-desc {
  color: #9aa0a6;
}

/* Map controls */
body.dark .leaflet-control-zoom a {
  background: #2d2d2d !important;
  color: #e8eaed !important;
  border-bottom-color: #3d3d3d !important;
}
body.dark .leaflet-control-zoom a:hover {
  background: #3d3d3d !important;
}
body.dark .leaflet-control-zoom {
  box-shadow: 0 1px 4px rgba(0,0,0,0.5) !important;
}
body.dark .map-style-switcher {
  background: #2d2d2d;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
body.dark .map-style-btn {
  background: #2d2d2d;
  color: #9aa0a6;
  border-right-color: #3d3d3d;
}
body.dark .map-style-btn:hover {
  background: #3d3d3d;
}
body.dark .map-style-btn.active {
  background: #1a3a5c;
  color: #8ab4f8;
}

/* Leaflet popups */
body.dark .leaflet-popup-content-wrapper {
  background: #2d2d2d !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4) !important;
}
body.dark .leaflet-popup-tip {
  background: #2d2d2d !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4) !important;
}
body.dark .leaflet-popup-close-button {
  color: #9aa0a6 !important;
}
body.dark .popup-title {
  color: #e8eaed;
}
body.dark .popup-subtitle {
  color: #9aa0a6;
}
body.dark .popup-info {
  color: #9aa0a6;
}
body.dark .popup-info a {
  color: #8ab4f8;
}
body.dark .popup-note {
  background: #3a3520;
  border-left-color: #f9a825;
  color: #fdd663;
}

/* Mobile bottom sheet */
body.dark .bottom-sheet {
  background: #1e1e1e;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.4);
}
body.dark .bottom-sheet-handle {
  background: #5f6368;
}
body.dark .bottom-sheet-greeting {
  color: #e8eaed;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
