/* Professional toolbox styles for kichban map
   - Mobile-first responsive
   - Uses class-based styles to replace inline styles
*/
:root{
  --toolbox-bg: rgba(255,255,255,0.98);
  --toolbox-border: rgba(0,0,0,0.08);
  --toolbox-shadow: 0 6px 18px rgba(0,0,0,0.12);
  --accent: #07a78e;
  --muted: #6b6b6b;
  --radius: 10px;
}

.toolbox-toggle{
  position:absolute;
  top:180px;
  right:12px;
  z-index:999;
}

.toolbox-toggle-btn{
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 8px 15px;
    border-radius: 8px;
    color: #fff;
    border: none;
    box-shadow: var(--toolbox-shadow);
    cursor: pointer;
    font-weight: 600;
    background: #5492cd;
}
button#toggle-toolbox i {
    font-size: 1.3em;
}
.toolbox-toggle-btn:active{ transform: translateY(1px);} 

.toolbox-panel{
  position:absolute;
  top:180px;
  right:12px;
  z-index:1001;
  width:320px;
  max-width:calc(100% - 28px);
  background:var(--toolbox-bg);
  border-radius:var(--radius);
  box-shadow:var(--toolbox-shadow);
  border:1px solid var(--toolbox-border);
  padding:12px;
  display:none;
  font-family:Arial, Helvetica, sans-serif;
  color:#222;
}

.toolbox-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}

.toolbox-header h4{ margin:0; font-size:16px;}
.toolbox-close{
  border:none; background:none; font-size:20px; cursor:pointer; color:var(--muted);
}

.toolbox-section{ margin-bottom:12px; }
.toolbox-label-inline{ font-size:13px; color:var(--muted); margin-right:8px; }
.toolbox-control-inline{ display:flex; align-items:center; gap:8px; }
#opacity-slider{ width:160px; }
#opacity-value{ font-size:12px; color:var(--muted); min-width:40px; text-align:right; }

.toolbox-actions{ display:flex; gap:8px; }
.toolbox-btn{ flex:1; padding:8px 10px; border-radius:8px; border:none; background:#0458ac; color:#fff; cursor:pointer; }
.toolbox-btn:hover{ opacity:.95; }

.toolbox-subtitle{ font-weight:600; color:#333; margin-bottom:6px; }
.toolbox-controls-row{ display:flex; gap:6px; flex-wrap:wrap; }
.toolbox-small{ padding:6px 8px; border-radius:6px; border:1px solid var(--toolbox-border); background:#fff; cursor:pointer; }

.toolbox-row{ display:flex; align-items:center; gap:8px; margin-top:6px; }
.toolbox-toggle-btn-sm{ padding:6px 8px; border-radius:6px; border:1px solid var(--toolbox-border); background:#f6f6f6; cursor:pointer; }

.grid-options select, #baseLayerSelect{ padding:6px; border-radius:6px; border:1px solid var(--toolbox-border); }

/* Responsive: collapse to full-width bottom panel on small screens */
@media (max-width:480px){
  .toolbox-panel{
    left:12px; right:12px; top:auto; bottom:12px; width:auto; max-width:100%;
    border-radius:12px; padding:10px;
  }
  .toolbox-toggle{ top:auto; bottom:86px; }
}

/* Compact opacity control outside toolbox */
.toolbox-opacity-outside{
  position:absolute;
bottom: 40px;
    left: 10px;
  z-index:1000;
  display:flex;
  align-items:center;
  gap:8px;
  background: rgba(255,255,255,0.95);
  padding:6px 8px;
  border-radius:8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border:1px solid var(--toolbox-border);
}
.toolbox-opacity-outside .opacity-label{ font-size:14px; }
.toolbox-opacity-outside input[type="range"]{ width:120px; }
.toolbox-opacity-outside #opacity-value{ font-size:12px; color:var(--muted); min-width:36px; text-align:right; }

@media (max-width:480px){
  .toolbox-opacity-outside{
    bottom: 40px;
    left: 10px; top:auto; left:auto; width:auto; padding:8px; gap:6px;
    border-radius:10px;
  }
  .toolbox-opacity-outside input[type="range"]{ width:90px; }
  .toolbox-opacity-outside .opacity-label{ display:none; }
}

/* Tooltip for Xa (commune) names */
.xa-tooltip{
  background: rgba(0,0,0,0.75) !important;
  color: #fff !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  pointer-events: none;
}


