/* Apply formatting to all */
body, input, button, label, h1, h2, h3, h4, h5, h6, p, div, span {
  font-family: Verdana, Geneva, Tahoma, sans-serif; /* Verdana first then fallback fonts*/
}
 
/* Full-width elements */
.active-adjust {
  background: #fff !important;
  color: #222 !important;
  border: 2px solid #222 !important;
}

.action-btn-group {
  position: absolute;

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: calc(var(--bottom-bar-height) + var(--separator-height));
    width: var(--map-sidebar-width);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: saturate(100%);
    display: none;
    z-index: 4000;
    color: #fff;
  }
  .sidebar.active {
    display: block;
  }

  .sidebar > div {
    font-family: Verdana, sans-serif;
    position: absolute;
    top: 0;
    left: 0;
    right: 8px;
    bottom: 0;
    overflow: auto;
    padding: 16px 14px 20px 14px;
    color: #fff;
  }
  overflow-y: auto;
  box-sizing: border-box;
  font-family: Verdana, sans-serif;
  backdrop-filter: saturate(140%) blur(2px);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.45);
}

/* ==================== AUTHENTICATION STYLES ==================== */
.message {
  color: red;
  margin-bottom: 10px;
  font-size: 16px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 10px;
  border-radius: 5px;
  z-index: 1003;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.form-container {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 400px;
  max-width: 90vw;
}

.form-section {
  display: none;
}

.form-section.active {
  display: block;
}
.new-user-info {
  background-color: #f0f8ff;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.understand-button {
  background-color: #4caf50;
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 15px;
}

.understand-button:hover {
  background-color: #45a049;
}

.error-message {
  background-color: #ffebee;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* ==================== FORM ELEMENTS ==================== */
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

.button-group {
  margin-top: 15px;
}

.button-group input[type="submit"] {
  padding: 12px 25px;
  margin-right: 10px;
  cursor: pointer;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
}

.button-group input[type="submit"]:hover {
  background: #45a049;
}

/* For latitude/longitude fields, keep max-width if needed */
.formField.latlng {
  max-width: 120px;
}

/* ==================== USER INFO PANEL ==================== */
.user-info {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 1002;
  background: white;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logout-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 5px;
}

.logout-btn:hover {
  background: #c82333;
}

/* ==================== CUSTOM MARKERS ==================== */
.point-marker {
  background: #fff;
  border: 2px solid #333;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-x-marker {
  z-index: 9999 !important;
  position: relative;
}

.inverted {
  filter: invert(1) brightness(0.9);
  box-shadow: 0 0 0 2px #333 inset;
}

/* ==================== BOTTOM BAR STYLES ==================== */
:root {
  --bottom-bar-height: 60px;
  --separator-height: 3px;
}
:root {
  --map-sidebar-width: 320px;
}

/* Bottom gray bar */
#bottomBar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bottom-bar-height);
  background: #777;
  border: 1.5px solid #111;
  display: flex;
  align-items: stretch; /* make children fill full height */
  justify-content: flex-start; /* children will expand to fill */
  z-index: 5000;
  border-bottom: 2px solid #111;
}
/* 10px separator line between subbar row and bottom bar */
#barSeparator {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--bottom-bar-height);
  height: var(--separator-height);
  background: #111;
  z-index: 5050;
}
.mainBarBtn {
  flex: 1 1 20%; /* 5 equal segments */
  height: 100%; /* fill bar height */
  display: flex; /* center label */
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid #111;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.mainBarBtn.active {
  background: #111;
  color: #fff;
}

/* ==================== SUBBAR STYLES ==================== */
/* Subbar container */
.subbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-bar-height) + var(--separator-height));
  height: var(--bottom-bar-height);
  background: #777;
  color: #fff;
  display: none;
  z-index: 5100;
}
/* Rows inside subbars */
.subbar .subbarRow {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
}
/* Buttons inside subbars */
.subbar .subbarBtn {
  flex: 1 1 20%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid #111;
  border-bottom: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

/* Active + pressed states */
.subbar .subbarBtn:active,
.subbar .subbarBtn.active {
  opacity: 0.8;
  background: #111;
}

/* Optional spacer elements */
.subbar .subbarSpacer {
  flex: 1 1 20%;
  height: 100%;
}

/* ==================== SIDE BAR STYLES ==================== */
#map {
  height: 100vh;
  width: 100vw;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Universal sidebar styles for all sidebars */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: calc(var(--bottom-bar-height) + var(--separator-height));
  width: var(--map-sidebar-width);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(100%);
  display: none;
  z-index: 4000;
  color: #fff;
  overflow-y: auto; /* Make sidebar scrollable */
  max-height: 100vh;
}
.sidebar.active {
  display: block;
}

