/* =============================================
   BROS FIRES MAP - WORLD-CLASS UI
   Premium Design System
   ============================================= */

/* =============================================
   CUSTOM FONTS
   ============================================= */
@font-face {
  font-family: 'Hanley Pro';
  src: url('/static/fonts/HanleyPro-SansWideExtra.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* =============================================
   CSS CUSTOM PROPERTIES
   ============================================= */
:root {
  /* Colors - Dark Theme */
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  --bg-elevated: #222222;
  
  /* Glass Effect */
  --glass-bg: rgba(20, 20, 20, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 20px;
  
  /* Brand Colors */
  --gold: #d4af37;
  --gold-light: #e8c84a;
  --gold-dark: #b8962f;
  --gold-glow: rgba(212, 175, 55, 0.4);
  
  /* Fire Gradient */
  --fire-red: #ff4500;
  --fire-orange: #ff8c00;
  --fire-yellow: #ffd700;
  
  /* Semantic Colors */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.35);
  
  /* Typography */
  --font-title: 'Hanley Pro', system-ui, sans-serif;
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--gold-glow);
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* =============================================
   FIRE LOADING SCREEN
   ============================================= */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

/* Animated Fire Icon */
.fire-icon-container {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fire-icon {
  width: 100px;
  height: auto;
}

.fire-glow {
  position: absolute;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 140, 0, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: glow-pulse 1s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes glow-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.3);
    opacity: 0.8;
  }
}

/* Loading Text */
.loading-text-container {
  text-align: center;
}

.loading-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0;
}

.loading-subtitle {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  text-transform: lowercase;
}

.loading-tagline {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
}

.loading-message {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

/* Progress Bar */
.progress-container {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--space-lg);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Mobile loading screen adjustments */
@media (max-width: 480px) {
  .fire-icon-container {
    width: 100px;
    height: 100px;
  }
  
  .fire-icon {
    width: 80px;
  }
  
  .loading-title {
    font-size: 2rem;
  }
  
  .loading-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.3em;
  }
  
  .loading-tagline {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }
  
  .progress-container {
    width: 160px;
  }
}

/* =============================================
   MAIN APPLICATION
   ============================================= */
.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  transition: opacity 0.6s var(--ease-out);
}

.app.visible {
  opacity: 1 !important;
}

/* =============================================
   FULL-SCREEN MAP
   ============================================= */
.map-fullscreen {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Mapbox Overrides */
.mapboxgl-ctrl-logo,
.mapboxgl-ctrl-attrib {
  display: none !important;
}

.mapboxgl-ctrl-group {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md);
}

.mapboxgl-ctrl-group button {
  width: 40px !important;
  height: 40px !important;
  background: transparent !important;
  border: none !important;
}

.mapboxgl-ctrl-group button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.mapboxgl-ctrl-group button + button {
  border-top: 1px solid var(--glass-border) !important;
}

.mapboxgl-ctrl-icon {
  filter: invert(1) brightness(0.9);
}

/* Ensure Mapbox markers stay fixed in position */
.mapboxgl-marker {
  will-change: transform;
  /* Critical: Do not let child elements affect positioning */
  pointer-events: auto;
}

/* =============================================
   CENTERED HEADER
   ============================================= */
.centered-header {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  text-align: center;
  /* Safe area for notched phones */
  padding-top: env(safe-area-inset-top);
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

/* Mobile-first header sizing */
.header-title {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2px;
}

.header-subtitle {
  font-family: var(--font-title);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--text-primary);
  text-transform: lowercase;
}

/* Tablet and up */
@media (min-width: 600px) {
  .centered-header {
    top: var(--space-lg);
  }
  
  .header-title {
    font-size: 2.5rem;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
  }
  
  .header-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.45em;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .header-title {
    font-size: 3rem;
  }
  
  .header-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.5em;
  }
}

/* =============================================
   FLOATING ACTION BUTTON - LOCATE
   ============================================= */
.fab-locate {
  position: fixed;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  border: none;
  color: var(--bg-primary);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transition: all var(--duration-normal) var(--ease-out);
  /* Mobile-first: circular button - 56px is good touch target */
  bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
  right: var(--space-md);
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.fab-locate svg {
  width: 24px;
  height: 24px;
}

.fab-label {
  display: none;
}

.fab-locate:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg), 0 0 60px var(--gold-glow);
}

