/* Reset and base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* CSS variables */
:root {
  --footer-height: 20px; /* ~20px footer height as requested */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #1a2332;
  color: #ffffff;
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Common elements */
.title {
  font-size: 28px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 14px;
  color: #8b9dc3;
  line-height: 1.4;
}

.level-badge {
  background: linear-gradient(135deg, #27ae60, #229954);
  color: white;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
}

.info-label {
  font-size: 13px;
  color: #bdc3c7;
  min-width: 60px;
}

.info-value {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: #ecf0f1;
  font-weight: 600;
  word-break: break-all;
}

/* Location Information (desktop sidebar) — with separators */
.info-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
  border-bottom: none;
}

/* Mobile info bar rows — add separators for readability */
.mobile-info-bar .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0; /* add vertical spacing */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* divider line */
  margin-bottom: 0; /* override older margin spacing */
}

.mobile-info-bar .info-row:last-child {
  border-bottom: none;
}

/* Buttons and selectors */
.nav-button {
  background: linear-gradient(135deg, #3498db, #2980b9);
  border: none;
  color: white;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

.nav-button:hover {
  background: linear-gradient(135deg, #2980b9, #21618c);
  transform: translateY(-1px);
}

.nav-button:active {
  transform: scale(0.98);
}

.nav-button:disabled {
  background: linear-gradient(135deg, #7f8c8d, #95a5a6);
  cursor: not-allowed;
  transform: none;
}

/* Language selector using same background as the page */
.language-selector {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 14px 16px;
  padding-right: 40px;
  border: none;
  border-radius: 10px;
  color: #ffffff;
  background-color: #1a2332; /* match body background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1.5 4.5h9z'/%3E%3C/svg%3E");
  background-position: right 15px center;
  background-repeat: no-repeat;
  background-size: 12px;
}

.language-selector:hover {
  background-color: #1a2332;
}

/* Format selector (Numbers/Words toggle) */
.format-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.format-option {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #bdc3c7;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 44px;
}

.format-option:hover {
  color: #ecf0f1;
  background: rgba(255, 255, 255, 0.1);
}

.format-option.active {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Leaflet container */
#map {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

/* Grid cell styles */
.grid-cell {
  fill: transparent;
  stroke: #e74c3c;
  stroke-width: 2;
  cursor: pointer;
  opacity: 0.7;
}

.grid-cell:hover {
  fill: rgba(231, 76, 60, 0.3);
  stroke-width: 3;
}

.grid-cell.selected {
  fill: rgba(52, 152, 219, 0.5);
  stroke: #3498db;
  stroke-width: 4;
}

.selected-marker {
  background: #3498db;
  color: white;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Mobile close button hidden by default (desktop) */
.mobile-close {
  display: none;
}
