/* ====== Base layout ====== */
body, html {
  margin: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: #2d6a4f;
  color: white;
  /* padding: 10px 20px; */
  /* display: flex; */
  justify-content: space-between;
  align-items: center;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

header h1 {
  margin: 0;
  font-size: 1.2em;
}

nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}
.navbar-nav .nav-link {
  font-weight: 500;
  transition: color 0.3s;
}
.navbar-nav .nav-link:hover {
  color: #d4edda;
}

.btn-outline-light:hover {
  background-color: #ffffff33;
  color: white;
}

/* Optional: reduce navbar padding on small screens */
@media (max-width: 576px) {
  .navbar .nav-link {
      padding: 0.3rem 0.5rem;
      font-size: 0.9rem;
  }
  .navbar-brand span {
      font-size: 1rem;
  }
}

/* Footer */
footer {
  background: #2d6a4f;
  color: white;
  padding: 10px 0;
  text-align: center;
  font-size: 0.9em;
}

/* ====== Main content layout ====== */
main {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: auto;
}

/* Map container */
#map-container {
  position: relative;
  /* flex: 2; */
  flex:0 0 50%;
  min-height: 400px;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 300px;
}

/* Map controls (floating) */
#map-controls {
  position: absolute;
  top: 50px;
  left: 10px;
  width: auto;          /* fits content */
  max-width: 200px;     /* prevent it from being too wide */
  background: rgba(255,255,255,0.95);
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 1500;
}

/* Left panel (filters) */
#left-panel {
  width: 188px;
  background: #f9f9f9;
  padding: 10px;
  box-shadow: 2px 0px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: all 0.3s ease;
}

/* Hidden state */
#left-panel.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
}
 #locateBtn {
  position: relative;
  /* bottom: 20px;
  right: 20px; */
  z-index: 1000;
  width: 32px;      /* smaller */
  height: 32px;
  border: none;
  border-radius: 50%;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, box-shadow 0.2s;
  padding: 0;
}

#locateBtn:hover {
  background-color: #f0f0f0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

#locateBtn i {
  color: #4285f4;  /* Google blue */
  font-size: 14px; /* smaller icon */
}
/* new filter panel *//* Compact toolbar */
#filter-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    max-width: 98%;
    margin: 10px auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);

    height: 58px; /* 🔥 reduces height */
}

/* Tiny compact items */
#filter-bar .fi {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

#filter-bar label {
    font-size: 0.70rem;
    margin-bottom: 2px;
    font-weight: 600;
    color: #444;
}

#filter-bar select,
#filter-bar input[type="date"] {
    padding: 4px 6px;
    font-size: 0.78rem;
    border-radius: 5px;
    border: 1px solid #bbb;
}

/* Slider area */
.slider-box input {
    width: 120px;
}

/* Stats */
#radius-stats1 {
    padding: 3px 6px;
    background:#f4f8ff;
    border:1px solid #d1e0ff;
    border-radius:6px;
    font-size: 0.75rem;
}

/* Filter button */
.blue-btn {
    padding: 6px 12px;
    background:#007bff;
    border:none;
    color:white;
    border-radius:6px;
    font-size:0.8rem;
}

/* Locate button */
.link-btn {
    background:none;
    border:none;
    color:#007bff;
    font-weight:600;
    cursor:pointer;
    font-size:0.8rem;
}

/* 🔥 MOBILE VIEW */
@media(max-width: 768px){
    #filter-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }
    .fi, #filterBtn, #locateBtn {
        width: 48%;
    }
    .slider-box input {
        width:100%;
    }
    #radius-stats1 {
        width:48%;
    }
}
/* FILTER BAR CONTAINER */
.filter-bar {
  max-width: 360px;                  /* keeps it narrow */
  margin: 0 auto;
  padding: 15px;
  background: #ffffff;
  border: 1px solid #dcdcdc;         /* nice soft border */
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* FORM LABELS */
.filter-bar label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 3px;
  display: block;
}

/* INPUTS */
.filter-bar select,
.filter-bar input[type="date"],
.filter-bar input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* FILTER BUTTON */
.filter-btn {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border-radius: 8px;
  background: #007bff;
  color: #fff;
  border: none;
  font-weight: 600;
  transition: 0.2s ease;
}

.filter-btn:hover {
  background: #0064d6;
}

/* Radius group */
.radius-container {
  margin-top: 10px;
  margin-bottom: 10px;
}

.radius-container span {
  font-size: 13px;
  font-weight: 500;
}

/* STATS BOX */
.stats-box {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  font-size: 13px;
}

/* LOCATE BUTTON */
#locateBtn {
  margin-top: 12px;
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  background: #f3f3f3;
  border: 1px solid #ccc;
}

/* MOBILE OPTIMIZATION */
@media (max-width: 450px) {
  .filter-bar {
    width: 90%;
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
  }

  .filter-btn {
    font-size: 14px;
    padding: 9px;
  }

  #locateBtn {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  #split-container {
    flex-direction: column !important;
    height: auto !important;          /* allow natural scroll */
    min-height: 100vh !important;     /* ensure full screen usage */
    overflow: visible !important;     /* fix truncation */
  }

  #map-container {
    flex: none !important;
    width: 100% !important;
    height: 300px !important;         /* adjust map height for small screens */
  }

  #right-panel {
    flex: none !important;
    width: 100% !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  #divider {
    display: none !important;         /* hide divider in mobile */
  }
}

/* 
#left-panel button {
  padding: 10px;
  width: 100%;
  border: none;
  background: #4CAF50;
  color: white;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
}

#left-panel button:hover { background: #45a049; }

#left-panel label { font-size: 14px; }
#left-panel input[type=range] { width: 100%; } */

