/* =========================
   GLOBAL
========================= */
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
}

#ffdrLabelText {
    display: block;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

/* =========================
   HEADER
========================= */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("/static/Images/back-img1.jpg");
  background-size: cover;
  background-position: center;
  padding: 0;
  flex-wrap: wrap;
  border-bottom: 1.5px solid #006400;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

header img {
  height: 60px;
  margin-left: 10px;
  margin-right: auto;
}

/* .header-text {
  flex-grow: 1;
} */
.header-text {
    flex-grow: 1;
    display: flex;
    justify-content: center;   /* horizontal center */
    align-items: center;       /* vertical center (if height exists) */
    text-align: center;
}

#main_title {
    margin: 0;
}

.title {
  font-family: "Copperplate", "Copperplate Gothic Light", fantasy;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
  font-weight: 600;
}
/* title main_title {
    margin-left: 500px;
} */
.btn-filter {
    BACKGROUND-COLOR: GREEN;
    COLOR: WHITE;
    BORDER-RADIUS: 8PX;
    HEIGHT: 30PX;
    WIDTH: 92PX;
    cursor: pointer;
}

.btn-reset {
    BACKGROUND-COLOR: INDIANRED;
    COLOR: WHITE;
    BORDER-RADIUS: 8PX;
    HEIGHT: 30PX;
    WIDTH: 92PX;
    cursor: pointer;
}
#backBtn{
   BACKGROUND-COLOR: blue;
    COLOR: WHITE;
    BORDER-RADIUS: 8PX;
    HEIGHT: 30PX;
    WIDTH: 92PX;
    cursor: pointer;
}
#refreshBtn{
    BACKGROUND-COLOR: GREEN;
    COLOR: WHITE;
    BORDER-RADIUS: 8PX;
    HEIGHT: 30PX;
    WIDTH: 92PX;
    cursor: pointer;
}

/* =========================
   TOP HEADER (SEARCH)
========================= */
#top-header {
  width: 100%;
  height: 25px;
  background-color: #90EE90;
  padding: 10px;
  border-bottom: 1px solid #7ed67e;
  flex-shrink: 0;
}

#search_district {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto;
}

#search_district input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#resetBtn {
  background-color: #228B22;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

#resetBtn:hover {
  background-color: #1e7a1e;
}

#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    /* display: none; */
    z-index: 9999;
}

#search_district {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    margin-top: -4px;
}

/* =========================
   MAIN LAYOUT
========================= */
.container {
  /* flex: 1; */
  display: flex;
  /* overflow: hidden; */
  height: 7200px;
}

/* =========================
   SIDEBAR (SINGLE SOURCE)
========================= */
#sidebar {
  width: 300px;
  max-width: 500px;
  min-width: 0;
  height: 100%;
  flex-shrink: 0;

  background: linear-gradient(to bottom, #e6f5d0, #a8cf45);
  color: #000;
  padding: 15px;

  border-right: 1px solid #ccc;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.2);

  position: relative;
  overflow-y: auto;
  transition: width 0.3s ease, padding 0.3s ease;
}

#sidebar.minimized {
  width: 0;
  padding: 5px;
}

#sidebar-resizer {
  width: 5px;
  background: #ccc;
  cursor: ew-resize;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 10;
}

#sidebarToggle {
    cursor: pointer;
    background: #63946a;
    border: none;
    padding: 5px 8px;
    border-radius: 4px;
}

/* =========================
   MAP
========================= */
#map {
  flex-grow: 1;
  min-width: 0;
  position: relative;
}

.layer-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    flex-shrink: 0;
    stroke: #000;
    fill: none;
    stroke-width: 1.6;
}

.filter-icon{
    height: 15px;
}

.leaflet-control.info-icon {
    background-color: white;
    padding: 8px 5px;
    border-radius: 4px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

/* =========================
   ACCORDION
========================= */
.accordion-wrapper {
  width: 100%;
  background-color: #316f4d;
}

.accordion-item {
  border-bottom: 1px solid #333;
}

.accordion-header {
  width: 100%;
  background-color: #f2f2f218;
  padding: 16px;
  font-size: 15px;
  color: #fff;
  border: none;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}

.accordion-header:hover {
  background: #275a3e;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
  max-height: 900px;
  padding: 12px 16px;
}

.accordion-content label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  margin: 8px 0 4px;
  color: white;
}

#ffdrLabel {
  display: flex;
  align-items: flex-start;   /* checkbox aligns to top */
  gap: 8px;
}

#ffdrLabelText {
  display: block;
  line-height: 1.35;
  white-space: normal;       /* allow wrapping */
  word-break: break-word;    /* prevent overflow */
}

/* =========================
   TREE / CHECKBOX
========================= */
.tree ul {
  list-style: none;
  padding-left: 20px;
}

.tree li {
  margin: 4px 0;
}

.tree label {
  display: block;
  margin: 8px 0;
  cursor: pointer;
}

.caret {
  cursor: pointer;
  font-weight: bold;
  color: #fff;
}

.caret::before {
  content: "▶ ";
  margin-right: 6px;
}

.caret-down::before {
  content: "▼ ";
}

.nested {
  display: none;
}

.nested.active {
  display: block;
}

/* =========================
   LABELS
========================= */
.fire-label {
  font-size: 13px;
  font-weight: bold;
  background: rgba(255, 255, 0, 0.8);
  padding: 3px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.fire-label-detail {
  font-size: 13px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #008080;
  padding: 3px 6px;
  pointer-events: none;
}

.district-label {
  font-size: 12px;
  font-weight: bold;
  color: orangered;
  text-shadow: 1px 1px 2px white;
  pointer-events: none;
}

.beat-label {
  font-size: 12px;
  font-weight: bold;
  color: #FF5733;
  pointer-events: none;
}

/* =========================
   LEGEND
========================= */
.legend {
  position: absolute;
  bottom: 50px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 9999;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 13px;
  margin: 3px 0;
}

.legend-item span {
  display: inline-block;
  width: 20px;
  height: 12px;
  margin-right: 6px;
  border: 1px solid #666;
}

.legend-square {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: middle;
}

/* Legend zigzag lines */
.legend-zigzag {
  width: 26px;     /* ⬅ shorter length */
  height: 6px;     /* ⬅ slimmer height */
  flex-shrink: 0;
}

.legend-zigzag polyline {
  stroke-width: 1.6;   /* ⬅ clean & readable */
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legend-child {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 22px;
  font-size: 13px;
  line-height: 1.3;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    border: 2px solid #00000033;
}

/* =========================
   LINKS
========================= */
#links {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  height: 22px;
}

#links a {
  text-decoration: none;
  color: #0066cc;
  font-weight: 500;
}

#links a:hover {
  text-decoration: underline;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

  .container {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  #map {
    flex: 1;
    height: 50vh;
    
    width: 80vh
  }

  .title {
    font-size: 1.3rem;
    text-align: center;
  }
  /* #main_title 
{
    margin-left: 324px;
} */

  #links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

