/* YourCity.in – Map styles */
:root {
  --header-bg: #1a1d29;
  --header-text: #e8eaed;
  --panel-bg: #fff;
  --panel-border: #e0e0e0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --map-bg: #e2e8f0;
  --shadow: 0 2px 8px rgba(0,0,0,0.12);
  --radius: 8px;
  --panel-width: 360px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--map-bg);
  color: #1f2937;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Header */
.header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.logo {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
}

.logo-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 220px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search {
  width: 220px;
  padding: 8px 32px 8px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.08);
  color: var(--header-text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.search::placeholder {
  color: rgba(255,255,255,0.5);
}

.search:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.12);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: var(--header-text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: rgba(255,255,255,0.3);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.08);
  color: var(--header-text);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.filter:focus {
  border-color: var(--accent);
}

.filter option {
  background: var(--header-bg);
  color: var(--header-text);
}

/* Main + Map */
.main {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--map-bg);
}

/* Mapbox controls */
.mapboxgl-ctrl-group {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
}
.mapboxgl-ctrl-group button {
  width: 32px;
  height: 32px;
}
.mapboxgl-ctrl-geolocate {
  font-size: 18px;
}

/* Map error (no token) */
.map-error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #374151;
  background: #f3f4f6;
}
.map-error code {
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
}
.map-error a {
  color: var(--accent);
}

/* Side panel */
.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: var(--panel-width);
  height: 100%;
  background: var(--panel-bg);
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  z-index: 800;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, visibility 0.25s;
  overflow: hidden;
}

.side-panel.closed {
  transform: translateX(100%);
  visibility: hidden;
}

.side-panel.open {
  transform: translateX(0);
  visibility: visible;
}

.panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-close:hover {
  background: #e5e7eb;
  color: #374151;
}

.panel-content {
  flex: 1;
  overflow: hidden;
  padding: 20px 24px 24px;
  padding-top: 52px;
}

.panel-placeholder {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0;
}

.city-name {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

.city-detail {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.city-detail strong {
  display: inline-block;
  min-width: 90px;
  color: #4b5563;
}

.attractions-list {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 0.9rem;
  color: #374151;
}

.attractions-list li {
  margin-bottom: 4px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 10px 20px;
  background: #1f2937;
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 2000;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .controls {
    margin-left: 0;
  }

  .search {
    width: 100%;
  }

  .filters {
    justify-content: flex-start;
  }

  .side-panel {
    max-width: 100%;
  }
}
