/* ─── Design tokens (reused from existing templates) ─── */
:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text: #333;
  --text-secondary: #666;
  --text-muted: #888;
  --border: #e2e8f0;
  --rating: #f5a623;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ─── Navbar ─── */
.navbar {
  background: var(--gradient);
  color: white;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 20px;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: #333;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.btn-login:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.btn-login svg {
  width: 18px;
  height: 18px;
}

.user-menu {
  position: relative;
}
.user-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.user-toggle:hover {
  background: rgba(255,255,255,0.15);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  min-width: 180px;
  overflow: hidden;
  z-index: 200;
}
.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.user-dropdown a:hover,
.user-dropdown button:hover {
  background: #f7fafc;
}

/* ─── Main content ─── */
.main {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ─── Search panel ─── */
.search-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.search-panel h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text);
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-select,
.form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.form-select:focus,
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ─── Radio pill group ─── */
.radio-group {
  display: flex;
  gap: 8px;
}
.radio-pill {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.radio-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.radio-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ─── Type-ahead ─── */
.typeahead {
  position: relative;
}
.typeahead-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
}
.typeahead-item {
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.typeahead-item:hover,
.typeahead-item.highlighted {
  background: #f0f4ff;
}
.typeahead-item .name {
  font-weight: 500;
}
.typeahead-item .meta {
  color: var(--text-muted);
  font-size: 13px;
}
.typeahead-item .icon {
  margin-right: 8px;
}

/* ─── Search button ─── */
.btn-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  width: 100%;
  justify-content: center;
}
.btn-search:hover {
  opacity: 0.9;
}
.btn-search:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Results ─── */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.results-header h2 {
  font-size: 18px;
}
.results-header .count {
  font-size: 14px;
  color: var(--text-muted);
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Result card ─── */
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 12px;
}
.result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #edf2f7;
}

.card-content {
  flex: 1;
  min-width: 0;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.card-type {
  font-size: 12px;
  color: var(--primary);
  background: rgba(102, 126, 234, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: capitalize;
  white-space: nowrap;
}
.card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.card-rating {
  color: var(--rating);
}
.card-distance {
  color: var(--text-muted);
}
.card-address {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.card-cuisine {
  font-size: 12px;
  color: var(--primary);
  margin-top: 6px;
}

.card-actions {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.btn-fav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.15s;
}
.btn-fav:hover {
  color: #e53e3e;
}
.btn-fav.active {
  color: #e53e3e;
}

/* ─── Empty / Loading states ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── POI detail page ─── */
.poi-detail {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.poi-detail-actions {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.poi-detail-actions a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
}
.poi-detail iframe {
  width: 100%;
  border: none;
  min-height: 600px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 16px;
}
.btn-back:hover {
  color: var(--primary);
}

/* ─── Favorites page ─── */
.fav-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.fav-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.fav-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.fav-filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ─── Discover section ─── */
.discover-section {
  margin-bottom: 24px;
}
.discover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.discover-title {
  font-size: 18px;
  color: var(--text);
}
.discover-refresh {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s;
}
.discover-refresh:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.discover-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Map layout ─── */
.map-search-overlay {
  position: absolute;
  top: 68px; /* below navbar */
  left: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  width: calc(100% - 24px);
}

.map-search-bar {
  position: relative;
}

.map-search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: none;
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  outline: none;
}
.map-search-input:focus {
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

.map-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
}

.map-type-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.map-filter-pill {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 20px;
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: all 0.15s;
  white-space: nowrap;
}
.map-filter-pill:hover {
  background: #f0f4ff;
  color: var(--primary);
}
.map-filter-pill.active {
  background: var(--primary);
  color: white;
}

/* POI card (bottom sheet) */
.map-poi-card {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  max-width: 420px;
  width: calc(100% - 24px);
  overflow: hidden;
}

.map-poi-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.map-poi-close:hover {
  background: rgba(0,0,0,0.6);
}

.map-poi-content {
  display: flex;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}

.map-poi-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #edf2f7;
}

.map-poi-info {
  flex: 1;
  min-width: 0;
}

/* Locate me button */
.map-locate-btn {
  position: absolute;
  bottom: 120px;
  right: 12px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  background: white;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.15s, box-shadow 0.15s;
}
.map-locate-btn:hover {
  color: var(--primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* Custom marker colors */
.marker-hotel { background-color: #4285F4; }
.marker-restaurant { background-color: #EA4335; }
.marker-attraction { background-color: #34A853; }
.marker-default { background-color: #667eea; }

.map-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .main { padding: 16px 8px; }
  .search-panel { padding: 16px; }
  .result-card { flex-direction: column; }
  .card-thumb { width: 100%; height: 160px; }
}
