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

html,
body {
  min-height: 100vh;
  background: #080c10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter", system-ui, sans-serif;
}

#app {
  width: 100%;
  max-width: 980px;
  margin: 24px;
  background: #0d1117;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #30363d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  color: #e6edf3;
  position: relative;
}

#map-container {
  width: 100%;
  height: 440px;
  position: relative;
  overflow: hidden;
  background: #0d1117;
}

#map-svg {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  animation: mapFadeIn 0.8s ease 0.2s forwards;
}

@keyframes mapFadeIn {
  to {
    opacity: 1;
  }
}

.info-bar {
  display: flex;
  flex-wrap: wrap;
  background: #161b22;
  border-top: 1px solid #30363d;
}

.info-tile {
  flex: 1;
  min-width: 130px;
  padding: 14px 18px;
  border-right: 1px solid #30363d;
}
.info-tile:last-child {
  border-right: none;
}

.info-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  color: #8b949e;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.info-value {
  font-size: 20px;
  font-weight: 500;
  color: #e6edf3;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.info-sub {
  font-size: 11px;
  color: #8b949e;
  margin-top: 3px;
}

.location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  flex-wrap: wrap;
  gap: 6px;
}

.location-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.location-name {
  font-size: 13px;
  font-weight: 500;
  color: #79c0ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-coords {
  font-size: 11px;
  color: #484f58;
  font-variant-numeric: tabular-nums;
  padding-left: 15px;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fb950;
  display: inline-block;
  animation: livepulse 2s infinite;
  flex-shrink: 0;
}

@keyframes livepulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utc-badge {
  font-size: 12px;
  color: #8b949e;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 3px 8px;
  font-variant-numeric: tabular-nums;
}

.edit-btn {
  background: none;
  border: 1px solid #30363d;
  color: #8b949e;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}
.edit-btn:hover {
  border-color: #79c0ff;
  color: #79c0ff;
  background: rgba(56, 139, 253, 0.08);
}
.edit-btn:focus-visible {
  outline: 2px solid #58a6ff;
  outline-offset: 2px;
}

.pulse-ring {
  animation: ringpulse 2.8s ease-out infinite;
}
.pulse-dot {
  animation: dotpulse 2.8s ease-in-out infinite;
}

@keyframes ringpulse {
  0% {
    r: 5;
    opacity: 0.9;
    stroke-width: 2.5;
  }
  100% {
    r: 28;
    opacity: 0;
    stroke-width: 0.4;
  }
}
@keyframes dotpulse {
  0%,
  100% {
    r: 5;
    opacity: 1;
  }
  50% {
    r: 6.5;
    opacity: 0.8;
  }
}

.weather-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.weather-icon {
  font-size: 20px;
  line-height: 1;
}

.footer-note {
  text-align: center;
  font-size: 10px;
  color: #3d444d;
  padding: 7px;
  background: #0d1117;
  border-top: 1px solid #21262d;
  letter-spacing: 0.03em;
}

/* Modal */
.modal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 100;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}
.modal-overlay.open {
  display: flex;
}

.modal {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 24px;
  width: 360px;
  max-width: 92%;
}
.modal h3 {
  font-size: 15px;
  font-weight: 500;
  color: #e6edf3;
  margin-bottom: 14px;
}
.modal label {
  font-size: 11px;
  color: #8b949e;
  display: block;
  margin-bottom: 4px;
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.modal input {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 10px;
  color: #e6edf3;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.modal input:focus {
  border-color: #58a6ff;
}

.detect-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.detect-btn {
  background: none;
  border: none;
  color: #58a6ff;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  padding: 2px 0;
  transition: color 0.15s;
}
.detect-btn:hover {
  color: #79c0ff;
  text-decoration: underline;
}
.detect-btn:focus-visible {
  outline: 2px solid #58a6ff;
  outline-offset: 2px;
}

.modal-hint {
  font-size: 11px;
  color: #484f58;
  margin-top: 12px;
  line-height: 1.7;
}
.modal-hint a {
  color: #58a6ff;
}

.modal-btns {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.modal-btns button {
  flex: 1;
  padding: 9px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.modal-btns button:focus-visible {
  outline: 2px solid #58a6ff;
  outline-offset: 2px;
}
.btn-confirm {
  background: #238636;
  border: 1px solid #2ea043;
  color: #fff;
  font-weight: 500;
}
.btn-confirm:hover {
  background: #2ea043;
}
.btn-cancel {
  background: none;
  border: 1px solid #30363d;
  color: #8b949e;
}
.btn-cancel:hover {
  border-color: #8b949e;
  color: #e6edf3;
}

@media (max-width: 600px) {
  #map-container {
    height: 260px;
  }
  .info-tile {
    min-width: 100px;
    padding: 10px 12px;
  }
  .info-value {
    font-size: 16px;
  }
  #app {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .location-coords {
    display: none;
  }
}