.sidebar > div {
  font-family: Verdana, sans-serif;
  position: absolute;
  top: 0;
  left: 0;
  right: 8px;
  bottom: 0;
  overflow: auto;
  padding: 16px 14px 20px 14px;
  color: #fff;
}

.hourlyForecastTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.hourlyForecastTable thead {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  color: #000;
}

/* Map sidebar (left), black with 50% opacity and resizable width */
#mapSidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: calc(var(--bottom-bar-height) + var(--separator-height));
  width: var(--map-sidebar-width);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(100%);
  display: none; /* hidden until Map clicked */
  z-index: 4000;
  color: #fff;
}
#mapSidebar.active {
  display: block;
}

#mapSidebarContent {
  font-family: Verdana, sans-serif;
  position: absolute;
  top: 0;
  left: 0;
  right: 8px;
  bottom: 0;
  overflow: auto;
  padding: 16px 14px 20px 14px;
  color: #fff;
}

/* Account sidebar (mirrors Map sidebar behavior) */
#accountSidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: calc(var(--bottom-bar-height) + var(--separator-height));
  width: var(--map-sidebar-width);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(100%);
  display: none; /* hidden until Map clicked */
  z-index: 4000;
  color: #fff;
}

#accountSidebar.active {
  display: block;
}

#accountSidebarContent {
  padding: 16px;
  font-family: Verdana, sans-serif;
}

#headoutTimeSidebar input[type="number"] {
  width: 80px;
  min-width: 80px;
  box-sizing: border-box;
  margin-left: 12px;
}

.accountInfo {
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
}

/* Vertical list of options */
.vlist {
  display: block;
}

.optionRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  background: transparent;
  border: none;
  color: #fff;
}
.sidebarMenuHeader {
  font-weight: bold;
  font-size: 1.4rem;
  margin: 12px 0 8px 0;
  cursor: pointer;
  user-select: none;
}
.sidebarMenuBold {
  font-weight: bold;
  font-size: 1rem;
  margin: 12px 0 8px 0;
  cursor: pointer;
  user-select: none;
}
.optionRow input {
  accent-color: #4aa3ff;
}

.leaflet-container {
  background: #000 !important;
}

/* Hide Leaflet’s default layers control (we use the sidebar) */
.leaflet-control-layers {
  display: none !important;
}

/* ==================== ADD FORM PANEL ==================== */

.formField {
  font-size: 16px;
  height: 32px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #222;
  color: #fff;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
}

/* Consolidated grid layout for all form panels */
.addFormGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

@media (max-width: 500px) {
  .addFormGrid {
    grid-template-columns: 1fr;
  }
}

/* Consolidated panel container styles */
#addFormPanel,
#pinFormPanel,
#linezFormPanel,
#polygonFormPanel {
  z-index: 5200;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(
    var(--bottom-bar-height) + var(--separator-height) +
      var(--bottom-bar-height)
  );
  background: rgba(0, 0, 0, 0.95);
  color: #fff;
  padding: 10px 14px 14px 14px;
  border-top: 1px solid #111;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.45);
  max-height: 42vh;
  overflow-y: auto;
  box-sizing: border-box;
  font-family: Verdana, sans-serif;
  backdrop-filter: saturate(140%) blur(2px);
}

#addFormPanel.huntLogPanelActive {
  top: 0 !important;
  bottom: calc(var(--bottom-bar-height) + var(--separator-height) + var(--bottom-bar-height)) !important;
  height: auto !important;
  max-height: none !important;
  border-top: none !important;
  max-width: 100vw !important;
  overflow-x: auto !important;
}

/* Consolidated label styles for all grids */
.addFormGrid label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 16px;
  margin-bottom: 4px;
}

.addFormGrid label,
.addFormGrid input,
.addFormGrid select,
.addFormGrid textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Consolidated input/select/textarea styles for all panels */
#addFormPanel input,
#addFormPanel select,
#addFormPanel textarea,
#pinFormPanel input,
#pinFormPanel select,
#pinFormPanel textarea,
#linezFormPanel input,
#linezFormPanel select,
#linezFormPanel textarea,
#polygonFormPanel input,
#polygonFormPanel select,
#polygonFormPanel textarea {
  height: 32px;
  font-size: 16px;
  padding: 4px 8px;
}

/* Consolidated textarea resize style for all panels */
#addFormPanel textarea,
#pinFormPanel textarea,
#linezFormPanel textarea,
#polygonFormPanel textarea {
  resize: none;
}
