
    /* ======================================

          MEDIA QUERIES SECTION

    ====================================== */

/* For screen sizes under 1200px */
@media (max-width: 1200px) {
  .hero-stork-img {
    max-height: 8rem;
    right: -2rem;
    bottom: -3rem;
  }
}

/* For screen sizes under 992px */
@media (max-width: 992px) {
.legend-container {
    min-height: auto !important;
    /* padding: 0.5rem; */
  }

#map-div {
  padding-right: 0 !important;
  padding-left: 0 !important;
}
  #legend, #year-legend {
    flex-direction: row !important; 
    flex-wrap: wrap; 
    justify-content: flex-start; 
    gap: 8px; 
    padding: 10px; 
  }

  
  /* Style the individual legend items to take roughly half the width */
  #legend > div, 
  #year-legend > div {
    flex: 1 1 calc(50% - 4px) !important; 
    max-width: calc(50% - 4px) !important; 
    word-break: break-all; 
  }

  
  .legend-item {
    flex-wrap: wrap; /* Ensures content within the item wraps */
  }

 .color-box {
    width: 0.75rem;
    height: 0.75rem;
  }
}

/* For screen sizes under 768px */
@media (max-width: 768px) {
  #main-container {
    flex-direction: column;
    height: 70vh;
    margin: 1rem;
  }
  .hero-stork-img {
    max-height: 6rem;
    right: -1rem;
    bottom: -2rem;
  }
  #hero-top {
    max-width: 90% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .legend-container { /* If you need this specific override here, keep it */
     min-height: auto !important;
  }
}

/* For screen sizes under 576px */
@media (max-width: 576px) {
  #legend, #year-legend {
    font-size: 12px;
    padding: 5px;
    gap: 6px; 
    flex-direction: column !important; 
    flex-wrap: nowrap !important; 
  }

  /* Ensure items take full width to stack properly */
  #legend > div,
  #year-legend > div {
    flex: 1 1 100% !important; 
    max-width: 100% !important; 
  }

  .legend-item {
    flex: 1 1 100%; 
    max-width: 100%; 
  }

 .color-box {
    width: 0.75rem;
    height: 0.75rem;
  }
  
  #play-animation-section img {
    max-height: 3rem;
    bottom: -1rem;
  }
  .hero-stork-img {
    max-height: 4rem;
    right: 0;
    bottom: -1rem;
  }
}





    /* ======================================

          PAGE, SECTION & DIV SETUP

    ====================================== */


#cluster-legend-container {
  overflow-wrap: break-word;
  max-width: 100%;
}

h6.legend-label-text {
  margin-left: 1rem;
}


body {
    /* font-family: 'Inter', sans-serif; */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif
    background-color: #F9F9F9 !important;
  }

  main {
    background-color: #F9F9F9 !important;
  }

  .card-body {
    background-color: #F9F9F9 !important;
  }

  .card-title {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
  }

  /* Setup for any div. with the main-card class */
