/* Header (fixed, centered) */
.logo-bar{
  position:fixed; inset:0 0 auto 0; height:var(--header-h);
  display:flex; align-items:center; justify-content:center; text-align:center;
  padding:10px 14px; background:var(--bg-header);
  border-bottom:var(--border-nrw); z-index:1000;
}
.logo-wrap{display:flex; flex-direction:column; align-items:center; gap:2px}
.logo-wrap img{height:42px}
.logo-wrap h1{margin:2px 0 0; font-size:1.05rem; font-weight:800}
.logo-wrap small{color:var(--accent-yellow); opacity:.95; font-size:.8rem}

/* App layout below header */
#app{display:flex; height: 100vh; padding-top:var(--header-h); box-sizing: border-box; min-width: 300px; }

/* Sidebar */
.sidebar{
  width:280px; min-width:50px; transition:width .25s ease;
  border-right: var(--border-nrw); display:flex; flex-direction:column;
  background: var(--bg-sidebar);
}
.sidebar.collapsed{width:50px}

.sidebar-toggle-btn{
  display:flex; align-items:center; justify-content:center; gap:.5rem;
  background:var(--accent-yellow); color:#000; padding:10px; font-size:1.1rem; font-weight:900;
  cursor:pointer; user-select:none; border:none; border-radius:0px; white-space:nowrap;
}

.sidebar-items{display:flex; flex-direction:column;}

.sidebar-item{
  display:flex; gap:.6rem; align-items:center; padding:12px 16px; font-weight:700;
  border:var(--border-nrw); border-radius:0px; background:var(--bg-sidebar); color:#eee; cursor:pointer;
}
.sidebar-item .ico{width:20px; text-align:center}
.sidebar-item:hover,.sidebar-item.active{background:#3f3f3f}

.sidebar.collapsed .sidebar-item{justify-content:center}
.sidebar.collapsed .sidebar-item .label{display:none}

/* Content & map */
.content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #121212;
}

