@font-face {
  font-family: 'Campton';
  src: url('fonts/CamptonBook.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================
   Zasięg pieszy - style aplikacji
   ========================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #app {
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
}

#app {
  display: grid;
  grid-template-columns: 320px 1fr;
}

/* === Sidebar === */

#sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  gap: 24px;
}

/* === Logo === */

.sidebar-logo {
  display: block;
  max-width: 100%;
  max-height: 72px;
  width: auto;
  height: auto;
  margin: 0 auto 12px auto;
  object-fit: contain;
}

/* === Header === */

.sidebar-header {
  text-align: center;
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  font-family: 'Campton', sans-serif;
}

.subtitle {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

/* === Kontrolki === */

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.controls label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#distance-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
}

#distance-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.hint {
  font-size: 12px;
  color: #9ca3af;
}

/* === Toggle ścieżek === */

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal !important;
}

.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.toggle-text {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.toggle-hint {
  font-size: 11px;
  color: #9ca3af;
  margin-left: auto;
}

/* === Przycisk === */

.btn-secondary {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* === Status === */

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-idle    { background: #f3f4f6; color: #6b7280; }
.status-idle .status-dot { background: #9ca3af; }

.status-loading { background: #fef3c7; color: #92400e; }
.status-loading .status-dot {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

.status-success { background: #d1fae5; color: #065f46; }
.status-success .status-dot { background: #10b981; }

.status-error   { background: #fee2e2; color: #991b1b; }
.status-error .status-dot { background: #ef4444; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* === Statystyki === */

.stats h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 12px;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.empty-state {
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
  padding: 16px;
  text-align: center;
  background: #f9fafb;
  border-radius: 6px;
}

.point-card {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--point-color, #3b82f6);
  border-radius: 6px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.point-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.point-card-title {
  font-size: 13px;
  font-weight: 600;
}

.point-card-remove {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.point-card-remove:hover { color: #ef4444; }

.point-stat {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
}

.point-stat--coords strong {
  font-size: 11px;
  font-family: monospace;
  letter-spacing: -0.02em;
}

.distance-label {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  pointer-events: none;
}

.point-stat strong {
  color: #1f2937;
  font-weight: 500;
}

/* === Totals === */

.totals {
  padding: 12px;
  background: #eff6ff;
  border-radius: 6px;
  border: 1px solid #dbeafe;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.totals-row strong {
  color: #1e40af;
  font-weight: 600;
}

/* === Footer === */

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.sidebar-footer small {
  font-size: 11px;
  color: #9ca3af;
}

/* === Mapa === */

#map {
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* === Responsywność === */

@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  #sidebar {
    max-height: 50vh;
  }
}