div.main-card {
  background-color: #F9F9F9 !important;
  color: #3A2F51;
  border-radius: 16px !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

label.form-label {
  font-size: 1rem !important;
  font-weight: 700 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
}

.form-label-h h5 {
  font-size: 1.5rem;
  margin-left: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

h5.form-top-h5 {
  font-size: 1.5rem;
  margin-left: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

h5.form-h5 {
  font-size: 1.5rem;
  margin-left: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

span.form-h5 {
  padding-left: -5px;
}

#kmeans-params, #dbscan-params, #hdbscan-params {
  margin-top: 0;
}

p.form-p {
  margin-top: 0;
  margin-left: 2rem;
  padding-right: 2rem;
}

p.filterform-p {
  margin-top: 1rem;
  margin-left: 0.25rem;
  margin-bottom: 0;
  padding-right: 0rem;
}

.filter-label-text {
  font-size: 1.2rem;
}

    /* ======================================

              HERO SECTION

    ====================================== */

  #hero-top {
  background-color:#C66489;
  color: #F9F9F9;
  padding-top: 2rem !important;
  padding-bottom: 4rem !important;
  /* padding-left: 1rem;
  padding-right: 1rem; */
  border-radius: 1rem;
  margin: 1rem auto;
  /* margin: 1rem 1rem; */
  max-width: 85%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  /* overflow: hidden; */
  padding-left: 1rem;
  padding-right: 1rem;
}

  .hero-stork-img {
  max-height: 10rem;
  transition: max-height 0.4s ease, right 0.4s ease, bottom 0.4s ease;
}


    /* ======================================

          ANIMATION SLIDER SECTION

    ====================================== */

div#time-animation-controls {
  /* margin-top: 0 !important; */
  margin-bottom: 0 !important;
}

/* text #201A2D
background #CBCAE8 */
#sliderSection {
  background-color: #A4A1D6;
  color: #3A2F51;
  font-weight: 600;
  padding: 0rem 1rem 0.5rem 1rem !important;
  margin: 0px;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* KK checked OK */
#speedSelect {
  padding: 0.375rem 0.75rem;
  height: 2rem;
  width: 7rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: normal;
  background-color: #F9F9F9 !important;
  color: #3A2F51 !important;
}

.slider-detail {
  margin-bottom: 0.5rem;
}

#playButton {
  padding: 0.375rem 0.375rem;
  height: 2.25rem;
  width: 5rem;
  font-size: 0.9rem;
  line-height: normal; 
  transition: opacity 0.3s ease, filter 0.3s ease; 
  opacity: 1;  
  cursor: pointer; 
}

#playButton.disabled, 
#playButton:disabled {
  opacity: 0.4;        
  cursor: not-allowed;   
  filter: grayscale(50%); 
}

#time-label {
  color: #3A2F51 !important;
}

#time-animation-controls {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

#time-slider {
  width: 30%;
  margin-bottom: 0.5rem !important;
}

#sliderSection .form-label,
#sliderSection label,
#sliderSection .form-check-label {
  color: #3A2F51;
  font-weight: 600;
}

#sliderSection .form-select,
#sliderSection .btn,
#sliderSection .form-check-input {
  border-radius: 0.5rem;
}

#sliderSection .form-select {
  background-color: #343a40;
  color: #3A2F51;
  border: 1px solid #F9F9F9;
}

#sliderSection .form-check-input:checked {
  background-color: #ad3939;
  border-color: #F9F9F9;
}

#sliderSection .form-check-input:focus,
#sliderSection .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(249, 249, 249, 0.5);
}

/* Time slider colour per year */
#time-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 4px;
}
#time-slider::-moz-range-track {
  height: 6px;
  border-radius: 4px;
}

.play-img {
  position: relative;
  height: 6vh; 
}

.play-stork-img {
  position: absolute;
  bottom: 0rem;
  right: 0.0rem;
  max-height: 100%;
  height: auto;
  width: auto;
  pointer-events: none;
}


    /* ======================================

              MOVING LOADING SECTION

    ====================================== */

#loading-section {
  opacity: 1;
  transition: opacity 1.0s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transform: translateZ(0);
}

#loading-section.fade-out {
  opacity: 0;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

#stork-spinner {
  width: 50px;
  height: 50px;
  animation: bounce 1.0s ease-in-out infinite;
}

    /* ======================================

          CLUSTERING FORM SECTION

    ====================================== */

#cluster-section {
  margin-top: 0 !important;
  background-color: #F9F9F9 !important;
}

