/* Extracted from templates/index.html <style> */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1a73e8;
  --primary-hover: #1557b0;
  --secondary-color: #34a853;
  --accent-color: #ea4335;
  --warning-color: #fbbc04;
  --surface-color: #ffffff;
  --surface-variant: #f8f9fa;
  --outline-color: #e8eaed;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-disabled: #9aa0a6;
  --shadow-1: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-2: 0 1px 2px 0 rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
  --shadow-3: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
  --border-radius-small: 8px;
  --border-radius-medium: 12px;
  --border-radius-large: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f0fe 100%);
  color: var(--text-primary);
overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  line-height: 1.5;
}

.main-container {
  display: flex;
  height: 100vh;
  background: var(--surface-color);
}

.sidebar {
  width: 400px;
  background: var(--surface-color);
  border-right: 1px solid var(--outline-color);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-1);
  z-index: 1000;
}

.search-header {
  padding: 24px;
  background: var(--surface-color);
  border-bottom: 1px solid var(--outline-color);
}

.search-header h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-header p {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
}

.search-section {
  padding: 24px;
  border-bottom: 1px solid var(--outline-color);
}

.search-input-container {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 16px 56px 16px 20px;
  border: 1px solid var(--outline-color);
  border-radius: var(--border-radius-large);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  background: var(--surface-color);
  color: var(--text-primary);
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-1);
}

.search-button:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-2);
}

.search-button:disabled {
  background: var(--text-disabled);
  cursor: not-allowed;
  box-shadow: none;
}

.status-indicator {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  font-size: 14px;
  text-align: center;
  display: none;
}

.status-searching {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.status-success {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.status-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.results-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Action buttons (Google Maps-style) */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px 0;
  padding: 10px;
  background: var(--surface-variant);
  border-radius: var(--border-radius-small);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--outline-color);
  border-radius: var(--border-radius-small);
  background: var(--surface-color);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-1);
}

.action-btn.primary {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.action-btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.action-btn.secondary {
  background: var(--secondary-color);
  color: #fff;
  border-color: var(--secondary-color);
}

.action-btn.secondary:hover {
  background: #2e7d32;
  border-color: #2e7d32;
}

.result-item {
  background: var(--surface-color);
  border: 1px solid var(--outline-color);
  border-radius: var(--border-radius-medium);
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-1);
}

.result-item:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
  border-color: var(--primary-color);
}

.result-item:active {
  transform: translateY(0);
  box-shadow: var(--shadow-1);
}

.result-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.result-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
}

.result-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.rating-stars {
  color: #fbbc04;
}

.rating-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.result-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.result-metadata {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-disabled);
}

