:root {
  --primary: #0D9488;
  --primary-light: #F0FDFA;
  --primary-soft: #CCFBF1;
  --primary-dark: #0F766E;

  /* Light Mode Palette */
  --bg-main: #f0f2f5;
  --bg-card: #ffffff;
  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border-light: rgba(0, 0, 0, 0.08);

  /* Dark Mode Palette */
  --bg-main-dark: #162620;
  --bg-card-dark: #0f1f1c;
  --text-main-dark: #f0f2f5;
  --text-secondary-dark: #94A3B8;
  --text-muted-dark: #475569;
  --border-dark: rgba(255, 255, 255, 0.1);

  /* Elevation System */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

*:not(.material-symbols-outlined) {
  font-family: 'DM Sans', sans-serif !important;
}

html,
body {
  font-family: 'DM Sans', sans-serif !important;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg-main);
  color: var(--text-main);
  scroll-behavior: smooth;
}

.dark body {
  background-color: var(--bg-main-dark);
  color: var(--text-main-dark);
}

/* Typography Hierarchy */
h1,
h2,
h3,
.font-display {
  font-family: 'DM Serif Display', serif !important;
  font-weight: 400 !important;
  letter-spacing: -0.02em;
}

.premium-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.dark .premium-card {
  background-color: var(--bg-card-dark);
  border-color: var(--border-dark);
}

.premium-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13, 148, 136, 0.2);
}

/* Sidebar Nav refinement */
.nav-item {
  position: relative;
  transition: all 0.2s ease;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background-color: var(--primary);
  border-radius: 0 4px 4px 0;
  transition: height 0.2s ease;
}

.nav-item.active::before {
  height: 60%;
}

/* Button System */
.btn-primary {
  background-color: var(--primary);
  color: white;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: 0 8px 16px -4px rgba(13, 148, 136, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 20px -4px rgba(13, 148, 136, 0.4);
}

.btn-secondary {
  background-color: var(--bg-main);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.dark .btn-secondary {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--border-dark);
}

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

/* Skeleton & Placeholders */
.placeholder-img {
  background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.dark .placeholder-img {
  background: linear-gradient(135deg, #1A2E2C 0%, #121D1B 100%);
}

.placeholder-img .material-symbols-outlined {
  font-size: 2.5rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Custom Scrollbar */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.dark *::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Leaflet Map Grid Fix - Eliminates tile gap artifacts */
.leaflet-tile-container img {
  width: 256.5px !important;
  height: 256.5px !important;
  outline: 1px solid transparent;
}

.leaflet-container {
  background: #f1f5f9 !important;
}

.dark .leaflet-container {
  background: #162620 !important;
}

.dark .leaflet-tile-pane {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}