/* Setup for the main clustering form box */
  #clusteringForm {
  background-color: #A1D6BF;
  color: #3A2F51;
  padding: 0rem 1rem 1rem 1rem;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}




    /* ======================================

                NAV BAR SECTION

    ====================================== */

  .b-example-vr {
    flex-shrink: 0;
    width: 1.5rem;
    height: 100vh;
  }

  .bi {
    vertical-align: -.125em;
    fill: currentColor;
  }

  .fixed-nav-bar {
    background-color: #3C3B3A;
    color: #F9F9F9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }
  .navbar-brand {
    color: #fff !important;
    font-weight: bold;
    font-size: 1.5rem;
  }
  .nav-link {
    color: #f8f9fa !important;
  }
  .nav-link:hover {
    color: #ffc107 !important; /* yellow on hover */
  }

  .nav-scroller {
    position: relative;
    z-index: 2;
    height: 2.75rem;
    overflow-y: hidden;
  }

  .nav-scroller .nav {
    display: flex;
    flex-wrap: nowrap;
    padding-bottom: 1rem;
    margin-top: -1px;
    overflow-x: auto;
    text-align: center;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .bd-mode-toggle {
    z-index: 1500;
  }

  .bd-mode-toggle .dropdown-menu .active .bi {
    display: block !important;
  }  


    /* ======================================

          MAP AND LEGEND SECTION

    ====================================== */

#map {
  min-height: 600px;
  /* height: 700px; */
  width: 100%;
  /* border: 1px solid #ccc; */
  /* border-radius: 8px; */
  border-radius: 1rem !important;
  margin-bottom: 0 !important;
}

#map {
  flex: 1;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

/* Optional: give a max-width to prevent map overflow on huge screens */
@media (min-width: 1400px) {
  #main-container {
    margin-right: 1rem;
    /* margin-left: 1rem; */
  }
}

#map-div {
  /* border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);  */
  padding-right: 0;
  padding-left: 0.5rem;
}

/* #legend .rounded {
  border-radius: 1rem  
} */


#map-card {
  padding: 16px 16px 0px 16px;
}

.legend-item.selected-cluster {
  background-color: #A1D6BF !important;
  border-left: 4px solid #333;
  padding-left: 4px;
}

.legend-item:hover {
  background-color: #c8e8d5;
}

/* Styles for the main legend card container */
.legend-container {
  background-color: #A1D6BF;
  padding: 1rem 0.5rem !important;
  max-height: 100%;
  overflow-y: auto;
  border-radius: 1rem !important;
  min-height: 600px;
  overflow: hidden !important;
  /* margin-left: 0 !important; */
  /* box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); */
}

/* Base flex properties for #legend and #year-legend (the direct parents of items) */
/* Styles for the actual list of legend items (inside the card) */
#legend, #year-legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  word-wrap: break-word;
  margin-right: 10px;
  padding: 10px;
  padding-bottom: 0.75rem;
  font-family: sans-serif;
  font-size: 14px;
  overflow-y: auto;
  /* box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); */
}

.legend-item {
  flex-wrap: wrap;
  word-break: break-word;
}

/* Base flex properties for individual legend items (all direct div children) */
#legend > div,
#year-legend > div {
    display: flex;
    align-items: center;
    gap: 6px; 
    padding-bottom: 0.0rem;
    flex-wrap: wrap; 
}


.color-box {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  display: inline-block;
  border: 1px solid #666;
  border-radius: 3px;
}


.btn, .form-select, .form-control {
  transition: all 0.3s ease-in-out;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}


#map-controls label {
  font-weight: 600;
}

#main-container {
  display: flex;
  height: 80vh;
  margin: 0 1rem 1rem 1rem; 
  box-sizing: border-box;
}



/* Default styling */
#map-controls {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}

  #map-controls {
    flex-direction: column;
    align-items: flex-start;
    /* padding: 0 1rem; 
    width: 100%;
    box-sizing: border-box; */
  }

/* kk colour */
#map-section {
  background-color: #F9F9F9;
  color: #3A2F51;
  margin-bottom: 0.5em !important;
  padding: 0 0px;
}

.container my-4 {
  background-color: #6ca63e;
}

