/* Minimal layout — designed to be themed later */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
#sidebar {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  color: #e0e0e0;
  overflow-y: auto;
}

#sidebar header {
  padding: 16px;
  border-bottom: 1px solid #333;
}

#sidebar h1 {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Controls */
.controls {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid #333;
}

.controls label {
  font-size: 0.8em;
  text-transform: uppercase;
  color: #aaa;
}

.controls input[type="text"],
.controls input[type="number"] {
  background: #16213e;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 8px 10px;
  font-size: 0.9em;
  border-radius: 3px;
}

.controls input:focus {
  outline: none;
  border-color: #4a9eff;
}

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

.radius-row input[type="range"] { flex: 1; }
.radius-row input[type="number"] { width: 60px; text-align: center; }

#search-btn {
  padding: 10px;
  font-size: 0.9em;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  background: #333;
  color: #888;
}

#search-btn:not(:disabled) {
  background: #4a9eff;
  color: #fff;
}

#search-btn:not(:disabled):hover {
  background: #3a8eef;
}

/* Status */
#status {
  padding: 8px 16px;
  font-size: 0.8em;
  color: #aaa;
}

/* Action bar */
#action-bar {
  display: flex;
  gap: 6px;
  padding: 4px 16px;
}

#action-bar[hidden] { display: none; }

#action-bar button {
  flex: 1;
  padding: 6px 12px;
  font-size: 0.8em;
  background: #16213e;
  color: #4a9eff;
  border: 1px solid #333;
  border-radius: 3px;
  cursor: pointer;
}

#action-bar button:hover { border-color: #4a9eff; }
#action-bar button:disabled { opacity: 0.5; cursor: default; }

/* Toast */
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #e0e0e0;
  border: 1px solid #4a9eff;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.85em;
  z-index: 2000;
}

#toast[hidden] { display: none; }

/* Results list */
#results {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.result-item {
  padding: 8px 10px;
  margin-bottom: 4px;
  background: #16213e;
  border: 1px solid #333;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8em;
}

.result-item:hover {
  border-color: #4a9eff;
}

.result-item .name {
  font-weight: 600;
  color: #fff;
}

.result-item .distance {
  color: #4a9eff;
  font-weight: 600;
  margin-right: 6px;
}

.result-item .address {
  color: #aaa;
  font-size: 0.9em;
}

.result-item .denomination {
  color: #8ab4f8;
  font-size: 0.9em;
}

/* Map */
#map-container {
  flex: 1;
  position: relative;
}

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

.share-btn {
  position: absolute;
  top: 10px;
  left: 60px;
  z-index: 1100;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  transition: background 0.15s;
}

.share-btn:hover {
  background: #f0f0f0;
}

/* Modal */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#modal-overlay[hidden] { display: none; }

#modal {
  background: #1a1a2e;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

#modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.4em;
  cursor: pointer;
}

#modal-close:hover { color: #fff; }

#modal h2 {
  font-size: 1.1em;
  margin-bottom: 12px;
  padding-right: 24px;
}

#modal table {
  width: 100%;
  font-size: 0.85em;
  border-collapse: collapse;
}

#modal table td {
  padding: 4px 8px;
  border-bottom: 1px solid #2a2a4e;
  vertical-align: top;
}

#modal table td:first-child {
  color: #aaa;
  white-space: nowrap;
  width: 100px;
}

#modal table a {
  color: #4a9eff;
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
  border-radius: 4px;
}

.leaflet-popup-content {
  margin: 10px;
  font-size: 0.85em;
  line-height: 1.4;
}

.leaflet-popup-content .popup-name {
  font-weight: 600;
  margin-bottom: 4px;
}

/* Mobile */
@media (max-width: 768px) {
  body { flex-direction: column; }
  #sidebar { width: 100%; max-height: 45vh; }
  #map { height: 55vh; }
}