.view-container {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Base style for your custom circle buttons */
.leaflet-marker-icon.cell-btn {
  box-sizing: border-box;
  width: 24px !important;   /* MUST match iconSize in JS */
  height: 24px !important;  /* MUST match iconSize in JS */
  border-radius: 50%;

  background: #2ecc71;      /* default, overridden below */
  cursor: pointer;
  user-select: none;

  position: absolute;       /* Leaflet manages left/top/transform */
  padding: 0;
  border: none;
}

/* Specific colors for add / remove */
.leaflet-marker-icon.cell-btn--add {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.leaflet-marker-icon.cell-btn--remove {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* PLUS / MINUS SHAPES (pure CSS, geometrically centered) */
.leaflet-marker-icon.cell-btn::before,
.leaflet-marker-icon.cell-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: #fff;
  border-radius: 2px;
  transform: translate(-50%, -50%);
}

/* Horizontal bar (for both + and -) */
.leaflet-marker-icon.cell-btn::before {
  width: 14px;
  height: 3px;
}

/* Vertical bar – only for the + button */
.leaflet-marker-icon.cell-btn--add::after {
  width: 3px;
  height: 14px;
}

/* Remove button: no vertical bar → minus sign only */
.leaflet-marker-icon.cell-btn--remove::after {
  content: none;
}

/* Optional: subtle hover/active feedback without moving center */
.leaflet-marker-icon.cell-btn:hover {
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.leaflet-marker-icon.cell-btn:active {
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
}

/* Leaflet tooltips: haal standaard rand/pijl weg */
.leaflet-tooltip.feature-tooltip {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.is-editing .leaflet-tooltip.feature-tooltip {
  display: none;
}

/* Jouw “PV Works” look */
.feature-tooltip {
  position:absolute;
  left: 10px;
  top: 10px;
  pointer-events:auto;
}

.feature-tooltip .card {
  background: rgba(15, 15, 15, 0.88);
  border: var(--border-dv);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  padding: 10px 12px;
  color: var(--text-light);
  font: 12px/1.35;
  min-width: 240px;

  /* “glass” feel (werkt in moderne browsers) */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.feature-tooltip .title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--accent-yellow);
  letter-spacing: 0.2px;
}

.feature-tooltip .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(243, 198, 35, 0.20);
}

.feature-tooltip .grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
}

.feature-tooltip .k {
  color: var(--muted);
}

.feature-tooltip .v {
  font-weight: 700;
  color: var(--text-light);
  text-align: right;
}

.feature-tooltip .hr {
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 8px 0;
}

.feature-tooltip input, .feature-tooltip select {
  background: rgba(255, 255, 255, 0.06); /* subtle dark glass */
  border: var(--border-dv);
  border-radius: 6px;
  padding: 4px 6px;
  color: var(--text-light);
  font-weight: 600;
  width: 100%;
  outline: none;
  color-scheme: dark;
}

/* Number steppers */
.num-stepper {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-width: 0;
}

.num-stepper input[type="number"] {
  width: 100%;
  padding-right: 26px;
  -moz-appearance: textfield;
}

.num-stepper input[type="number"]::-webkit-outer-spin-button,
.num-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.num-stepper-buttons {
  position: absolute;
  right: 4px;
  top: 3px;
  bottom: 3px;
  display: flex;
  flex-direction: column;
  width: 18px;
  border-left: var(--border-dv);
}

.num-stepper-btn {
  flex: 1 1 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.num-stepper-btn::before {
  content: "";
  width: 4px;
  height: 4px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.num-stepper-btn--up::before {
  transform: rotate(-135deg);
}

.num-stepper-btn:hover::before {
  border-right-color: var(--accent-yellow);
  border-bottom-color: var(--accent-yellow);
}

.num-stepper-btn:active::before {
  filter: brightness(0.9);
}

.feature-tooltip input:focus {
  border-color: var(--accent-yellow);       /* yellow highlight */
  box-shadow: 0 0 4px rgba(243, 198, 35, 0.35);
}

.feature-tooltip select option {
  background: rgba(20, 20, 20, 0.95);   /* dark dropdown */
  color: var(--text-light);
  padding: 6px;
}

.feature-tooltip select option:hover {
  background: rgba(243, 198, 35, 0.25); /* yellow hover */
}

/* Projection panel */
.projection-panel {
  position: relative;
  margin-top: 0;
  pointer-events: auto;
}

.projection-panel .card {
  background: rgba(255, 255, 255, 0.04);
  border: var(--border-dv);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  padding: 12px;
  color: var(--text-light);
  font: 12px/1.35;
  min-width: 360px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.projection-panel .title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--accent-yellow);
}

.projection-panel .projection-close {
  margin-left: auto;
  padding: 6px 10px;
  font-size: 12px;
}

.projection-panel .projection-body {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.projection-panel .projection-views {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
  align-items: stretch;
}

.projection-panel .projection-section-title {
  font-weight: 700;
  color: var(--accent-yellow);
  letter-spacing: 0.2px;
  text-align: left;
  align-self: stretch;
}

.projection-panel .projection-view-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
}

.projection-panel .projection-view-btn {
  justify-content: center;
  width: 100%;
}

.projection-panel .projection-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.projection-panel canvas {
  background: var(--projection-bg);
  border: var(--border-dv);
  border-radius: 8px;
  width: 520px;
  height: 180px;
}

.projection-panel .projection-3d {
  width: 520px;
  height: 180px;
  border: var(--border-dv);
  border-radius: 8px;
  background: var(--projection-bg);
  overflow: hidden;
  touch-action: none;
}

.projection-panel .projection-3d canvas {
  background: var(--projection-bg);
  display: block;
}

.projection-panel .projection-metrics {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.projection-panel .projection-metrics .metric-row {
  align-items: center;
  gap: 12px;
}

.projection-panel .projection-metrics input[type="number"] {
  max-width: 90px;
}

.projection-panel .projection-metrics .num-stepper {
  max-width: 90px;
}

.projection-panel .projection-metrics input[type="checkbox"] {
  justify-self: end;
}

.projection-panel .projection-metrics .btn {
  align-self: flex-start;
  margin-top: 4px;
}


.projection-panel .metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.projection-panel .k {
  color: var(--muted);
  white-space: nowrap;
}

.projection-panel .metric-available .k,
.projection-panel .metric-available .v {
  color: var(--accent-blue);
}

.projection-panel .v {
  font-weight: 700;
  color: var(--text-light);
}

/* Buttons */
.btn {
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
}

.btn-primary {
  background: var(--accent-yellow);
  color: var(--text-dark);
  box-shadow: 0 4px 10px rgba(243, 198, 35, 0.35);
}

.btn-primary:hover {
  background: var(--accent-yellow-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(243, 198, 35, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-yellow);
  box-shadow: 0 0 0 1px rgba(243, 198, 35, 0.45);
}

.btn-secondary:hover {
  background: var(--accent-yellow-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f6f6f6;
}

.btn-danger {
  background: #ff4d4d;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(255, 70, 70, 0.35);
}

.btn-danger:hover {
  background: #ff2b2b;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(255, 70, 70, 0.45);
}

.btn-toggle {
  display: inline-flex;
  background: var(--accent-blue);
  color: var(--text-dark);
  border-radius: 999px;
  padding: 8.5px 18px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
}

/* hover when not active */
.btn-toggle:hover {
  background: var(--accent-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.35);
}

/* active/checked state */
.btn-toggle.is-active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.8);
  transform: translateY(0);
}

/* active + hover (subtle, no big jump) */
.btn-toggle.is-active:hover {
  background: rgba(56, 189, 248, 0.22);
}

/* optional: group styles */
.btn-toggle-group {
  display: inline-flex;
  white-space: nowrap;
  gap: 0.5rem;
}

input[type="radio"]:checked + .btn-toggle {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.8);
}

/* Utility classes */
.is-hidden {
  display: none !important;
}

/* Messages */
#toast {
  visibility: hidden;
  min-width: 200px;
  margin-left: -100px;
  background: #333;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px;
  position: fixed;
  left: 50%;
  bottom: 40px;
  font-size: 16px;
  opacity: 0;
  transition: opacity .4s, bottom .4s;
}

/* Extra*/
.divider {
  background: rgba(255, 255, 255, 0.08);
  height: 1px;
  margin: 10px 0;
}
.hint {font-size: 13px; color: rgba(255, 255, 255, 0.8);}

.edit-mode-actions {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: rgba(15, 15, 15, 0.85);
  border: var(--border-dv);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  z-index: 700;
  pointer-events: auto;
}

/* Small screens */
@media (max-width: 600px){
  #app { flex-direction: column;}
  .sidebar { width: 100%; height: auto; border-right: none; border-top: 1px solid #333; }
  .sidebar.collapsed{width: 100%}
  .sidebar.collapsed .sidebar-items{display:none}
  .sidebar.collapsed .sidebar-toggle-btn{border-bottom: var(--border-nrw)}
  .sidebar-panel{max-height:55%}
  .projection-panel .projection-body {
    flex-direction: column;
  }
  .projection-panel .projection-views {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .projection-panel .projection-view-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  .projection-panel .projection-view-btn {
    flex: 1 1 auto;
  }
  .projection-panel canvas {
    width: 100%;
    height: auto;
  }
  .projection-panel .projection-3d {
    width: 100%;
    height: 210px;
  }
}
