:root {
  --font-sans: 'Outfit', sans-serif;
  
  /* Premium Palette - Updated for WCAG AA Contrast Compliance */
  --color-primary: #1D4ED8;
  --color-primary-hover: #1e3a8a;
  --color-secondary: #0ea5e9;
  --color-accent: #f59e0b;
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
  --color-foreground: #111827; /* Dark text on white backgrounds */
  --color-text-muted: #4b5563;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.12);
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessibility: Global Focus State */
*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.3);
  border-radius: 4px;
}

/* Typography Overrides */
.heading-1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.03em; }
.heading-2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
.text-gradient {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-light {
  background: linear-gradient(135deg, #7dd3fc, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Glass Panels */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Navbar Tweaks */
.brand-icon-wrapper {
  background: linear-gradient(135deg, var(--color-primary), #0ea5e9);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.3);
}
.brand-text {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #1e293b;
}

.custom-nav-link {
  font-weight: 600;
  padding: 0.5rem 1rem !important;
  border-radius: 2rem;
  color: #64748b;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.custom-nav-link:hover {
  color: var(--color-primary);
  background: rgba(248, 250, 252, 0.8);
  transform: translateY(-1px);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--color-primary), #0ea5e9);
  color: white;
  border: none;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}
.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4);
  color: white;
}
.navbar-brand .brand-text {
  color: var(--color-foreground);
  font-weight: 800;
  font-size: 1.25rem;
}
.navbar {
  box-shadow: 0 4px 25px rgba(0,0,0,0.2) !important;
  border: 1px solid var(--glass-border);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Hero Section */
.hero-bg-image {
  background-image: url('background.png');
  background-size: cover;
  background-position: center;
  transform: scale(1.05); /* Slight scale to allow for parallax if added later */
}
.hero-overlay {
  background: linear-gradient(to right, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.3) 100%);
}

/* Category Cards */
.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
.category-card:hover .category-icon-wrapper {
  background: var(--color-primary) !important;
}
.category-card:hover .category-icon-wrapper svg {
  stroke: white !important;
}

/* Location Cards */
.location-card {
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.05);
}
.location-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.2);
}
.location-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.favorite-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.favorite-btn:hover {
  transform: scale(1.1);
}
.location-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.location-category {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  background: rgba(29, 78, 216, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

/* Filter Chips */
.filter-historic { --chip-color: #b91c1c; --chip-shadow: rgba(185, 28, 28, 0.35); }
.filter-museums { --chip-color: #6d28d9; --chip-shadow: rgba(109, 40, 217, 0.35); }
.filter-nature { --chip-color: #15803d; --chip-shadow: rgba(21, 128, 61, 0.35); }
.filter-resorts { --chip-color: #0369a1; --chip-shadow: rgba(3, 105, 161, 0.35); }
.filter-restaurants { --chip-color: #c2410c; --chip-shadow: rgba(194, 65, 12, 0.35); }

.key-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background-color: var(--chip-color, #94a3b8);
  margin-right: 6px;
  transition: all 0.2s;
}
.filter-chip.active .key-dot {
  background-color: white !important;
}

.filter-chip {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  font-weight: 600;
  padding: 0.4rem 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.filter-chip:hover {
  border-color: var(--chip-color, var(--color-primary));
  color: var(--chip-color, var(--color-primary));
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px var(--chip-shadow, rgba(29, 78, 216, 0.15)), 0 2px 4px -1px var(--chip-shadow, rgba(29, 78, 216, 0.1));
}
.filter-chip.active {
  background: var(--chip-color, linear-gradient(135deg, var(--color-primary), #0ea5e9));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--chip-shadow, rgba(29, 78, 216, 0.35));
  transform: translateY(-2px);
}

/* Saved Place Cards */
.saved-place-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: grab;
}
.saved-place-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(59, 130, 246, 0.3);
}
.saved-place-img {
  width: 60px;
  height: 60px;
  border-radius: 0.5rem;
  object-fit: cover;
  margin-right: 1rem;
}

/* Map specific overrides */
.leaflet-container {
  font-family: var(--font-sans);
}
.custom-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.custom-popup .leaflet-popup-content {
  margin: 0;
  line-height: 1.4;
}

/* Responsive Utilities */
@media (max-width: 991.98px) {
  .discover-sidebar {
    height: 50vh;
    border-bottom: 1px solid var(--color-border);
    border-right: none !important;
  }
}
@media (min-width: 992px) {
  .discover-sidebar {
    width: 450px;
    height: 100%;
  }
}
/* Drag and Drop & Timeline Styles */
.timeline-container {
  padding-left: 20px;
}
.timeline-container::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--color-primary), #0ea5e9);
  border-radius: 2px;
  opacity: 0.5;
}
.timeline-item {
  position: relative;
  background: white;
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-left: 1.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--color-primary);
  z-index: 2;
}
.timeline-item:hover {
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.sortable-ghost {
  opacity: 0.4;
  background-color: #f8fafc;
  border: 2px dashed var(--color-primary);
}
.sortable-drag {
  opacity: 1 !important;
  box-shadow: 0 15px 30px rgba(29, 78, 216, 0.2) !important;
  transform: scale(1.03);
  z-index: 9999;
}

/* Modern Site Footer */
.site-footer {
  background-color: #f8fafc; /* Professional cool off-white/light gray */
  border-top: 1px solid #e2e8f0; /* Crisp subtle border */
  padding: 1rem 0; /* Compact padding */
  color: #64748b; /* Sleek slate gray text */
  font-size: 0.85rem; /* Neat, readable typography */
  position: relative;
  z-index: 1050;
}

.site-footer a {
  color: #0f172a; /* Slate 900 for dark contrast link */
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.site-footer a:hover {
  color: var(--color-primary); /* Turns primary blue on hover */
}

.site-footer .footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer .footer-logo {
  height: 24px; /* Reduced from 40px for a sleeker profile */
  width: auto;
  transition: transform 0.2s ease;
  vertical-align: middle;
}

.site-footer a:hover .footer-logo {
  transform: scale(1.05); /* Subtle micro-animation on hover */
}

@media (max-width: 767.98px) {
  .site-footer .footer-content {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 0.75rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: white !important;
  }
  .navbar, 
  aside, 
  .no-print, 
  .remove-from-timeline,
  .btn-primary,
  .btn-gradient {
    display: none !important;
  }
  
  .container {
    padding-top: 2rem !important;
    padding-bottom: 0 !important;
    max-width: 100% !important;
  }
  
  .col-lg-8 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  .timeline-container {
    padding-left: 30px;
    margin-top: 2rem;
  }

  .timeline-container::before {
    left: 15px;
    background: #000 !important;
    opacity: 0.2;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .timeline-item {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    margin-bottom: 1.5rem !important;
    border-radius: 8px !important;
  }

  .timeline-item::before {
    border-color: #000 !important;
    background: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .heading-1::before {
    content: "Bedford Explorer Itinerary: ";
    font-size: 0.6em;
    display: block;
    color: #666;
  }
}