.fab-locate:active {
  transform: scale(0.92);
  background: var(--gold-dark);
}

.fab-locate.loading svg {
  animation: spin 1s linear infinite;
}

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

/* When preview is visible, move FAB up to avoid overlap */
.fab-locate.shifted {
  /* Preview card is approx 200px, add breathing room */
  bottom: calc(220px + env(safe-area-inset-bottom));
}

/* Desktop: pill button with label */
@media (min-width: 600px) {
  .fab-locate {
    width: auto;
    height: auto;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-full);
    gap: var(--space-sm);
    right: var(--space-lg);
  }
  
  .fab-locate svg {
    width: 20px;
    height: 20px;
  }
  
  .fab-label {
    display: inline;
    font-size: 0.9rem;
  }
  
  .fab-locate:hover {
    transform: translateY(-2px);
  }
  
  .fab-locate:active {
    transform: translateY(0);
  }
  
  .fab-locate.shifted {
    bottom: var(--space-lg);
  }
}

/* =============================================
   CIRCLE PREVIEW CARD
   ============================================= */
.circle-preview {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
  background: linear-gradient(
    180deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 100%
  );
  border-top: 1px solid var(--glass-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform var(--duration-normal) var(--ease-out);
}

.circle-preview.visible {
  transform: translateY(0);
}

/* Swipe handle indicator */
.preview-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-md);
}

.preview-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  /* 44px minimum for iOS touch targets */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.preview-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.preview-close:active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: scale(0.92);
}

.preview-close svg {
  width: 20px;
  height: 20px;
}

.preview-content {
  padding-right: 52px; /* Account for larger close button */
}

/* Mobile-optimized title with Hanley Pro */
.preview-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.preview-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  /* Prevent tags from growing too wide */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-tag svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
  flex-shrink: 0;
}

/* Large touch-friendly CTA button */
.preview-cta {
  width: 100%;
  padding: 18px var(--space-lg);
  background: var(--gold);
  border: none;
  border-radius: var(--radius-md);
  color: var(--bg-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--duration-fast);
  /* Touch optimization */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.preview-cta:hover {
  background: var(--gold-light);
}

.preview-cta:active {
  transform: scale(0.97);
  background: var(--gold-dark);
}

/* Desktop: Side card */
@media (min-width: 768px) {
  .circle-preview {
    top: auto;
    bottom: var(--space-lg);
    left: var(--space-lg);
    right: auto;
    width: 380px;
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    transform: translateX(-120%);
  }
  
  .circle-preview.visible {
    transform: translateX(0);
  }
  
  .preview-handle {
    display: none;
  }
  
  .preview-title {
    font-size: 1.5rem;
  }
  
  .preview-cta {
    padding: var(--space-md) var(--space-lg);
  }
}

/* =============================================
   ACCESS MODAL (Glass Morphism)
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: var(--space-2xl);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform var(--duration-normal) var(--ease-out);
}

.modal-overlay.visible .modal-container {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  /* 44px minimum for iOS touch targets */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.modal-close:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.25);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
  border-radius: 50%;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
  color: var(--gold);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.modal-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.modal-subtitle span {
  color: var(--gold);
  font-weight: 600;
}