#mapFiltersForm {
  /* padding: 32px; */
  background-color: #D3D6A1;
  color: #3A2F51;
  padding: 0.5rem 1rem 1rem 1rem;
  margin: 0rem 0rem 0rem 0rem;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

    /* ======================================

        OTHER BUTTONS & FILTERS SECTION

    ====================================== */

/* Shared base for clustering/clear buttons */
.btn-clustering-style {
  min-height: 2.4rem;
  height: auto;
  width: 100%;
  white-space: normal;
  /* padding: 0.375rem 0.75rem; */
  font-weight: 600;
  border-radius: 0.4rem;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ################## ORIGINAL CLEAR ALL BUTTON CODE ###################### */
/* Clear All Filters color scheme
.btn-custom-warning {
  background-color: #C66489 !important;
  color: #fff !important;
  border: 1px solid #C66489 !important;
}

#clearAllFilters {
  white-space: normal; 
  width: 100%; 
  min-height: 2.4rem;
  height: auto;
  padding: 0.375rem 0.75rem; 
  text-align: center;
}

.btn-custom-warning:hover,
.btn-custom-warning:focus {
  background-color: #9e3a60 !important;
  border-color: #9e3a60 !important;
  color: #fff !important;
} */
/* ################## ORIGINAL CLEAR ALL BUTTON CODE ###################### */

.btn-custom-warning {
  background-color: #726FB4 !important;
  color: #fff !important;
  border: 1px solid #726FB4 !important;
}

#clearAllFilters {
  white-space: normal;
  width: 100%;
  min-height: 2.4rem;
  height: auto;
  padding: 0.375rem 0.75rem;
  text-align: center;
}

.btn-custom-warning:hover,
.btn-custom-warning:focus {
  background-color: #5C59A3 !important;
  border-color: #5C59A3 !important;
  color: #fff !important;
}


/* Filter months buttons */  
.uniform-btn {
  width: 55px !important;
  height: 35px !important;
  border-radius: 0.5rem !important; 
  margin-bottom: 1px !important; 
  text-align: center !important;
  font-size: 0.9rem;
}
/* Filter time-slot buttons */  
.uniform-btn-wide {
  width: 120px !important;
  height: 35px !important;
  border-radius: 0.9rem !important;
  margin-bottom: 1px !important;
  text-align: center !important;
  font-size: 0.9rem;
}

    /* ======================================

        EXTENDED DATA TABLES SECTION

    ====================================== */

/* -----------------------------
   Sections & Table Cards
------------------------------ */


/* Setup for the main table card */
  #table-card {
  background-color: #A1D6BF !important;
  color: #3A2F51;
  padding: 0rem 1rem 1rem 1rem;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  overflow-x: auto;
}

/* Setup for the summary table card */
  #summary-table-card {
  background-color: #D3D6A1 !important;
  color: #3A2F51;
  padding: 0rem 1rem 0.5rem 1rem;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* Setup for the chart table card */
  #chart-card {
  background-color: #A4A1D6 !important;
  color: #3A2F51;
  padding: 0rem 1rem 1rem 1rem;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  margin-top: 0.5rem;
}



/* -----------------------------
   Table Styling
------------------------------ */
#clusterTable {
  background-color: #fdfdfd !important; /* slightly softer off-white */
}

#birdYearTable {
  background-color: #fdfdfd !important; 
  margin-bottom: 0 !important; /* remove space under table */
}



/* -----------------------------
   Map Link Button
------------------------------ */
.cluster-btn {
  background-color: #3A2F51;   /* dark purple/navy */
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  text-decoration: none;
}

.cluster-btn:hover {
  background-color: #57477A;   /* lighter hover */
  color: #ffffff;
}

/* -----------------------------
   Export Buttons (CSV, Excel, PDF, Print)
------------------------------ */
.dt-button {
  background-color: #3A2F51 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  margin: 0 4px !important;
  font-size: 13px !important;
  transition: background-color 0.2s ease;
}

