/* ============================================
   BAUSITE Geo — Mess- und Analysewerkzeuge
   CSS Styles
   Farben: Navy (#1B2A4A), Orange (#E8833A), Blue (#2E86AB)
   ============================================ */

/* ── Mess-Toolbar (Hinweisleiste oben auf der Karte) ── */
.measure-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(17, 28, 51, 0.92);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.measure-toolbar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-10px);
}

.measure-toolbar .toolbar-text {
  font-weight: 600;
}

.measure-toolbar .toolbar-hint {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.measure-toolbar .toolbar-btn {
  background: #E8833A;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.measure-toolbar .toolbar-btn:hover {
  background: #D06B24;
}

.measure-toolbar .toolbar-btn.danger {
  background: rgba(239, 68, 68, 0.8);
}

.measure-toolbar .toolbar-btn.danger:hover {
  background: #EF4444;
}

/* ── Mess-Ergebnis Overlay auf der Karte ── */
.measure-result-overlay {
  position: absolute;
  background: rgba(17, 28, 51, 0.92);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: white;
  font-size: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 15;
  min-width: 180px;
  pointer-events: auto;
}

.measure-result-overlay .result-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: #E8833A;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.measure-result-overlay .result-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 11px;
}

.measure-result-overlay .result-row .label {
  color: rgba(255, 255, 255, 0.5);
}

.measure-result-overlay .result-row .value {
  font-weight: 700;
  color: white;
}

.measure-result-overlay .result-row .value.highlight {
  color: #E8833A;
  font-size: 14px;
}

.measure-result-overlay .result-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
  line-height: 1;
  transition: color 0.15s;
}

.measure-result-overlay .result-close:hover {
  color: #EF4444;
}

/* ── Segment-Labels auf der Karte (MapLibre Marker) ── */
.measure-segment-label {
  background: rgba(17, 28, 51, 0.85);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ── Messpunkt-Marker ── */
.measure-point {
  width: 12px;
  height: 12px;
  background: #E8833A;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: crosshair;
}

.measure-point.first {
  width: 14px;
  height: 14px;
  background: #2E86AB;
}

/* ── Crosshair Cursor ── */
.measure-cursor-active .maplibregl-canvas {
  cursor: crosshair !important;
}

/* ── Höhenprofil-Panel (unten) ── */
.profile-panel {
  position: absolute;
  bottom: 28px; /* über der info-bar */
  left: 0;
  right: 0;
  z-index: 25;
  background: white;
  border-top: 2px solid #E8833A;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.profile-panel.open {
  transform: translateY(0);
}

.profile-panel.minimized {
  transform: translateY(calc(100% - 36px));
}

.profile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #1B2A4A;
  color: white;
  height: 36px;
  cursor: pointer;
  user-select: none;
}

.profile-panel-header .panel-title {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-panel-header .panel-title .icon {
  color: #E8833A;
}

.profile-panel-header .panel-controls {
  display: flex;
  gap: 6px;
}

.profile-panel-header .panel-controls button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.profile-panel-header .panel-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.profile-panel-body {
  display: flex;
  height: 220px;
}

.profile-chart-container {
  flex: 1;
  position: relative;
  padding: 12px 16px 8px 16px;
}

.profile-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.profile-stats {
  width: 180px;
  padding: 12px 16px;
  border-left: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.profile-stat-item {
  font-size: 11px;
}

.profile-stat-item .stat-label {
  color: #64748B;
  font-size: 10px;
  margin-bottom: 2px;
}

.profile-stat-item .stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #1B2A4A;
  font-size: 13px;
}

.profile-stat-item .stat-value.orange {
  color: #E8833A;
}

/* Hover-Tooltip im Profil-Chart */
.profile-tooltip {
  position: absolute;
  background: rgba(17, 28, 51, 0.92);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 30;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: opacity 0.1s;
}

.profile-tooltip.hidden {
  opacity: 0;
}

/* ── Höhenpunkt-Popup (Punkt-Abfrage) ── */
.height-popup {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.height-popup .popup-title {
  font-size: 13px;
  font-weight: 800;
  color: #1B2A4A;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.height-popup .popup-title .height-value {
  color: #E8833A;
}

.height-popup .coord-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #E2E8F0;
}

.height-popup .coord-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  padding: 2px 0;
}

.height-popup .coord-row .coord-label {
  color: #64748B;
}

.height-popup .coord-row .coord-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #1B2A4A;
}

/* ── Neigungs-Analyse Ergebnis ── */
.slope-result {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.slope-result .slope-main {
  text-align: center;
  margin-bottom: 10px;
}

.slope-result .slope-main .slope-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  color: #E8833A;
}

.slope-result .slope-main .slope-unit {
  font-size: 14px;
  color: #64748B;
  margin-left: 2px;
}

.slope-result .slope-detail {
  font-size: 11px;
}

.slope-result .slope-detail .row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #E2E8F0;
}

.slope-result .slope-detail .row:last-child {
  border-bottom: none;
}

.slope-result .slope-detail .row .label {
  color: #64748B;
}

.slope-result .slope-detail .row .val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #1B2A4A;
}

/* ── Loading Spinner ── */
.measure-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748B;
}

.measure-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #E2E8F0;
  border-top-color: #E8833A;
  border-radius: 50%;
  animation: measure-spin 0.6s linear infinite;
}

@keyframes measure-spin {
  to { transform: rotate(360deg); }
}
