

/* ===== Hide mobile specials on desktop ===== */

/* On desktop, never show mobile-menu triggers */
.mobile-menu, .mobile-only {
  display: none !important;
}

/* ===== Layer panel (Leaflet control, top-right) ===== */

.layer-panel{
  background:#fff;
  padding:10px 12px;
  border-radius:8px;
  box-shadow:0 2px 6px rgba(0,0,0,.2);
  font:13px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial;
  min-width: 220px;
}
.layer-header{
  font-weight:700;
  margin-bottom:6px;
}
.layer-body{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.layer-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.layer-label{
  color:#374151;
}

/* ===== Generic modal overlay ===== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 5000;
}

.modal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 16px;
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
           Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
           sans-serif;
}

.modal-header {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: bold;
}

/* ===== Remote modal ===== */

#remoteModal .modal {
  width: 380px;                /* slightly wider to match content */
  max-height: 70vh;
  padding: 20px;
  border-radius: 10px;
}

#remoteModal .modal-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.remote-cat {
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: bold;
  color: #444;
}

.remote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.remote-row .layer-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.import-btn {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

#remoteModal .modal-close {
  margin-top: 12px;
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #f3f4f6;
  cursor: pointer;
  text-align: center;
}

#remoteModal .modal-close:hover {
  background: #e5e7eb;
}


/* ===== Login modal ===== */

#loginModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#loginBox {
  background: #ffffff;
  padding: 20px 24px;
  border-radius: 10px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.25);
  width: 320px;
  font-family: system-ui, sans-serif;
  position: relative;
}

#loginBox h2 {
  margin-top: 0;
  font-size: 20px;
  margin-bottom: 16px;
}

.login-input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.login-btn {
  width: 100%;
  padding: 10px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}

.login-btn:hover {
  background: #145ca8;
}

#loginCancel {
  margin-top: 8px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: #ddd;
  cursor: pointer;
}

#loginCancel:hover {
  background: #ccc;
}

#loginCloseX {
  position: absolute;
  right: 16px;
  top: 12px;
  cursor: pointer;
  font-size: 18px;
}

/* ===== About Modal (desktop) ===== */

#aboutModal .modal {
  width: 360px;               /* a bit wider for text */
  max-height: 70vh;
  padding: 20px;
  border-radius: 10px;
}

#aboutModal .modal-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

#aboutModal .modal-body {
  font-size: 15px;
  line-height: 1.45;
}

#aboutModal .modal-disclaimer {
  font-size: 12px;
  color: #666;
  margin-top: 14px;
  line-height: 1.4;
}

/* Consistent stretched Close button */
#aboutModal .modal-close {
  margin-top: 16px;
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid #ccc;
  cursor: pointer;
}

#aboutModal .modal-close:hover {
  background: #e5e7eb;
}


/* ===== Layer Control (desktop) ===== */

.layer-panel {
  background: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  font: 13px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial;
  min-width: 220px;
  max-width: 280px; /* prevent overflow into map */
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.layer-label {
  color: #374151;
  font-size: 13px;
}

.expand-btn {
  margin-left: auto;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
  padding: 2px 4px;
  line-height: 1;
  opacity: 0.7;
}

.expand-btn:hover {
  opacity: 1;
}

/* Filters under marker-only rows */
.layer-filters {
  padding-left: 28px;
  padding-top: 4px;
  padding-bottom: 8px;
  display: none;
  font-size: 12px;
}

.layer-filters input,
.layer-filters select {
  width: 15ch;
  margin-bottom: 6px;
  box-sizing: border-box;
  display: block;
  font-size: 12px;
}


  /* Base: let the panel animate a bit */
  #layerControl {
    transition: max-height 0.25s ease, opacity 0.25s ease;
    overflow: hidden;
  }

  /* Make header look clickable */
  #layerControl .layer-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
  }

  /* Small icon on the right side of header */
  .layer-toggle-icon {
    font-size: 14px;
    opacity: 0.8;
    margin-left: 6px;
  }

  /* COLLAPSED STATE:
     - hide body
     - make the whole thing compact so it looks like a small capsule
  */
  #layerControl.collapsed .layer-body {
    display: none;
  }

  #layerControl.collapsed .layer-panel {
    padding: 4px 8px;
  }

  /* EXPANDED STATE: show body normally */
  #layerControl.expanded .layer-body {
    display: block;
  }



/* ===== Top toolbar styling ===== */

.map-toolbar{
  position: relative !important;
  z-index: 100000 !important;
  display:flex;
  align-items:center;
  gap:.5rem;
  padding:0;
  background:none;
  border:none;
  border-radius:0;
  box-shadow: none;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size:14px;
  line-height:1.2;
  width: fit-content;
  max-width: 100%;
  margin:0;
}

.map-toolbar .btn,
.map-toolbar .file-btn{
  appearance:none;
  border:1px solid #d1d5db;
  background:#f8fafc;
  color:#111827;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.45rem .7rem;
  border-radius:8px;
  cursor:pointer;
  white-space:nowrap;
  transition: background .15s, border-color .15s, transform .03s;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight:600;
  text-decoration:none;
}

.map-toolbar .file-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: inherit !important;
  line-height: inherit !important;
  gap: 6px;
}

.map-toolbar .file-btn input[type="file"] {
  display: none !important;
  font-size: inherit !important;
}

.map-toolbar .btn:hover,
.map-toolbar .file-btn:hover{
  background:#eef2ff;
  border-color:#c7d2fe;
}

.map-toolbar .btn:active,
.map-toolbar .file-btn:active{
  transform: translateY(1px);
}

.map-toolbar {
  flex: 0 0 auto;
}

.user-status {
  margin-left: 12px;
  font-size: 14px;
  color: #333;
}


/* ===== Page layout & map sizing ===== */

html, body {
  height: 100%;
  margin: 0;
}

.layout {
  display: flex;
  flex-direction: column;
  height: 100%;
}


#map {
  flex: 1 1 auto;
}


.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.94);
  color: #f9fafb;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 300000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