.source-badge {
  background: var(--surface-variant);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.source-badge.google-maps { background: #e8f5e8; color: #2e7d32; }
.source-badge.web-search { background: #e3f2fd; color: #1976d2; }
.source-badge.waze { background: #fff3e0; color: #f57c00; }

.map-container { flex: 1; position: relative; background: var(--surface-variant); }
#map { width: 100%; height: 100%; }

.ai-summary {
  background: var(--surface-variant);
  border: 1px solid var(--outline-color);
  border-radius: var(--border-radius-medium);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
}

.ai-summary-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-summary-header i { color: var(--primary-color); }
.ai-summary-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ai-summary-text { font-size: 14px; color: var(--text-secondary); line-height: 1.4; }

.no-results { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.no-results i { font-size: 48px; color: var(--text-disabled); margin-bottom: 16px; }
.no-results h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-primary); }
.no-results p { font-size: 14px; line-height: 1.4; }

.loading-spinner { display: none; text-align: center; padding: 40px 20px; }
.spinner { border: 3px solid var(--outline-color); border-top: 3px solid var(--primary-color); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-text { color: var(--text-secondary); font-size: 14px; }

.map-search-overlay { display: none; }

/* Map legend */
.map-legend { position:absolute; bottom:16px; left:16px; background:#fff; border:1px solid var(--outline-color); border-radius:10px; padding:10px 12px; box-shadow: var(--shadow-2); font-size:12px; color:#444; }
.legend-row { display:flex; align-items:center; gap:8px; }
.legend-row + .legend-row { margin-top:6px; }
.legend-icon.maps { color:#81c784; font-size:14px; }
.legend-icon.web { color:#64b5f6; font-size:14px; }

/* Floating layers menu */
.fab-menu { position:absolute; right:16px; bottom:16px; z-index:1101; }
.fab { width:48px; height:48px; border-radius:50%; background:#fff; border:1px solid var(--outline-color); box-shadow: var(--shadow-2); display:flex; align-items:center; justify-content:center; font-size:18px; position: relative; }
.fab-badge { position:absolute; top:-6px; right:-6px; background:#ea4335; color:#fff; font-size:11px; line-height: 18px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; box-shadow: var(--shadow-2); display:none; }
.fab-card { display:none; position:absolute; right:0; bottom:56px; background:#fff; border:1px solid var(--outline-color); border-radius:12px; box-shadow: var(--shadow-3); min-width: 200px; overflow:hidden; }
.fab-card.open { display:block; }
.fab-item { display:block; width:100%; text-align:left; padding:10px 12px; background:#fff; border:none; border-bottom:1px solid var(--outline-color); font-size:14px; }
.fab-item:last-child { border-bottom:none; }
.fab-item:hover { background:#f6f8fb; }
.fab-item.active { background:#e8f0fe; font-weight:600; }

  /* Search this area chip (now inside overlay stack) */
  .search-area-chip { align-self: flex-start; background:#fff; border:1px solid var(--outline-color); border-radius:999px; padding:8px 12px; font-size:13px; box-shadow: var(--shadow-1); margin-top: 4px; }

/* Smart suggestions (chips) */
.smart-suggestions { display:flex; flex-wrap: wrap; gap:8px; margin: 8px 2px 6px 2px; }
.smart-suggestions.mobile { padding: 6px 12px; }
.suggestion-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; background:#fff; border:1px solid var(--outline-color); border-radius: 14px; font-size: 12px; color: var(--text-secondary); cursor: pointer; box-shadow: var(--shadow-1); }
.suggestion-chip:hover { background: var(--primary-color); color:#fff; border-color: var(--primary-color); }

/* Bottom sheet (mobile) */
.bottom-sheet { display:none; position:fixed; left:0; right:0; bottom:0; background:#fff; border-top-left-radius:14px; border-top-right-radius:14px; box-shadow: 0 -8px 24px rgba(0,0,0,0.15); z-index: 1100; max-height: 90vh; transition: height .2s ease; }
.bottom-sheet .sheet-header { position:sticky; top:0; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; border-bottom:1px solid var(--outline-color); background:#fff; border-top-left-radius:14px; border-top-right-radius:14px; }
.bottom-sheet .drag-handle { width:36px; height:4px; background:#d0d5dd; border-radius:999px; margin:0 auto; position:absolute; left:50%; transform:translateX(-50%); top:6px; }
.bottom-sheet .sheet-title { font-weight:600; font-size:14px; margin-left:8px; }
.bottom-sheet .sheet-toggle { border:1px solid var(--outline-color); background:#fff; border-radius:12px; padding:6px 10px; font-size:12px; }
.bottom-sheet .sheet-content { padding:10px 12px; overflow:auto; max-height: calc(90vh - 44px); -webkit-overflow-scrolling: touch; }
.bottom-sheet.peek { height: 88px; }
.bottom-sheet.half { height: 45vh; }
.bottom-sheet.full { height: 88vh; }

/* Responsive design */
@media (max-width: 768px) {
  /* Lock the app to a single, full-viewport screen with no page scrolling */
  html, body { height: 100dvh; overflow: hidden; }
  .main-container { flex-direction: column; height: 100dvh; }
  /* Hide the desktop sidebar entirely; use overlay search + bottom sheet */
  .sidebar { display:none; }
  .map-container { height: 100dvh; min-height: 100dvh; }
  .map-legend { display:none; }
  .bottom-sheet { display:block; }
  .results-container { display:none; }
  /* Map overlay search bar */
  .map-search-overlay { position:absolute; left:0; right:0; top: calc(env(safe-area-inset-top, 8px) + 6px); display:flex; flex-direction: column; align-items:center; z-index: 1101; padding: 4px 12px; gap: 6px; }
  .map-search-bar { display:flex; align-items:center; background:#fff; border:1px solid var(--outline-color); border-radius: 999px; width: min(94%, 680px); box-shadow: var(--shadow-2); }
  .map-search-input { flex:1; border:none; outline:none; background:transparent; padding: 12px 14px; font-size:16px; }
  .map-search-bar .search-button { position: static; width:44px; height:44px; background:transparent; border:none; color:#111827; box-shadow:none; border-radius: 0; }
  .map-search-bar .search-button:hover { background: transparent; box-shadow:none; }
  .js-search-btn { margin-right: 2px; }

  /* Suggestions as pill chips */
  .chip-row { width: min(94%, 680px); overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chip-row::-webkit-scrollbar{ display:none; }
  #smartSuggestionsMobile.smart-suggestions { display:flex; flex-wrap:nowrap; gap:8px; width: max-content; }
  .suggestion-chip { border-radius: 999px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }

  /* Layer pills removed (layers moved to the FAB menu) */

  /* Floating controls like Google Maps */
  .floating-btn { position: absolute; right: 16px; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--outline-color); background:#fff; display:flex; align-items:center; justify-content:center; box-shadow: var(--shadow-2); z-index:1101; }
  .floating-btn i { color:#374151; font-size:16px; }
  /* Move locate to top-right under the search bar */
  .floating-btn.locate { top: calc(env(safe-area-inset-top, 8px) + 110px); bottom: auto; }

  /* Move FAB higher (top-right) to avoid overlap with bottom sheet */
  .fab-menu { top: calc(env(safe-area-inset-top, 8px) + 160px); right: 12px; bottom: auto; }
  /* Status toast */
  .status-toast { position:absolute; top: calc(env(safe-area-inset-top, 8px) + 56px); left:50%; transform: translateX(-50%); background:#e3f2fd; color:#1976d2; border:1px solid #bbdefb; border-radius:10px; padding:10px 12px; font-size:14px; box-shadow: var(--shadow-2); z-index: 1102; }
}

/* Helper prompt */
.helper-prompt { display: none; margin-top: 10px; padding: 12px 14px; background: var(--surface-variant); border: 1px solid var(--outline-color); border-radius: var(--border-radius-medium); color: var(--text-secondary); box-shadow: var(--shadow-1); }
.prompt-title { font-weight: 600; color: var(--text-primary); margin-bottom: 6px; font-size: 13px; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--surface-color); border: 1px solid var(--outline-color); border-radius: 14px; font-size: 12px; color: var(--text-secondary); cursor: pointer; transition: all .2s ease; }
.chip:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* Feedback UI */
.feedback-summary { margin-top: 8px; font-size: 12px; color: var(--text-secondary); display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.badge { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; background: var(--surface-variant); border:1px solid var(--outline-color); border-radius: 999px; font-size:12px; color:#444; }
.badge.positive { background: #e8f5e8; color:#2e7d32; }
.badge.negative { background: #ffebee; color:#c62828; }
.feedback-controls { margin-top: 8px; display:flex; gap:8px; align-items:center; flex-wrap: wrap; }
.feedback-controls .fb-btn { padding:6px 10px; border:1px solid var(--outline-color); border-radius: 12px; background: var(--surface-color); cursor: pointer; font-size: 12px; }
.feedback-controls .fb-btn:hover { background: var(--primary-color); color:#fff; border-color: var(--primary-color); }
.stars { display:inline-flex; gap:2px; cursor:pointer; }
.star { color:#ddd; font-size: 16px; }
.star.active { color:#fbbc04; }

/* Utility classes for CSP-safe styling (replacing inline styles) */
.flex { display:flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.h-8 { height: 8px; display:block; }
.h-12 { height: 12px; display:block; }
.h-16 { height: 16px; display:block; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.text-secondary { color: var(--text-secondary); }

/* Composite AI Search icon (search + brain + pin) */
.ai-icon { position: relative; display:inline-block; vertical-align: middle; }
.ai-icon .ai-icon-base { position: relative; z-index:1; }
.ai-icon .ai-icon-brain { position:absolute; z-index:2; color:#64b5f6; }
.ai-icon .ai-icon-pin { position:absolute; z-index:2; color:#81c784; }

/* Sizes */
.ai-icon-sm { width:22px; height:20px; }
.ai-icon-sm .ai-icon-base { font-size:18px; }
.ai-icon-sm .ai-icon-brain { font-size:8px; top:1px; left:2px; }
.ai-icon-sm .ai-icon-pin { font-size:7px; top:6px; right:2px; }

.ai-icon-md { width:28px; height:24px; }
.ai-icon-md .ai-icon-base { font-size:22px; }
.ai-icon-md .ai-icon-brain { font-size:8px; top:3px; left:3px; }
.ai-icon-md .ai-icon-pin { font-size:7px; top:7px; right:5px; }

.ai-icon-lg { width:48px; height:42px; }
.ai-icon-lg .ai-icon-base { font-size:40px; color: var(--text-disabled); }
.ai-icon-lg .ai-icon-brain { font-size:14px; top:6px; left:6px; opacity:0.7; }
.ai-icon-lg .ai-icon-pin { font-size:12px; top:12px; right:8px; opacity:0.7; }