/* Form Styles */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-field label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field input {
  width: 100%;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  /* 16px prevents iOS zoom on focus */
  font-size: 16px;
  transition: all var(--duration-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-field input::placeholder {
  color: var(--text-muted);
}

.form-field input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-field input.error {
  border-color: var(--error);
}

.form-field input.valid {
  border-color: var(--success);
}

.field-error {
  font-size: 0.8rem;
  color: var(--error);
  min-height: 1.2em;
}

.submit-btn {
  position: relative;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--gold);
  border: none;
  border-radius: var(--radius-md);
  color: var(--bg-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--duration-fast);
}

.submit-btn:hover:not(:disabled) {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.submit-btn.loading .btn-text {
  opacity: 0;
}

.submit-btn.loading .btn-loader {
  opacity: 1;
}

.btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: var(--bg-primary);
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

.form-disclaimer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Success State */
.access-success {
  text-align: center;
  padding: var(--space-lg) 0;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 50%;
  animation: success-pop 0.5s var(--ease-out);
}

@keyframes success-pop {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.success-icon svg {
  width: 40px;
  height: 40px;
  color: var(--success);
}

.access-success h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.access-success p {
  color: var(--text-secondary);
}

/* Mobile modal - full-width bottom sheet style */
@media (max-width: 480px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  
  .modal-container {
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-xl) var(--space-lg);
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }
  
  .modal-overlay.visible .modal-container {
    transform: translateY(0) scale(1);
  }
  
  .modal-header {
    margin-bottom: var(--space-lg);
  }
  
  .modal-icon {
    width: 56px;
    height: 56px;
  }
  
  .modal-icon svg {
    width: 28px;
    height: 28px;
  }
  
  .modal-title {
    font-size: 1.5rem;
  }
  
  .modal-subtitle {
    font-size: 0.9rem;
  }
  
  .form-field input {
    padding: var(--space-md);
    font-size: 16px; /* Prevent iOS zoom on focus */
  }
  
  .submit-btn {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    /* Minimum 48px touch target */
    min-height: 48px;
  }
}

/* =============================================
   DETAIL LIGHTBOX (Circle Info Modal)
   Premium centered lightbox inspired by Airbnb/Google Maps
   ============================================= */
.detail-sheet {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  pointer-events: none;
}

.detail-sheet.active {
  display: flex;
}

.detail-sheet .sheet-overlay {
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.detail-sheet .sheet-container {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.detail-sheet.visible {
  pointer-events: auto;
}

.detail-sheet.visible .sheet-overlay {
  opacity: 1;
}

.detail-sheet.visible .sheet-container {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Backdrop with blur */
.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: all var(--duration-normal) var(--ease-out);
}

.detail-sheet.visible .sheet-overlay {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Lightbox Container */
.sheet-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - var(--space-2xl));
  max-height: calc(100dvh - var(--space-2xl));
  background: linear-gradient(
    180deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 100%
  );
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 25px 80px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 80px rgba(212, 175, 55, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Hide the handle for lightbox design */
.sheet-handle {
  display: none;
}

/* Close Button - Elevated glass style with proper touch target */
.sheet-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  /* 44px minimum for iOS touch targets */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sheet-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: scale(1.05);
}

.sheet-close:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

.sheet-close svg {
  width: 20px;
  height: 20px;
}

/* Content Area */
.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2xl);
  padding-top: var(--space-xl);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dark) transparent;
}

.sheet-content::-webkit-scrollbar {
  width: 6px;
}

.sheet-content::-webkit-scrollbar-track {
  background: transparent;
}

.sheet-content::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 3px;
}

/* Circle Title - BROS Hanley Pro Branding */
.sheet-content .circle-name {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-lg);
  padding-right: 48px;
  line-height: 1.2;
}

/* Info Grid - Card-like sections */
.sheet-content .info-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.sheet-content .info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast);
}

