@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/vazirmatn-400.woff2") format("woff2");
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/vazirmatn-600.woff2") format("woff2");
}

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/vazirmatn-700.woff2") format("woff2");
}

:root {
  --bg-deep: #07151d;
  --bg-mid: #0f2a36;
  --ink: #e8f2f6;
  --muted: #9db5c0;
  --accent: #2f9e8a;
  --danger: #d97868;
  --line: rgba(232, 242, 246, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Vazirmatn", "Tahoma", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-deep);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 80% -10%, rgba(47, 158, 138, 0.28), transparent 55%),
    radial-gradient(ellipse 55% 45% at 10% 90%, rgba(56, 110, 150, 0.22), transparent 50%),
    linear-gradient(165deg, var(--bg-deep), var(--bg-mid) 55%, #123445);
  animation: drift 14s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: scale(1);
    filter: hue-rotate(0deg);
  }
  to {
    transform: scale(1.04);
    filter: hue-rotate(8deg);
  }
}

.shell {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  max-width: 40rem;
  margin-inline: auto;
}

.brand__mark {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  animation: rise 700ms ease both;
}

.brand__sub {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  animation: rise 700ms ease 80ms both;
}

.panel {
  padding: clamp(1.25rem, 4vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 21, 29, 0.55);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  animation: rise 700ms ease 140ms both;
}

.panel__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.panel__copy {
  margin: 0.65rem 0 0;
  color: var(--muted);
}

.coords {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.85rem;
}

.coords__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.coords__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.coords__label {
  color: var(--muted);
  font-size: 0.92rem;
  flex-shrink: 0;
}

.coords__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
}

.coords__value--text {
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: left;
  max-width: 65%;
}

.map-wrap {
  margin-top: 1.25rem;
}

.map {
  height: min(42vh, 280px);
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  z-index: 0;
}

.map-credit {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.map-credit a {
  color: #8fd9cb;
}

.actions {
  margin-top: 1.4rem;
}

.actions .btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  background: var(--accent);
  color: #04211c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.panel[data-state="pc"] {
  background: rgba(12, 28, 38, 0.7);
}

.panel[data-state="error"] .panel__title {
  color: var(--danger);
}

.panel[data-state="ready"] .panel__title,
.panel[data-state="located"] .panel__title {
  color: #8fd9cb;
}

/* Leaflet tweaks for dark panel */
.leaflet-container {
  font: inherit;
  background: #0c2430;
}

.leaflet-control-attribution {
  background: rgba(7, 21, 29, 0.75) !important;
  color: var(--muted) !important;
}

.leaflet-control-attribution a {
  color: #8fd9cb !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.search__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.search__hint {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.search__field input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: rgba(7, 21, 29, 0.55);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.search__field input:focus {
  border-color: rgba(47, 158, 138, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 158, 138, 0.15);
}

.search__status {
  margin: 0.55rem 0 0.35rem;
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.85rem;
}

.search__results {
  display: grid;
  gap: 0.55rem;
}

.place-item {
  appearance: none;
  width: 100%;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  background: rgba(7, 21, 29, 0.4);
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  transition: border-color 160ms ease, background 160ms ease;
}

.place-item:hover {
  border-color: rgba(47, 158, 138, 0.45);
  background: rgba(47, 158, 138, 0.08);
}

.place-name {
  font-weight: 700;
}

.place-meta {
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.place-desc {
  color: var(--muted);
  font-size: 0.88rem;
}

.place-badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(47, 158, 138, 0.2);
  color: #8fd9cb;
  font-size: 0.72rem;
  font-weight: 600;
}

.place-badge.muted {
  background: rgba(157, 181, 192, 0.12);
  color: var(--muted);
}

.search-empty {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .brand__mark,
  .brand__sub,
  .panel {
    animation: none;
  }
}
