/* ============================================
   SafeHer Mini — Design System & Shared Styles
   ============================================ */

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* ---- CSS Custom Properties (Design Tokens) ---- */
:root {
  /* Light Mode Colors */
  --surface: #f9f9ff;
  --surface-dim: #cfdaf2;
  --surface-bright: #f9f9ff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f0f3ff;
  --surface-container: #e7eeff;
  --surface-container-high: #dee8ff;
  --surface-container-highest: #d8e3fb;
  --on-surface: #111c2d;
  --on-surface-variant: #3c4a46;
  --inverse-surface: #263143;
  --inverse-on-surface: #ecf1ff;
  --outline: #6b7a76;
  --outline-variant: #bacac5;
  --surface-tint: #006b5f;
  --primary: #006b5f;
  --on-primary: #ffffff;
  --primary-container: #2dd4bf;
  --on-primary-container: #00574d;
  --inverse-primary: #3cddc7;
  --secondary: #006a61;
  --on-secondary: #ffffff;
  --secondary-container: #86f2e4;
  --on-secondary-container: #006f66;
  --tertiary: #bc0b3b;
  --on-tertiary: #ffffff;
  --tertiary-container: #ffa6ac;
  --on-tertiary-container: #9d002e;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
  --primary-fixed: #62fae3;
  --primary-fixed-dim: #3cddc7;
  --on-primary-fixed: #00201c;
  --on-primary-fixed-variant: #005047;
  --secondary-fixed: #89f5e7;
  --secondary-fixed-dim: #6bd8cb;
  --on-secondary-fixed: #00201d;
  --on-secondary-fixed-variant: #005049;
  --tertiary-fixed: #ffdadb;
  --tertiary-fixed-dim: #ffb2b7;
  --on-tertiary-fixed: #40000d;
  --on-tertiary-fixed-variant: #92002a;
  --background: #f9f9ff;
  --on-background: #111c2d;
  --surface-variant: #d8e3fb;

  /* Spacing */
  --base: 8px;
  --gutter: 16px;
  --container-margin-mobile: 24px;
  --container-margin-desktop: 64px;
  --touch-target-min: 48px;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-default: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);
}

/* Dark Mode Overrides */
.dark {
  --surface: #0f1729;
  --surface-dim: #0f1729;
  --surface-bright: #1a2540;
  --surface-container-lowest: #0a0f1e;
  --surface-container-low: #131d33;
  --surface-container: #182341;
  --surface-container-high: #1e2d50;
  --surface-container-highest: #253660;
  --on-surface: #e2e8f4;
  --on-surface-variant: #a8c0b8;
  --inverse-surface: #e2e8f4;
  --inverse-on-surface: #263143;
  --outline: #8a9f98;
  --outline-variant: #3c5a52;
  --surface-tint: #3cddc7;
  --primary: #3cddc7;
  --on-primary: #00382f;
  --primary-container: #005047;
  --on-primary-container: #62fae3;
  --inverse-primary: #006b5f;
  --secondary: #6bd8cb;
  --on-secondary: #003732;
  --secondary-container: #005049;
  --on-secondary-container: #89f5e7;
  --tertiary: #ffb2b7;
  --on-tertiary: #680019;
  --tertiary-container: #92002a;
  --on-tertiary-container: #ffdadb;
  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;
  --primary-fixed: #62fae3;
  --primary-fixed-dim: #3cddc7;
  --on-primary-fixed: #00201c;
  --on-primary-fixed-variant: #005047;
  --secondary-fixed: #89f5e7;
  --secondary-fixed-dim: #6bd8cb;
  --on-secondary-fixed: #00201d;
  --on-secondary-fixed-variant: #005049;
  --tertiary-fixed: #ffdadb;
  --tertiary-fixed-dim: #ffb2b7;
  --on-tertiary-fixed: #40000d;
  --on-tertiary-fixed-variant: #92002a;
  --background: #0f1729;
  --on-background: #e2e8f4;
  --surface-variant: #1e2d50;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.4);
}

/* ---- Base Resets ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--on-surface);
  background-color: var(--surface);
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--surface-container-highest);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ---- Typography ---- */
.headline-lg {
  font-family: 'Manrope', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
  letter-spacing: -0.02em;
}
.headline-lg-mobile {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: -0.02em;
}
.headline-md {
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}
.body-lg {
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
}
.body-md {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}
.label-md {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.01em;
}
.label-sm {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  font-size: 24px;
}

