/* assets/css/style.css */
/* assets/css/style.css */

/* Basic typography */
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin: 0;
  height: 100%;
  overflow: hidden;
}

/* Ensure full height container layout */
html, body, .container-fluid, .row.flex-nowrap, main, aside {
  height: 100%;
}

/* Sidebar scrolling */
aside {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

/* Floating buttons */
#floatingButtons {
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.fade-btn {
  width: 52px;
  height: 52px;
  border-radius: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, opacity .18s ease;
  opacity: .92;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  touch-action: manipulation;
  user-select: none;
}
.fade-btn:hover, .fade-btn:focus {
  transform: scale(1.06);
  opacity: 1;
  outline: none;
}

/* Live badge */
#liveBadge {
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Map container */
#map {
  width: 100%;
  height: 520px;
}

/* Canvas full responsiveness */
canvas {
  max-width: 100% !important;
  display: block;
}

/* Form inputs and buttons - touch target sizing */
button, select, input, textarea {
  min-height: 44px;
  font-size: 1rem;
}

.form-label {
  font-size: 1rem;
}

.form-select {
  font-size: 1rem;
  padding: 0.4rem 0.75rem;
}

/* Card body scroll overflow for charts on small screens */
.card-body {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive iframe container for GEE app */
#iframe-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
}
#iframe-responsive iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Small screens adjustments */
@media (max-width: 767px) {
  #map {
    height: 360px;
  }
  .fade-btn {
    width: 46px;
    height: 46px;
  }
  aside {
    height: auto;
    max-height: 300px;
  }
  main {
    height: auto;
  }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991px) {
  #map {
    height: 480px;
  }
}

/* Large desktops & wide screens */
@media (min-width: 1200px) {
  #map {
    height: 600px;
  }
  aside {
    max-width: 280px;
  }
}

/* Modals fullscreen on small screens */
.modal-fullscreen-sm-down {
  max-width: 100vw;
  margin: 0;
}
/* Ensure charts fill their containers */
.card-body > canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
  display: block;
}

/* Map container: responsive height */
#map {
  width: 100%;
  height: 100%;
  min-height: 360px;
}

/* GEE iframe container: optimized height */
.gee-iframe-container {
  height: 520px;
  min-height: 520px;
  position: relative;
}

/* On mobile, reduce GEE height slightly */
@media (max-width: 991.98px) {
  .gee-iframe-container {
    height: 480px;
    min-height: 480px;
  }
  #map {
    min-height: 320px;
  }
}

/* Floating buttons */
#floatingButtons { z-index: 9999; }
.fade-btn {
  width: 52px;
  height: 52px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, opacity 0.18s ease;
  opacity: 0.92;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.fade-btn:hover {
  transform: scale(1.06);
  opacity: 1;
}

/* Live badge */
#liveBadge {
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
}