/* Brand Colors */
:root {
  --brand-yellow: #EDB402;
  --brand-blue-dark: #012F58;
  --brand-blue-main: #003CA0;
  --brand-blue-light: #4F90FF;
}

/* Bootstrap 5 CSS variable overrides (for buttons, links, etc.) */
:root {
  --bs-primary: var(--brand-blue-main);
  --bs-secondary: var(--brand-blue-light);
  --bs-warning: var(--brand-yellow);
}

body {
  background-color: #f8f9fa;
  color: var(--brand-blue-dark);
  overflow-x: hidden;
}

/* Main content wrapper responsive widths */
.main-content-wrapper {
  width: 80%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Tablet and mobile responsive widths */
@media (max-width: 991.98px) {
  .main-content-wrapper {
    width: 90%;
  }
}

@media (max-width: 576px) {
  .main-content-wrapper {
    width: 90%;
    padding: 0 0.75rem;
  }
}

/* Navbar section layout */
.navbar-sections {
  display: flex;
  width: 100%;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  position: relative;
}

.navbar-logo-section {
  flex: 0 0 25%;
  max-width: 25%;
  min-width: 0;
}

.navbar-search-section {
  flex: 0 0 35%;
  max-width: 35%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0;
}

.navbar-search-section form {
  width: 100%;
  margin-left: auto;
}

.navbar-search-section .input-group {
  width: 100%;
}

@media (min-width: 992px) {
  .navbar-search-section {
    margin-right: -10px; /* visually tuck search into links */
  }
}

@media (max-width: 991.98px) {
  .navbar-search-section {
    display: none !important;
  }
  .navbar-mobile-icons {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
  }
  .navbar-mobile-search {
    display: none;
    width: 100vw;
    max-width: 100vw;
    position: absolute;
    left: 0;
    top: 56px;
    z-index: 1051;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    margin: 0;
  }
  .navbar-mobile-search.show {
    display: flex !important;
  }
  .navbar-search-section form {
    margin-left: 0;
  }
}

.navbar-mobile-icons {
  display: none;
}

.navbar-mobile-search input.form-control {
  flex: 1 1 auto;
}

.navbar-mobile-search .btn {
  min-width: 48px;
}

.navbar-links-section {
  flex: 0 0 40%;
  max-width: 40%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 991.98px) {
  .navbar-sections {
    flex-direction: column;
    gap: 0;
  }
  .navbar-logo-section,
  .navbar-search-section,
  .navbar-links-section {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  .navbar-links-section {
    justify-content: flex-start;
  }
}

.navbar {
  background-color: var(--brand-blue-dark) !important;
  min-height: 70px;
  font-size: 1.25rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.navbar .navbar-brand, .navbar .navbar-nav .nav-link {
  font-size: 1.05rem;
  line-height: 1.8rem;
}

/* Main menu links use brand yellow */
.navbar-nav .nav-link {
  color: var(--brand-yellow) !important;
  font-weight: 600;
  background: none !important;
  border: none !important;
  transition: color 0.2s, border 0.2s;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link:focus {
  color: #fff !important;
  background: none !important;
}

.navbar-nav .nav-link.active {
  color: #fff !important;
  background: none !important;
  border-bottom: 2px solid var(--brand-blue-light) !important;
  border-left: 2px solid var(--brand-blue-light) !important;
  border-radius: 0;
}

/* On mobile, menu appears at right but text is left-aligned */
@media (max-width: 991.98px) {
  .navbar-collapse {
    justify-content: flex-end !important;
  }
  .navbar-nav {
    align-items: flex-start !important;
    text-align: left !important;
  }
}


.navbar-logo {
  height: 100%;
  max-height: 70px;
  width: auto;
  padding: 0 !important;
  margin: 0 !important;
  display: block;
  object-fit: contain;
}

.search-btn {
  background: var(--brand-yellow) !important;
  color: var(--brand-blue-dark) !important;
  border: none !important;
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: 0;
}

.search-btn .bi-search {
  font-size: 1.3rem;
  vertical-align: middle;
}

/* Adjust input height to match button */
.navbar form .form-control {
  min-width: 0;
  height: calc(2.25rem + 2px);
  font-size: 1rem;
}


/* Sidebar - Complete Styling */
.sidebar {
  position: relative;
  z-index: 100;
  padding: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  background-color: #e2e4e7 !important; /* soft silver/grey */
  color: #012F58 !important;
}

.sidebar .nav-link {
  padding: 0.75rem 1rem;
  border-radius: 0;
  border-left: 3px solid transparent;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.sidebar a {
  color: #003CA0 !important;
}

.sidebar a.active, .sidebar a:focus, .sidebar a:hover {
  color: #4F90FF !important;
  background-color: #e6e8eb !important;
}

.sidebar .nav-link i {
  margin-right: 0.5rem;
  width: 20px;
  text-align: center;
  font-size: 12px;
}

.navbar .navbar-brand, .navbar-nav .nav-link {
  color: #fff !important;
}

.btn-primary {
  background-color: var(--brand-blue-main) !important;
  border-color: var(--brand-blue-main) !important;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--brand-blue-light) !important;
  border-color: var(--brand-blue-light) !important;
}

/* Map Styles */
.map-container {
  height: 450px !important;
  width: 100% !important;
  position: relative !important;
  z-index: 5 !important;
  visibility: visible !important;
  display: block !important;
  background-color: #f8f9fa !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  overflow: hidden !important;
  margin-bottom: 20px !important;
}

/* Responsive map heights */
@media (max-width: 768px) {
  .map-container {
    height: 350px !important;
  }
}

@media (max-width: 576px) {
  .map-container {
    height: 300px !important;
  }
}

/* Map loading indicator */
.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Map error message */
.map-error-message {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background-color: rgba(255, 0, 0, 0.7);
  color: white;
  padding: 10px;
  border-radius: 5px;
  max-width: 80%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-warning, .badge-warning {
  background-color: var(--brand-yellow) !important;
  color: #012F58 !important;
  border-color: var(--brand-yellow) !important;
}

a {
  color: var(--brand-blue-main);
}

a:hover {
  color: var(--brand-blue-light);
}

/* Minimal use of yellow for highlights */
.highlight, .text-warning {
  color: var(--brand-yellow) !important;
}

/* Example card styling */
.card {
  background-color: #f5f6fa;
  border-color: #d9dce0;
}

.card-header {
  background-color: var(--brand-blue-main);
  color: #fff;
}

/* Fix: when card headers use bg-light, ensure readable dark text on light background */
.card-header.bg-light,
.card .card-header.bg-light {
  background-color: #f8f9fa !important;
  color: var(--brand-blue-dark) !important;
  border-bottom: 1px solid #dee2e6;
}

/* Add more customizations as needed */

/* Map container styling */

.map-wrapper {
  width: 100%;
  position: relative;
  overflow: visible;
  height: 450px; /* Set explicit height */
  display: block;
}

/* Ensure the shared map container used in forms establishes a stacking context
   that does not overlay neighboring form fields */
.form-map-container {
  position: relative;
  z-index: 0;
}

.map-container {
  width: 100%;
  height: 100%; /* Use 100% of parent height */
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  display: block; /* Ensure display block */
  min-height: 450px; /* Minimum height */
  background-color: #f8f8f8; /* Background color to see container */
}

.map-content {
  width: 100% !important; /* Force 100% width */
  height: 100% !important; /* Force 100% height */
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 5; /* Increased z-index to ensure visibility */
  max-width: 100% !important; /* Prevent overflow */
  max-height: 100% !important; /* Prevent overflow */
  display: block !important; /* Ensure display block */
  min-height: 450px; /* Minimum height */
}

/* Override any Leaflet inline styles that might cause overflow */
/* IMPORTANT: Keep the Leaflet container positioned relatively so it doesn't
   escape its parent and overlay other inputs on create/edit pages. */
.leaflet-container {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  position: relative !important; /* was absolute */
  z-index: 0 !important; /* keep below controls and outside UI */
  overflow: hidden !important;
  min-height: 450px !important;
}

/* Fix Leaflet controls */
.leaflet-control-container {
  position: absolute;
  z-index: 10;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  z-index: 10 !important;
}

.leaflet-control-zoom {
  visibility: visible !important;
  display: block !important;
}

/* Fix Leaflet popups */
.leaflet-popup {
  z-index: 15 !important;
}

/* Fix Leaflet tiles to prevent overflow */
.leaflet-tile-container {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  visibility: visible !important;
  z-index: 2 !important;
  overflow: hidden !important;
}

/* Fix Leaflet pane */
.leaflet-map-pane {
  z-index: 10 !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  visibility: visible !important;
}

/* Fix for map tiles */
.leaflet-tile {
  visibility: visible !important;
}

/* Responsive adjustments for the map */
@media (max-width: 767.98px) {
  .map-container {
    margin-top: 1.5rem;
    height: 350px;
  }
}

/* Uploader styles removed (legacy FilePond/custom uploaders) */

@import "navbar-mobile.css";

@import "offcanvas-mobile.css";

/* Footer */
.footer-top {
  color: var(--brand-blue-dark);
  position: relative;
}

.footer-top::before {
  content: "";
  position: absolute;
  left: 0;
  top: -20px; /* sit just above footer */
  width: 100%;
  height: 20px;
  pointer-events: none;
  /* fade upward from subtle shadow to transparent */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0));
  /* taper at left/right edges */
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,1) 12%, rgba(0,0,0,1) 88%, rgba(0,0,0,0));
  mask-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,1) 12%, rgba(0,0,0,1) 88%, rgba(0,0,0,0));
}