/* ---- Layout Utilities ---- */
.container-padding {
  padding-left: var(--container-margin-mobile);
  padding-right: var(--container-margin-mobile);
}

@media (min-width: 768px) {
  .container-padding {
    padding-left: var(--container-margin-desktop);
    padding-right: var(--container-margin-desktop);
  }
}

/* ---- TopNavBar ---- */
.topnav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.topnav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px var(--container-margin-mobile);
}

@media (min-width: 768px) {
  .topnav-inner {
    padding: 16px var(--container-margin-desktop);
  }
}

.topnav-brand {
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.topnav-btn {
  padding: 8px;
  border-radius: var(--radius-full);
  color: var(--on-surface-variant);
  transition: background 0.2s ease, transform 0.15s ease;
}

.topnav-btn:hover {
  background: color-mix(in srgb, var(--primary-container) 20%, transparent);
}

.topnav-btn:active {
  transform: scale(0.95);
}

.topnav-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--primary-container);
}

.topnav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Dark Mode Toggle ---- */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--outline-variant);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle.active {
  background: var(--primary);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-toggle.active .theme-toggle-thumb {
  transform: translateX(20px);
}

.theme-toggle-thumb .material-symbols-outlined {
  font-size: 14px;
  color: var(--on-surface);
}

/* ---- Sidebar Navigation ---- */
.sidebar {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 288px;
  z-index: 40;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  padding: var(--gutter);
  padding-top: 96px;
  transition: background 0.4s ease;
}

@media (min-width: 768px) {
  .sidebar {
    display: flex;
  }
}

.sidebar-header {
  margin-bottom: 32px;
  padding: 0 16px;
}

.sidebar-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}

.sidebar-header p {
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  opacity: 0.7;
}

.sidebar-nav {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--on-surface-variant);
  font-size: 16px;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: var(--surface-container-high);
}

.sidebar-link:active {
  transform: translateX(4px);
}

.sidebar-link.active {
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 600;
}

.sidebar-link.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

.sidebar-sos {
  margin-top: auto;
  padding: 16px;
}

.sidebar-sos button {
  width: 100%;
  padding: 16px;
  background: var(--error);
  color: var(--on-error);
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease;
}

.sidebar-sos button:active {
  transform: scale(0.95);
}

/* ---- Bottom Navigation (Mobile) ---- */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 16px 20px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  transition: background 0.4s ease;
}

@media (min-width: 768px) {
  .bottomnav {
    display: none;
  }
}

.bottomnav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
  border-radius: var(--radius-full);
}

.bottomnav-link:hover {
  color: var(--primary);
}

.bottomnav-link:active {
  transform: scale(0.9);
}

.bottomnav-link.active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.bottomnav-link.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

.bottomnav-link span:last-child {
  font-size: 12px;
  margin-top: 2px;
}

/* ---- Main Content Area ---- */
.main-content {
  min-height: 100vh;
  padding-top: 96px;
  padding-bottom: 112px;
  padding-left: var(--container-margin-mobile);
  padding-right: var(--container-margin-mobile);
}

@media (min-width: 768px) {
  .main-content {
    margin-left: 288px;
    padding-left: var(--container-margin-desktop);
    padding-right: var(--container-margin-desktop);
    padding-bottom: 48px;
  }
}

/* ---- Card Styles ---- */
.card {
  background: var(--surface-container-lowest);
  border: 1px solid color-mix(in srgb, var(--outline-variant) 30%, transparent);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, background 0.4s ease, border-color 0.4s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--outline-variant) 30%, transparent);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* ---- Chip / Badge ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
}

.chip-primary {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.chip-surface {
  background: var(--surface-container);
  color: var(--on-surface-variant);
}

/* ---- Button Styles ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-error {
  background: var(--error);
  color: var(--on-error);
}

.btn-error:hover {
  opacity: 0.9;
}

.btn-surface {
  background: var(--surface-container);
  color: var(--on-secondary-container);
}

.btn-surface:hover {
  background: var(--surface-container-high);
}

.btn-pill {
  border-radius: var(--radius-full);
  padding: 16px 32px;
}

.btn-block {
  width: 100%;
}

/* ---- Toggle Switch ---- */
.toggle-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--outline-variant);
  border-radius: var(--radius-full);
  position: relative;
  transition: background 0.3s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

/* ---- Animations ---- */
@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 0.4; }
  100% { transform: scale(1.3); opacity: 0; }
}