.dt-button:hover {
  background-color: #57477A !important;
  color: #fff !important;
}

/* -----------------------------
   Search Input
------------------------------ */
.dataTables_filter input {
  background-color: #fdfdfd !important;   /* matches table */
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-size: 14px;
  color: #3A2F51 !important;
}

.dataTables_filter input:focus {
  border-color: #3A2F51  !important;
  box-shadow: 0 0 0 2px rgba(58, 47, 81, 0.25);
  outline: none;
}

/* -----------------------------
   Pagination Buttons
------------------------------ */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background-color: #fdfdfd;   /* off-white */
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #3A2F51 !important;
  padding: 4px 10px;
  margin: 0 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: #57477A !important;
  color: #ffffff !important;
  /* border: 1px solid #3A2F51; */
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: #f0f0f0 !important; /* subtle off-white shade */
  color: #3A2F51 !important;           /* dark text for visibility */
  border: 1px solid #ccc !important;
}

/* -----------------------------
   Length Dropdown (Show Entries)
------------------------------ */
.dataTables_wrapper .dataTables_length select {
  background-color: #fdfdfd;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 8px;
  color: #3A2F51;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_length select:focus {
  border-color: #3A2F51;
  outline: none;
  box-shadow: 0 0 0 2px rgba(58, 47, 81, 0.2);
}

/* -----------------------------
   Optional: Adjust table header
------------------------------ */
#clusterTable thead th,
#birdYearTable thead th {
  background-color: #e6e6e6; /* same subtle grey */
  color: #3A2F51;
  border-bottom: 2px solid #ccc;
  padding: 6px;
}
/* Force both tables to render the same interior style */
#clusterTable, #birdYearTable {
  background-color: #fdfdfd !important;
  border-collapse: collapse;
}

#birdYearTable_wrapper {
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 0 !important;
}


#clusterTable td, #birdYearTable td {
  background-color: #fdfdfd; /* ensures cells cover card bg */
  color: #3A2F51;
}
/* -----------------------------
   Optional: Scrollbar for long tables
------------------------------ */
.dataTables_scrollBody {
  max-height: 400px !important;
  overflow-y: auto !important;
}

/* -----------------------------
   Tooltip for Map Buttons
------------------------------ */
.cluster-btn[title] {
  cursor: pointer;
}

/* -----------------------------
   Styles for Summary Table
------------------------------ */

/* Button group consistency */
.btn-group .btn {
  border-radius: 0.5rem !important;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  margin: 0 10px;
}

/* Dropdown style */
#largeThreshold {
  border-radius: 0.5rem;
  background-color: #fdfdfd; /* same off-white as tables */
  border: 1px solid #ccc;
  color: #3A2F51;
}

/* Hover/active states */
.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover {
  opacity: 0.9;
}

.metric-toggle {
  background-color: #6c5ce7; /* vivid purple */
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 0.5rem 1rem;
  transition: background-color 0.2s ease;
}

.metric-toggle:hover {
  background-color: #5a4bd1; /* darker on hover */
  color: #fff;
}

.metric-toggle.active {
  background-color: #3A2F51; /* your SME deep purple */
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(58, 47, 81, 0.4); /* subtle glow */
}

/* -----------------------------
   Button Styles for Charts
------------------------------ */

.chart-value-toggle {
  background-color: #fff;         
  color: #4B0082;                
  border: 2px solid #4B0082;     
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.chart-value-toggle:hover {
  background-color: #4B0082;
  color: #fff;                    
}

.chart-value-toggle.active {
  background-color: #4B0082;
  color: #fff;
}





    /* ======================================

      LEAVE BELOW .hide AT VERY BOTTOM OF CSS

    ====================================== */

/* Enables visibility switch without setting inline styles, allowing any media query rules to still apply. */
/* Hide utility class */
.hide {
  display: none !important;
}