/* Right panel (charts & info) */


#right-panel {
  /* flex: 1; */
  flex:0 0 50%;
  background: #f9f9f9;
  border-left: 2px solid #ccc;
  display: flex;
  flex-direction: column;
  min-width: 250px;
  max-width: 100%;
}

.box {
  flex: 1;
  border-bottom: 1px solid #ddd;
  padding: 10px;
  overflow-y: auto;
}

.box:last-child { border-bottom: none; }

.box h3 {
  margin-top: 0;
  font-size: 1em;
  border-bottom: 1px solid #aaa;
  padding-bottom: 4px;
}
/* Force Google-style smaller My Location button */
#left-panel #locateBtn {
  width: auto !important;
  padding: 6px 10px;
  background: white;
  color: #4285f4;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.2s;
}

#left-panel #locateBtn:hover {
  background: #f0f0f0;
}


/* Charts */
canvas {
  width: 100% !important;
  height: auto !important; /* let height adjust automatically */
  max-height: 300px;     /*  prevent it from being too tall on large screens */
}
.chartContainer canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}
/* ====== Page content styling ====== */
.page-content {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  line-height: 1.6;
  font-size: 16px;
  color: #333;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
#commoditySelect option[disabled] {
  color: #999;
  background: #f8f8f8;
  font-style: italic;
}
#stats-container {
  display: flex;
  flex-direction: row;      /* force horizontal layout */
  justify-content: space-between; /* space out the two boxes */
  gap: 15px;
  flex-wrap: wrap;          /* allow wrapping on small screens */
}

#stats-container > div {
  flex: 1 1 45%;            /* each box takes ~45% of width */
  min-width: 220px;         /* don't shrink too much */
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 5px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  #stats-container {
    flex-direction: column;
  }
}


#agrowonChart {
  width: 100% !important;
  height: 250px !important;  /* comfortable for laptop view */
}
.page-content h1 { font-size: 32px; margin-bottom: 20px; font-weight: 700; color: #2c3e50; }
.page-content h2 { font-size: 28px; margin-bottom: 18px; font-weight: 600; }
.page-content h3 { font-size: 22px; margin-bottom: 12px; font-weight: 500; }

.page-content p, .page-content .page-text p { margin-bottom: 15px; }
.page-content strong { font-weight: 600; }
.page-content em { font-style: italic; }

.page-content ul, .page-content ol { margin-left: 30px; margin-bottom: 15px; }
.page-content li { margin-bottom: 8px; }

.page-content img { max-width: 100%; height: auto; display: block; margin: 15px auto; }
.page-content a { color: #007bff; text-decoration: none; }
.page-content a:hover { text-decoration: underline; }

/* ====== Mobile responsiveness ====== */
@media (max-width: 1024px) {
  #map-container { min-height: 350px; }
  #left-panel { width: 180px; }
}

@media (max-width: 768px) {
  main {
      flex-direction: column;
      overflow: visible;
  }
  #map-container {
      flex: none;
      height: 300px;
      margin-bottom: 10px;
  }
  #right-panel .box {
    width: 100%;
    overflow-x: hidden;       /* hide horizontal scroll */
    padding: 10px;
    box-sizing: border-box;
  }
  #map-controls {
    position: absolute;
    top: 50px;
    left: 10px;
    width: auto;          /* fits content */
    max-width: 200px;     /* prevent it from being too wide */
    background: rgba(255,255,255,0.95);
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 1500;
  }
  
  #left-panel {
      width: 100%;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: space-between;
  }
  #left-panel button {
      flex: 1 1 48%;
      margin-bottom: 6px;
  }
}

@media (max-width: 480px) {
  #map-container { height: 250px; }
  #left-panel { gap: 8px; padding: 10px; }
  #map-controls { font-size: 0.8em; padding: 6px 8px; }
  .page-content { margin: 15px; padding: 10px; font-size: 14px; }
  .page-content h1 { font-size: 24px; }
  .page-content h2 { font-size: 20px; }
  .page-content h3 { font-size: 18px; }
}

/* Map controls toggle hidden state */
#map-controls.collapsed {
  transform: translateX(-240px);
  opacity: 0;
}

/* Toggle button styling */
#toggle-map-controls {
  position: absolute;
  top: 5px;
  left: 10px;
  z-index: 1100;
  padding: 8px 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  z-index: 2000;
}

#toggle-map-controls:hover { background: #45a049; }
/* ====== About Us Page ====== */
.about-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  line-height: 1.6;
  font-size: 16px;
  color: #333;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.about-container h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #2d6a4f;
}

.about-container ul {
  margin-left: 20px;
  list-style: disc;
}

.about-container li {
  margin-bottom: 8px;
}

/* ====== Mobile responsiveness for About Us ====== */
@media (max-width: 768px) {
  .about-container {
    margin: 20px 15px;
    padding: 15px;
    font-size: 15px;
  }
  .about-container h2 {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .about-container {
    margin: 15px 10px;
    padding: 12px;
    font-size: 14px;
  }
  .about-container h2 {
    font-size: 20px;
  }
  .about-container ul {
    margin-left: 15px;
  }
}

.card {
  max-width: 900px;
  margin: auto;
  word-wrap: break-word;
  white-space: normal;
}

.card-body h1,
.card-body h2,
.card-body h3 {
  margin-top: 1rem;
  font-weight: 600;
}

.card-body p {
  margin-bottom: 1rem;
  text-align: justify;
}

@media (max-width: 768px) {
  .card {
    max-width: 100%;
    margin: 10px;
    padding: 10px;
  }

  .card-body {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .spinner-border {
    width: 2rem;
    height: 2rem;
  }
}
 