.sheet-content .info-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sheet-content .info-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sheet-content .info-value {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.sheet-content .info-value a {
  color: var(--gold-light);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.sheet-content .info-value a:hover {
  color: var(--gold);
  text-decoration: underline;
}

/* Quick Info Pills - Horizontal layout for time/frequency/duration */
.sheet-content .quick-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.sheet-content .info-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}

.sheet-content .info-pill svg {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

/* Action Buttons - Premium styling */
.sheet-actions {
  display: flex;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sheet-action:hover {
  background: var(--gold);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.sheet-action:active {
  transform: scale(0.97);
}

.sheet-action svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Primary action variant */
.sheet-action.primary {
  background: var(--gold);
  color: var(--bg-primary);
}

.sheet-action.primary:hover {
  background: var(--gold-light);
  box-shadow: 0 4px 25px rgba(212, 175, 55, 0.4);
}

/* Mobile optimizations - Full-width bottom sheet */
@media (max-width: 600px) {
  .detail-sheet {
    padding: 0;
    align-items: flex-end;
  }
  
  .sheet-container {
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: none;
    border-top: 1px solid var(--glass-border);
  }
  
  /* Mobile sheet slides up from bottom */
  .detail-sheet .sheet-container {
    opacity: 1;
    transform: translateY(100%);
  }
  
  .detail-sheet.visible .sheet-container {
    transform: translateY(0);
  }
  
  /* Show swipe handle on mobile */
  .sheet-handle {
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    margin: var(--space-md) auto;
    flex-shrink: 0;
  }
  
  .sheet-close {
    top: var(--space-sm);
    right: var(--space-md);
    /* Keep 44px touch target on mobile */
    width: 44px;
    height: 44px;
  }
  
  .sheet-content {
    padding: var(--space-md) var(--space-lg);
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }
  
  .sheet-content .circle-name {
    font-size: 1.4rem;
    padding-right: 50px; /* Room for close button */
    margin-bottom: var(--space-md);
    /* Allow title to wrap but limit height */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  /* Smaller pills on mobile */
  .sheet-content .info-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .sheet-content .info-pill svg {
    width: 14px;
    height: 14px;
  }
  
  /* Compact info items */
  .sheet-content .info-grid {
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
  }
  
  .sheet-content .info-item {
    padding: var(--space-md);
  }
  
  .sheet-content .info-label {
    font-size: 0.65rem;
  }
  
  .sheet-content .info-value {
    font-size: 0.95rem;
  }
  
  /* Stack action buttons vertically on mobile */
  .sheet-actions {
    flex-direction: column;
    gap: var(--space-sm);
    padding-top: var(--space-md);
  }
  
  .sheet-action {
    /* Minimum 48px touch target */
    min-height: 48px;
    padding: 14px var(--space-lg);
    font-size: 0.9rem;
  }
  
  /* Primary action more prominent on mobile */
  .sheet-action.primary {
    order: -1;
    min-height: 52px;
    padding: 16px var(--space-lg);
    font-size: 1rem;
  }
}

/* Tablet */
@media (min-width: 601px) and (max-width: 767px) {
  .sheet-container {
    max-width: 500px;
  }
}

/* Large desktop */
@media (min-width: 768px) {
  .sheet-container {
    max-width: 520px;
  }
  
  .sheet-content .circle-name {
    font-size: 2rem;
  }
  
  .sheet-handle {
    display: none;
  }
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 380px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.3s var(--ease-out);
}

.toast.exit {
  animation: toast-out 0.2s var(--ease-in-out) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--gold); }

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color var(--duration-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Mobile toasts - positioned at TOP to avoid overlap with preview/sheet */
@media (max-width: 600px) {
  .toast-container {
    top: calc(var(--space-lg) + env(safe-area-inset-top));
    bottom: auto;
    left: var(--space-md);
    right: var(--space-md);
    max-width: none;
  }
  
  /* Keep slide-in from top on mobile */
  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(-100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes toast-out {
    to {
      opacity: 0;
      transform: translateY(-100%);
    }
  }
}

/* =============================================
   FIRE MARKERS (Animated GIF)
   ============================================= */
.fire-marker {
  /* Dimensions set via inline styles for Mapbox compatibility */
  cursor: pointer;
}

/* Cluster markers need position:relative for badge positioning */
.cluster-marker {
  position: relative;
}

.fire-marker img {
  /* Dimensions inherited from container */
  display: block;
  transition: transform 0.15s ease;
}

.fire-marker:hover img {
  transform: scale(1.15);
}

/* Cluster badge */
.cluster-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--gold);
  border: 2px solid var(--bg-primary);
  border-radius: var(--radius-full);
  color: var(--bg-primary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  z-index: 10;
  pointer-events: none;
}

.cluster-marker:hover .cluster-badge {
  background: var(--gold-light);
}

/* Responsive marker sizes - handled via JS inline styles for Mapbox compatibility */
@media (min-width: 768px) {
  .cluster-badge {
    min-width: 22px;
    height: 22px;
    font-size: 0.75rem;
    top: -4px;
    right: -10px;
  }
}

/* =============================================
   USER LOCATION MARKER
   ============================================= */
.user-marker {
  width: 20px;
  height: 20px;
  background: #3b82f6;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
  position: relative;
}

.user-marker::before {
  content: '';
  position: absolute;
  inset: -8px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 50%;
  animation: user-pulse 2s ease-out infinite;
}

@keyframes user-pulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* =============================================
   MAP TOOLTIP
   ============================================= */
.map-tooltip {
  position: fixed;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-8px);
  transition: opacity var(--duration-fast);
  box-shadow: var(--shadow-md);
}

.map-tooltip.visible {
  opacity: 1;
}

/* =============================================
   ACCESSIBILITY & REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