.footer-top h6 {
  color: var(--brand-blue-dark);
}

.footer-top a.text-reset {
  color: var(--brand-blue-main) !important;
}

.footer-top a.text-reset:hover {
  color: var(--brand-blue-light) !important;
}

/* Footer heading accent */
.footer-top h6 {
  position: relative;
  display: inline-block;
  letter-spacing: 0.02em;
}

.footer-top h6::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 36px;
  height: 3px;
  background-color: var(--brand-yellow);
  border-radius: 2px;
}

/* Animated underline for links */
.footer-top a.text-reset {
  position: relative;
  text-decoration: none;
}

.footer-top a.text-reset::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease-in-out;
  opacity: 0.6;
}

.footer-top a.text-reset:hover::after {
  transform: scaleX(1);
}

/* Column separators on md+ */
@media (min-width: 768px) {
  .footer-col {
    position: relative;
    padding-left: 1rem;
  }
  .footer-col:not(:first-child) {
    border-left: 1px solid #eceff3;
  }
}

/* Tighter list spacing */
.footer-top ul li {
  margin-bottom: 0.35rem;
}

/* Reduce spacing under footer area */
footer.text-muted.small {
  margin-top: 0.75rem !important; /* was mt-3 */
  padding-top: 0.5rem !important; /* was pt-2/3 */
}

/* Breadcrumbs */
nav[aria-label="breadcrumb"] .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
  font-size: .9rem;
}

nav[aria-label="breadcrumb"] .breadcrumb-item + .breadcrumb-item::before {
  content: "›"; /* chevron divider */
  color: #9aa6b2;
  padding-right: 0.25rem;
}

nav[aria-label="breadcrumb"] .breadcrumb-item a {
  color: var(--brand-blue-main);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

nav[aria-label="breadcrumb"] .breadcrumb-item a:hover {
  color: var(--brand-blue-light);
  border-color: currentColor;
}

nav[aria-label="breadcrumb"] .breadcrumb-item.active {
  color: var(--brand-blue-dark);
  font-weight: 600;
  max-width: 50vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


