/* css/style.css - Sleek & Modern Dark Glassmorphism UI Style System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0b0f19;
  --panel-bg: rgba(18, 24, 38, 0.78);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --warning-red: #ff4e50;
  --warning-orange: #f9d423;
  --warning-gradient: linear-gradient(135deg, #ff4e50 0%, #f9d423 100%);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sleek: 0 12px 32px rgba(0, 0, 0, 0.45);
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
}

/* App Container */
#app {
  position: relative;
  width: 100vw;
  height: 100vh; /* fallback for older browsers */
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Map Container */
#map {
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: #1a202c;
}

/* Header Bar Overlay */
.top-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sleek);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  font-size: 1.2rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sleek {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

.btn-sleek:hover, .btn-sleek:active {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-ai-summary {
  background: var(--warning-gradient);
  color: #0b0f19;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 78, 80, 0.35);
}

.btn-ai-summary:hover {
  filter: brightness(1.1);
}

/* Floating Overlay: Search in this area */
.floating-search-overlay {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-search-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.btn-search-area {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Floating GPS Button */
.btn-gps {
  position: absolute;
  bottom: 230px;
  right: 16px;
  z-index: 9;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sleek);
  cursor: pointer;
}

/* Bottom Sheet Filter Panel */
.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--panel-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 12px 20px 24px 20px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  align-self: center;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.results-badge {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Category Filter Chips */
.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip.active {
  background: var(--accent-gradient);
  color: #0b0f19;
  border-color: transparent;
  font-weight: 700;
}

/* Sliders Section */
.sliders-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
}

.slider-val {
  color: var(--accent-cyan);
  font-weight: 700;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.25);
}

/* Modal Windows */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #141a28;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sleek);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* AI Report Markdown Styling */
.ai-report h3 {
  font-size: 1rem;
  color: var(--warning-orange);
  margin-top: 14px;
  margin-bottom: 8px;
}

.ai-report p, .ai-report li {
  margin-bottom: 8px;
  color: #cbd5e1;
}

.ai-report ul {
  padding-left: 20px;
}

/* Guard View for Denied Geolocation */
.guard-overlay {
  position: absolute;
  inset: 0;
  z-index: 999;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  gap: 16px;
}

.guard-icon {
  font-size: 3.5rem;
  color: var(--warning-red);
}

.guard-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.guard-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.5;
}

.guard-btn {
  background: var(--accent-gradient);
  color: #0b0f19;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
}

/* Loading Spinner for Search Progress */
.loading-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 242, 254, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-cyan);
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
