/* =========================
   DASHBOARD-ONLY STYLES
   Loaded only on dashboard.html
   ========================= */

/* Map host */
.leaflet-container { height: 100%; width: 100%; }
#map-container{ background: transparent; }

/* Autocomplete */
.autocomplete-dropdown {
  position:absolute; top:100%; left:0; right:0; background:#fff;
  border:1px solid #d1d5db; border-top:none; border-radius:0 0 .375rem .375rem;
  box-shadow:0 4px 6px -1px rgba(0,0,0,.1); z-index:1000; max-height:200px; overflow-y:auto;
}
.autocomplete-item { padding:.5rem 1rem; cursor:pointer; border-bottom:1px solid #f3f4f6; }
.autocomplete-item:hover { background:#f3f4f6; }
.autocomplete-item:last-child { border-bottom:none; }
.autocomplete-item.active { background:#eef2ff; color:#111827; }
.autocomplete-item:hover, .autocomplete-item.active { background:#eef2ff; }

/* Map legend, status pill, clear buttons */
.blue-pill {
  position:absolute; top:10px; left:50%; transform:translateX(-50%);
  background:rgba(59,130,246,.9); color:#fff; padding:8px 16px; border-radius:20px;
  font-size:14px; z-index:1000; pointer-events:auto;
}
.map-legend {
  position:absolute; top:10px; right:10px; background:#fff; padding:10px; border-radius:5px;
  box-shadow:0 2px 4px rgba(0,0,0,.2); z-index:1000; font-size:12px;
}
.clear-btn {
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  background:#ef4444; color:#fff; border:none; border-radius:50%;
  width:20px; height:20px; font-size:12px; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.clear-btn:hover { background:#dc2626; }

/* Saved route list */
.saved-route-item { cursor:pointer; transition:background-color .2s; }
.saved-route-item:hover { background: linear-gradient(135deg, #dbf3ef 0%, #b0f0f0 100%); }
.delete-btn { opacity:.6; transition:opacity .2s; }
.delete-btn:hover { opacity:1; color:#ef4444; }

/* Dashboard background image */
#dashboard{
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
#dashboard::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/assets/img/coolbackgrounds-fractalize-ranger_made.png") center / cover no-repeat;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
}
#dashboard header,
#dashboard > .max-w-7xl,
#dashboard .max-w-7xl,
#dashboard > * {
  position: relative;
  z-index: 1;
}
/* make white cards slightly translucent on the dashboard */
#dashboard .bg-white{
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(2px);
}

/* Card pop */
.panel-card{
  position: relative;
  border-radius: 0.75rem;
  border: 4px solid rgba(201, 90, 10, 0.06);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  will-change: transform;
  overflow: hidden;
}
.panel-card:hover{
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 30px rgba(2,6,23,0.12);
  border-color: rgba(135, 68, 24, 0.45);
}
@media (prefers-reduced-motion: reduce){
  .panel-card{ transition: box-shadow .2s ease, border-color .2s ease; }
  .panel-card:hover{ transform:none; }
}

/* Segmented control (Coords / Address) */
.seg{
  --seg-x:0%;
  position:relative; display:inline-flex; align-items:center; gap:.25rem;
  padding:4px; border-radius:9999px;
  background: linear-gradient(180deg, #bf4dbf, #e4b9a9);
  border:1px solid #cbd5e1;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.05);
}
.seg .seg-tab{
  position:relative; z-index:1;
  min-width:92px; padding:.38rem .9rem; border-radius:9999px;
  font-weight:700; font-size:.9rem; letter-spacing:.2px;
  background: transparent; border:0; cursor:pointer;
  transition: color .18s ease, transform .18s ease, filter .18s ease;
  color:#334155;
}
.seg .seg-tab:hover{ transform: translateY(-1px); filter: brightness(1.02); }
.seg .seg-tab:active{ transform: translateY(0); }
.seg .seg-indicator{
  position:absolute; z-index:0; inset:4px auto 4px 4px;
  width: calc(50% - 4px); border-radius:9999px;
  background: linear-gradient(135deg, #60a5fa, #4f46e5);
  box-shadow: 0 6px 16px rgba(0,0,0,.18), inset 0 0 8px rgba(255,255,255,.14);
  transform: translateX(var(--seg-x));
  transition: transform .25s ease, background .25s ease;
}
.seg[data-active="coords"]{ --seg-x: 0%; }
.seg[data-active="coords"] #mode-coords{ color:#fff; text-shadow:0 1px 0 rgba(0,0,0,.25); }
.seg[data-active="coords"] #mode-address{ color:#334155; }
.seg[data-active="address"]{ --seg-x: calc(100% + 4px); }
.seg[data-active="address"] #mode-address{ color:#fff; text-shadow:0 1px 0 rgba(0,0,0,.25); }
.seg[data-active="address"] #mode-coords{ color:#334155; }
@media (prefers-reduced-motion: reduce){
  .seg .seg-indicator{ transition:none; }
  .seg .seg-tab{ transition:none; }
}
/* ===== Coords buttons (Start/End pick) — single source of truth ===== */
.coords-btn{
  --c-start: var(--wp-grad-start);
  --c-end:   var(--wp-grad-end);

  /* Inverted/hover palette */
  --inv-bg:  #f5ebe0;  /* tan */
  --inv-txt: #b91c1c;  /* red-700 text */
  --inv-brd: #dc2626;  /* red-600 border */

  appearance:none; -webkit-appearance:none;
  display:inline-flex; align-items:center; justify-content:center;
  padding:.375rem .75rem;
  border-radius:9999px;
  font-weight:600; font-size:.875rem;
  color:#fff;
  background-image:linear-gradient(135deg,var(--c-start),var(--c-end));
  border:1px solid rgba(255,255,255,.35);
  box-shadow:0 4px 10px rgba(0,0,0,.12);
  transition:
    transform .15s ease,
    box-shadow .2s ease,
    background .25s ease,
    color .25s ease,
    border-color .25s ease,
    filter .2s ease;
}

/* Hover → invert to tan background, red text+outline (only when NOT active) */
.coords-btn:hover:not(.is-active){
  background: var(--inv-bg);
  color: var(--inv-txt);
  border-color: var(--inv-brd);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  transform: translateY(-1px);
  filter: none;
}

/* Press */
.coords-btn:active{
  transform:translateY(1px);
  box-shadow:0 2px 6px rgba(0,0,0,.2), inset 0 0 6px rgba(255,255,255,.12);
}

/* Focus ring */
.coords-btn:focus-visible{
  outline:0;
  box-shadow:0 0 0 3px rgba(79,70,229,.28), 0 6px 16px rgba(0,0,0,.18);
}

/* “Pick mode on” look */
.coords-btn.is-active{
  color:#fff;
  background-image:linear-gradient(135deg,var(--c-end),var(--c-start)); /* reversed */
  border-color: rgba(255,255,255,.35);
  box-shadow:0 6px 14px rgba(0,0,0,.18), inset 0 0 8px rgba(255,255,255,.10);
}

/* Smaller on phones */
@media (max-width:767.98px){
  .coords-btn{ font-size:12px; padding:.3rem .6rem; }
}

/* Reset All variant */
.btn-reset{
  color:#fff;
  background-image:linear-gradient(180deg, #fca5a5, #ef4444);
  border-color:#fecaca;
  text-shadow:0 1px 0 rgba(0,0,0,.25);
  box-shadow: 0 6px 16px rgba(0,0,0,.2), inset 0 0 8px rgba(255,255,255,.14);
}
.btn-reset:hover{
  transform: translateY(-2px) scale(1.02);
  filter: saturate(1.02) brightness(1.02);
  box-shadow: 0 12px 26px rgba(0,0,0,.22), inset 0 0 10px rgba(255,255,255,.18);
}
.btn-reset:active{
  transform: translateY(1px) scale(.985);
  color:#111827;
  background-image:linear-gradient(180deg, #fff7ed, #f1f5f9);
  border-color:#f5d5b3;
  text-shadow:none;
  box-shadow: 0 4px 12px rgba(0,0,0,.16), inset 0 0 6px rgba(255,255,255,.18);
}

/* Saved Routes overlay/window */
.saved-overlay{
  position:fixed; inset:0;
  background:rgba(17,24,39,.35);
  backdrop-filter:saturate(110%) blur(1.5px);
  z-index:5000;
  display:none;
}
.saved-panel{
  position:absolute; top:var(--y, 80px); left:var(--x, 80px);
  width:min(380px, 92vw); max-height:min(78vh, 720px);
  background:#fff; border-radius:14px; box-shadow:0 20px 40px rgba(0,0,0,.25);
  display:flex; flex-direction:column; overflow:hidden;
}
.saved-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:.5rem; padding:.75rem 1rem;
  background:linear-gradient(135deg,#eef2ff,#e0e7ff);
  border-bottom:1px solid rgba(0,0,0,.06);
  cursor:move; user-select:none;
}
.saved-head h3{ margin:0; font-weight:700; font-size:1rem; color:#111827; }
.saved-head-actions{ display:flex; gap:.25rem; }
.saved-btn{
  padding:.25rem .5rem; border-radius:8px; border:1px solid rgba(0,0,0,.08);
  background:#fff; font-weight:600;
}
.saved-btn:hover{ background:#f3f4f6; }
.saved-list{ overflow:auto; padding:.75rem; }
.saved-list::-webkit-scrollbar{ width:12px; }
.saved-list::-webkit-scrollbar-thumb{ background:#4f46e5; border-radius:8px; }
.saved-list::-webkit-scrollbar-track{ background:#e5e7eb; border-radius:8px; }
.saved-list{ scrollbar-color:#4f46e5 #e5e7eb; scrollbar-width:thin; }

/* Mobile: present as full-screen drawer */
@media (max-width: 1023px){
  .saved-overlay{ background:rgba(0,0,0,.35); }
  .saved-panel{ top:0 !important; left:0 !important; width:100vw; max-height:100vh; border-radius:0; }
  .saved-head{ cursor:default; }
}

/* Stacking order for dashboard modals */
#saved-overlay { z-index: 50; }
#edit-overlay  { z-index: 60; }
#delete-overlay{ z-index: 70; }
#edit-overlay.no-blur { backdrop-filter: none !important; }

/* Pill buttons used in the calculator (Save / View Saved) */
.btn-pill{
  --btn-c1:#3b82f6; --btn-c2:#4f46e5;
  position: relative;
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  padding:.65rem 1.1rem; border-radius:9999px; font-weight:700; color:#fff;
  background-image:linear-gradient(135deg,var(--btn-c1),var(--btn-c2));
  box-shadow: 0 8px 18px rgba(79,70,229,.35), 0 2px 6px rgba(0,0,0,.15);
  transform:translateY(0) scale(1);
  transition:transform .17s ease, box-shadow .17s ease, background-image .17s ease, filter .17s ease;
  border:0;
  text-align:center;  /* centers text perfectly */
}
.btn-pill.has-badge{ padding-right:2.5rem; }
.btn-pill:hover{
  background-image:linear-gradient(135deg,var(--btn-c2),var(--btn-c1));
  transform:translateY(-1px) scale(1.03);
  box-shadow: 0 14px 28px rgba(79,70,229,.45), 0 4px 10px rgba(0,0,0,.18);
  filter:saturate(1.05);
}
.btn-pill:active{ transform:translateY(0) scale(.98); }
.btn-pill:focus-visible{
  outline:2px solid transparent;
  box-shadow: 0 0 0 3px rgba(59,130,246,.5), 0 8px 18px rgba(79,70,229,.35);
}
.btn-pill i{ font-size:.95rem; }
.count-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:1.75rem; height:1.25rem; padding:0 .5rem;
  border-radius:9999px; font-weight:700; font-size:.75rem;
  background:rgba(255,255,255,.22);
  border:1px solid rgba(255,255,255,.35);
  color:#fff;
}
@media (prefers-reduced-motion: reduce){
  .btn-pill{ transition:none; }
  .btn-pill:hover{ transform:none; }
}
/* ==== Tiny tooltips (hover + focus) ==== */
:root{
  --tip-bg:#c3c9d5;   /* bubble background */
  --tip-fg:#121010;   /* text color */
  --tip-z:100000;     /* very high; above Leaflet panes */
}

.has-tip{ position:relative; }

/* hidden by default */
.has-tip[data-tip]::after,
.has-tip[data-tip]::before{
  position:absolute;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease, transform .15s ease;
  z-index:var(--tip-z);
}

/* bubble */
.has-tip[data-tip]::after{
  content:attr(data-tip);
  background:var(--tip-bg);
  color:var(--tip-fg);
  padding:.5rem .65rem;
  border-radius:.5rem;
  box-shadow:0 10px 24px rgba(0,0,0,.24);
  font-size:.75rem;
  line-height:1.25;
  text-align:left;
  white-space:normal;
  width: 500px;
  max-width:560px;               /* wide so text runs horizontally */
}

/* arrow */
.has-tip[data-tip]::before{
  content:"";
  border:6px solid transparent;
}

/* default placement: BELOW, centered */
.has-tip[data-tip]::after{
  top:calc(100% + 10px);
  left:50%;
  transform:translateX(-50%) translateY(2px);
}
.has-tip[data-tip]::before{
  top:calc(100% + 4px);
  left:50%;
  transform:translateX(-50%) translateY(2px);
  border-bottom-color:var(--tip-bg);
}

/* RIGHT placement: from top-right edge, text flows right */
.has-tip[data-tip][data-tip-pos="right"]::after{
  top:0;
  left:calc(100% + 10px);
  transform:none;
}
.has-tip[data-tip][data-tip-pos="right"]::before{
  top:8px;
  left:100%;
  transform:none;
  border-left-color:var(--tip-bg);
}

/* reveal (below/top versions) */
.has-tip:not([data-tip-pos="right"]):hover::after,
.has-tip:not([data-tip-pos="right"]):hover::before,
.has-tip:not([data-tip-pos="right"]):focus::after,
.has-tip:not([data-tip-pos="right"]):focus::before,
.has-tip:not([data-tip-pos="right"]):focus-visible::after,
.has-tip:not([data-tip-pos="right"]):focus-visible::before{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* reveal (right version — no transform) */
.has-tip[data-tip-pos="right"]:hover::after,
.has-tip[data-tip-pos="right"]:hover::before,
.has-tip[data-tip-pos="right"]:focus::after,
.has-tip[data-tip-pos="right"]:focus::before,
.has-tip[data-tip-pos="right"]:focus-visible::after,
.has-tip[data-tip-pos="right"]:focus-visible::before{
  opacity:1;
}

/* let tooltips escape and sit above the map */
#calc-card{ position:relative; z-index:1001; overflow:visible; }
#map-container{ position:relative; z-index:0; }


/* Small input look to match Tailwind in your card */
.wp-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
}
.wp-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Map power-budget overlay (Leaflet control) */
.map-budget{
  background: rgba(255,255,255,.95);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: .6rem .75rem;
  font-size: 12px;
  color: #111827;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.map-budget .pb-row{ display:flex; gap:.5rem; align-items:baseline; }
.map-budget .pb-key{ color:#6b7280; }
.map-budget .pb-val{ font-weight:700; }

#map-container { z-index: 0; }


/* Rich Map Marker Tooltip Styles */

.rich-marker-tooltip {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 2px solid #4f46e5 !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  padding: 0 !important;
  max-width: 280px !important; /* REDUCED even more */
  min-width: 280px !important;
  width: 280px !important; /* FIXED width to prevent expansion */
  box-sizing: border-box !important;
}

.rich-marker-tooltip:before {
  border-top-color: #4f46e5 !important;
  border-width: 8px 8px 0 8px !important;
}

.marker-tooltip-content {
  padding: 10px 12px; /* REDUCED padding */
  color: #1f2937;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* PREVENT any overflow */
}

.tooltip-header {
  color: #4f46e5;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  gap: 6px; /* REDUCED gap */
  width: 100%;
  box-sizing: border-box;
}

.tooltip-row:last-child {
  margin-bottom: 0;
}

.tooltip-row strong {
  color: #6b7280;
  font-weight: 600;
  font-size: 10px; /* REDUCED font size */
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  min-width: 50px; /* REDUCED min width */
  max-width: 90px; /* FIXED max width */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tooltip-row span:not(strong) {
  color: #111827;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  flex-shrink: 1;
  flex-grow: 1;
  max-width: 140px; /* REDUCED max width */
  font-size: 11px; /* REDUCED font size */
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
}

/* Special styling for location text */
.location-text {
  font-size: 10px !important;
  line-height: 1.2 !important;
  max-width: 130px !important;
  -webkit-line-clamp: 2 !important; /* Allow 2 lines for addresses */
  text-align: left !important; /* Left align for readability */
}

.tooltip-notes {
  flex-direction: column;
  align-items: flex-start;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f3f4f6;
  width: 100%;
}

.tooltip-notes em {
  color: #6b7280;
  font-style: italic;
  font-size: 10px;
  line-height: 1.3;
  margin-top: 2px;
  width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Special styling for PASS/FAIL status */
.tooltip-row span[style*="color:#059669"],
.tooltip-row span[style*="color:#dc2626"] {
  font-weight: 700;
  font-size: 11px;
  max-width: 100px !important;
}

/* Hover effect for entire tooltip */
.rich-marker-tooltip:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.2s ease;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .rich-marker-tooltip {
    max-width: 240px !important; /* INCREASED from 200px */
    min-width: 220px !important; /* INCREASED from 180px */
    width: 240px !important; /* INCREASED from 200px */
    font-size: 11px !important;
  }
  
  .tooltip-header {
    font-size: 12px;
  }
  
  .marker-tooltip-content {
    padding: 8px 10px;
  }
  
 .tooltip-row strong {
  color: #6b7280;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  min-width: 65px; /* INCREASED from 50px */
  max-width: 65px; /* INCREASED from 50px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
  
  .tooltip-row span:not(strong) {
    font-size: 10px;
    max-width: 110px;
  }
  
  .location-text {
    font-size: 9px !important;
    max-width: 105px !important;
  }

  /* ADD THESE NEW RULES AT THE END: */
  .pb-floating-widget {
    width: 90vw !important;
    max-width: 320px !important;
  }
  
  /* Override for minimized state on mobile */
  .pb-floating-widget.is-minimized {
    width: auto !important;
    max-width: fit-content !important;
    min-width: 120px !important;
  }
}


* Inline span map markers */
.inline-span-marker {
  background: #fbbf24; /* Amber/yellow */
  color: #111827;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  cursor: move;
}

.inline-span-marker:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}

/* Line segment styling for multi-segment route */
.route-segment {
  transition: stroke-width 0.2s;
}

.route-segment:hover {
  stroke-width: 5;
}


/* 3D Add Span button */
#add-span-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background-image: linear-gradient(135deg, #86efac, #16a34a);  /* Light green to darker green */
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 12px rgba(34, 197, 94, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(0);
  transition: 
    transform 0.15s ease, 
    box-shadow 0.2s ease, 
    background-image 0.2s ease;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}


/* Hover state - gradient and strong lift */
#add-span-btn:hover {
  background-image: linear-gradient(135deg, #86efac, #16a34a);  /* Gradient on hover */
  transform: translateY(-1px) scale(1.02);  /* More lift and slight scale */
  box-shadow: 
    0 10px 24px rgba(22, 163, 74, 0.5),   /* Bigger shadow */
    0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Active/pressed state - reverse gradient and push down */
#add-span-btn:active {
  background-image: linear-gradient(135deg, #059669, #86efac);  /* Darker reversed gradient */
  transform: translateY(1px) scale(0.98);  /* Push down and shrink slightly */
  box-shadow: 
    0 2px 6px rgba(22, 163, 74, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);  /* Inner shadow to show depression */
  border-color: rgba(255, 255, 255, 0.25);
}

/* Focus state for accessibility */
#add-span-btn:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

/* Icon styling within button */
#add-span-btn i {
  font-size: 0.7rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));  /* Icon shadow */
}

/* Success animation - makes button pulse green */
@keyframes addSpanSuccess {
  0% { 
    transform: scale(1) translateY(0);
    background: #16a34a;
    box-shadow: 
      0 6px 16px rgba(22, 163, 74, 0.4),
      0 3px 8px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  30% { 
    transform: scale(1.1) translateY(-4px);
    background: #22c55e;  /* Brighter green */
    box-shadow: 
      0 12px 28px rgba(34, 197, 94, 0.6),  /* Bigger glow */
      0 6px 16px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      0 0 20px rgba(34, 197, 94, 0.4);  /* Glow effect */
  }
  60% {
    transform: scale(1.05) translateY(-2px);
    background: #16a34a;
  }
  100% { 
    transform: scale(1) translateY(0);
    background: #16a34a;
    box-shadow: 
      0 6px 16px rgba(22, 163, 74, 0.4),
      0 3px 8px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

#add-span-btn.success {
  animation: addSpanSuccess 0.4s ease;
}

/* Optional: Disabled state */
#add-span-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* 3D Power Budget Toggle button - blue gradient */
#pb-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;  /* Reduced gap */
  padding: 0.25rem 0.6rem;  /* Reduced padding */
  border-radius: 9999px;  /* Full rounded */
  font-weight: 500;
  font-size: 0.45rem;  /* Smaller font */
  color: #fff;
  background-image: linear-gradient(135deg, #60a5fa, #4f46e5);  /* Blue gradient */
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 
    0 6px 16px rgba(79, 70, 229, 0.4),
    0 3px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(0) scale(1);
  transition: all 0.18s ease;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.3px;  /* Reduced letter spacing */
}

/* Hover state - reverse gradient and lift */
#pb-toggle-btn:hover {
  background-image: linear-gradient(135deg, #4f46e5, #60a5fa);  /* Reversed gradient */
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 10px 24px rgba(79, 70, 229, 0.5),
    0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Active/pressed state */
#pb-toggle-btn:active {
  background-image: linear-gradient(135deg, #3730a3, #60a5fa);  /* Darker gradient */
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 2px 6px rgba(79, 70, 229, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Expanded state - slightly different color to show it's active */
#pb-toggle-btn.expanded {
  background-image: linear-gradient(135deg, #4f46e5, #6366f1);
}

#pb-toggle-btn.expanded:hover {
  background-image: linear-gradient(135deg, #6366f1, #4f46e5);
}

/* Icon rotation animation */
#pb-toggle-icon {
  font-size: 0.3rem;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Text styling */
#pb-toggle-text {
  font-size: 0.75rem;
  font-weight: 700;
}

/* Focus state */
#pb-toggle-btn:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .pb-widget-minimize {
    padding: 8px 12px !important;
    font-size: 14px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.5);
    touch-action: manipulation; /* Prevents double-tap zoom */
  }
}



/* 3D Map Controls */
.map-3d-btn {
  background-color: white;
  border: none;
  width: 29px;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background-color 0.2s;
}

.map-3d-btn:hover {
  background-color: #f0f0f0;
}

.map-3d-btn.active-3d {
  background-color: #4f46e5;
  color: white;
}

.mapboxgl-ctrl-group {
  background: white;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.1);
}