.pulse-animation {
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes sos-shadow-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--error) 40%, transparent); }
  70% { box-shadow: 0 0 0 20px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.sos-pulse {
  animation: sos-shadow-pulse 2s infinite;
}

@keyframes waveform-pulse {
  0%, 100% { height: 12px; opacity: 0.4; }
  50% { height: 32px; opacity: 1; }
}

.waveform-bar {
  animation: waveform-pulse 1.2s ease-in-out infinite;
}

@keyframes map-pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

.map-pulse::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: 50%;
  animation: map-pulse-ring 2s infinite;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fade-in-up 0.5s ease forwards;
}

.fade-in-up-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-up-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-up-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-up-delay-4 { animation-delay: 0.4s; opacity: 0; }

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.animate-ping {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* ---- Glass Effect ---- */
.glass {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---- Scrollbar ---- */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 10px;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---- Responsive Grid ---- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .grid-bento {
    grid-template-columns: repeat(12, 1fr);
  }
  .col-span-5 { grid-column: span 5; }
  .col-span-7 { grid-column: span 7; }
  .col-span-12 { grid-column: span 12; }
}

/* ---- Section max-widths ---- */
.section-narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.section-medium { max-width: 768px; margin-left: auto; margin-right: auto; }
.section-wide { max-width: 1024px; margin-left: auto; margin-right: auto; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-error { color: var(--error); }
.text-on-surface { color: var(--on-surface); }
.text-on-surface-variant { color: var(--on-surface-variant); }
.text-outline { color: var(--outline); }

.bg-surface { background: var(--surface); }
.bg-surface-container { background: var(--surface-container); }
.bg-surface-container-low { background: var(--surface-container-low); }
.bg-surface-container-high { background: var(--surface-container-high); }
.bg-primary { background: var(--primary); }
.bg-primary-container { background: var(--primary-container); }
.bg-error { background: var(--error); }
.bg-error-container { background: var(--error-container); }
.bg-secondary-container { background: var(--secondary-container); }

.rounded-full { border-radius: var(--radius-full); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: 16px; }
.rounded-3xl { border-radius: 24px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.w-full { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; }
.mb-12 { margin-bottom: 48px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }

.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }

.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.flex-1 { flex: 1; }
.flex-grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.opacity-50 { opacity: 0.5; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }

/* ---- Alert Modal Overlay ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

/* ---- Page-specific: Map fullscreen ---- */
.main-content-map {
  position: fixed;
  inset: 0;
  padding-top: 64px;
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  .main-content-map {
    padding-left: 288px;
    padding-bottom: 0;
  }
}

/* ---- Form Inputs ---- */
.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--outline-variant);
  border-radius: 12px;
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  line-height: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.form-input::placeholder {
  color: var(--outline);
}

select.form-input {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%236b7a76'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ---- Profile Dropdown ---- */
.profile-dropdown {
  position: fixed;
  top: 68px;
  right: 24px;
  width: 300px;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  z-index: 100;
  overflow: hidden;
}

@media (min-width: 768px) {
  .profile-dropdown {
    right: 64px;
  }
}

.profile-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
  background: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.profile-dropdown-item:hover {
  background: var(--surface-container-high);
}

/* ---- Toast Notification ---- */
.toast-notification {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  white-space: nowrap;
  max-width: 90vw;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (min-width: 768px) {
  .toast-notification {
    bottom: 40px;
  }
}

/* ---- Leaflet Map Custom Markers ---- */
.leaflet-user-marker {
  background: none !important;
  border: none !important;
}

.user-dot-outer {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.user-dot-outer::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 50%;
  animation: map-pulse-ring 2s infinite;
}

.user-dot-inner {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* ---- Fake Call Action Buttons ---- */
.fake-call-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-container);
  color: var(--on-surface);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  min-width: 72px;
}

.fake-call-action-btn:hover {
  background: var(--surface-container-high);
}

/* ---- Leaflet overrides ---- */
.leaflet-container {
  background: var(--surface-dim) !important;
  font-family: 'Manrope', sans-serif !important;
}

.dark .leaflet-tile {
  filter: brightness(0.7) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 80%, transparent) !important;
  backdrop-filter: blur(8px);
  border-radius: 8px !important;
  font-size: 10px !important;
  color: var(--on-surface-variant) !important;
  padding: 2px 8px !important;
}

.leaflet-control-attribution a {
  color: var(--primary) !important;
}

/* ---- fadeIn keyframe ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
