/* ============= Reset & Basics ============= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #4a1fff 0, #050014 55%, #010007 100%);
  color: #f5f5ff;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============= Header ============= */

.top-bar {
  width: 100%;
  padding: 0.6rem 1rem;
  background: linear-gradient(90deg, #3b0c99, #8b1eff);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.app-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffb000, #ff7a2f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #3b1300;
}

.app-title-block {
  display: flex;
  flex-direction: column;
}

.app-name {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.app-name .warning {
  font-size: 1rem;
}

.version-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.testpay-btn {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: #fff5d1;
  cursor: pointer;
}

.menu-button {
  border-radius: 999px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-button span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  position: relative;
}

.menu-button span::before,
.menu-button span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.menu-button span::before {
  top: -5px;
}

.menu-button span::after {
  top: 5px;
}

.header-subtitle {
  font-size: 0.85rem;
  opacity: 0.96;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-variant {
  background: rgba(0, 0, 0, 0.35);
}

/* ============= Main & Map ============= */

.main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.8rem 0.4rem;
  gap: 0.6rem;
}

#map {
  flex: 1 1 auto;
  width: 100%;
  min-height: 360px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

/* MapLibre controls innen etwas Abstand */
.maplibregl-ctrl-top-right {
  top: 10px;
  right: 10px;
}

/* ============= Bottom Panel ============= */

.bottom-panel {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(5, 0, 20, 0.95), #050014);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.register-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.register-text {
  font-size: 0.82rem;
}

.register-btn {
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ffb000, #ff7b29);
  color: #231018;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #cfd6ff;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31d158;
  box-shadow: 0 0 0 3px rgba(49, 209, 88, 0.4);
}

.chevron {
  margin-left: auto;
}

/* ============= Sheet (Bottom Sheet) ============= */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  background: #08031a;
  border-radius: 18px 18px 0 0;
  padding: 0.9rem 1.1rem 1.3rem;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.5);
  color: #f1f3ff;
  overflow-y: auto;
}

.sheet-handle {
  width: 46px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  margin: 0 auto 0.6rem;
}

.sheet-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.sheet-sub {
  font-size: 0.82rem;
  color: #c9d1ff;
  margin-bottom: 0.7rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 0.75rem;
}

.form-grid-full {
  grid-column: 1 / -1;
}

#location-form label {
  font-size: 0.78rem;
  color: #c7ceff;
  display: block;
  margin-bottom: 0.1rem;
}

#location-form input,
#location-form select,
#location-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(120, 133, 255, 0.6);
  background: #050015;
  color: #f5f6ff;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
}

#location-form textarea {
  min-height: 70px;
  resize: vertical;
}

.coord-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.coord-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  background: rgba(31, 40, 112, 0.9);
  border: 1px solid rgba(154, 166, 255, 0.7);
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.sheet-close-btn,
.sheet-submit-btn {
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.sheet-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5ff;
}

.sheet-submit-btn {
  background: linear-gradient(135deg, #ffb000, #ff7b29);
  color: #231018;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ============= Marker & Popup ============= */

.current-location-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00b4ff;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 180, 255, 0.35);
}

.pi-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffb000;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.35);
}

.geopi-popup {
  max-width: 260px;
  font-size: 0.8rem;
  color: #111322;
}

.geopi-popup h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111322;
}

.geopi-popup p {
  margin: 0 0 0.15rem;
  color: #34384a;
}

.route-btn {
  margin-top: 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #ffb000;
  color: #151018;
  font-weight: 600;
}

.route-btn span:first-child {
  font-size: 0.9rem;
}

/* ============= Footer ============= */

.footer-line {
  padding: 0.4rem 0.9rem 0.6rem;
  font-size: 0.75rem;
  background: #050014;
  color: #d9e2ff;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  justify-content: center;
}

/* ============= Responsive ============= */

@media (min-width: 900px) {
  .main {
    padding: 1rem 1.2rem 0.6rem;
  }

  #map {
    min-height: 520px;
  }

  .sheet-backdrop {
    align-items: center;
  }

  .sheet {
    border-radius: 18px;
  }
}
