/* Карта затмений — тема глубокого космоса.
   Токены заданы в tailwind.config (base.html); здесь только то, что
   utility-классами не выразить: звёздное небо, стеклянные панели,
   свечение полос, кастомный слайдер шкалы времени. */

html {
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(120% 140% at 15% -10%, #0A0E2E 0%, #060A1F 55%, #04061a 100%);
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Focus / accessibility ---------- */
.focus-ring:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #F5B740;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Cards ---------- */
.card-pop {
  animation: card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Filter pills ---------- */
.filter-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  border-radius: 9999px;
  color: #8A93C4;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}
.filter-pill:hover {
  color: #E8ECFF;
}
.filter-pill.is-active {
  background: linear-gradient(135deg, #F5B740, #FF7A45);
  color: #16110a;
  font-weight: 600;
}

/* ---------- Type badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-total {
  background: rgba(245, 183, 64, 0.16);
  color: #F5B740;
  box-shadow: 0 0 0 1px rgba(245, 183, 64, 0.25) inset;
}
.badge-annular {
  background: rgba(159, 180, 255, 0.16);
  color: #9FB4FF;
  box-shadow: 0 0 0 1px rgba(159, 180, 255, 0.25) inset;
}
.badge-hybrid {
  background: linear-gradient(90deg, rgba(245,183,64,0.18), rgba(159,180,255,0.18));
  color: #E8ECFF;
  box-shadow: 0 0 0 1px rgba(232, 236, 255, 0.18) inset;
}
.badge-partial {
  background: rgba(232, 236, 255, 0.08);
  color: #8A93C4;
  box-shadow: 0 0 0 1px rgba(138, 147, 196, 0.25) inset;
}
.badge-lunar {
  background: rgba(159, 180, 255, 0.16);
  color: #9FB4FF;
  box-shadow: 0 0 0 1px rgba(159, 180, 255, 0.25) inset;
}

/* ---------- Map ---------- */
#map {
  filter: brightness(0.62) contrast(1.18) saturate(0.55) hue-rotate(-6deg);
  background: #0A0E2E;
}
#map ymaps {
  border-radius: inherit;
}

#regionChip {
  display: none;
}
#regionChip.is-visible {
  display: flex;
  animation: card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ---------- Timeline ---------- */
.timeline-track {
  position: relative;
  height: 64px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.timeline-track:active {
  cursor: grabbing;
}
.timeline-rail {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  transform: translateY(-50%);
  background: #232B52;
  border-radius: 999px;
}
.timeline-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 4px;
  width: 50%;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #9FB4FF, #F5B740);
  border-radius: 999px;
  transition: width 0.08s linear;
}
.timeline-glow {
  position: absolute;
  top: 50%;
  width: 90px;
  height: 90px;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(245,183,64,0.28) 0%, rgba(245,183,64,0) 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.timeline-markers {
  position: absolute;
  inset: 0;
}
.timeline-marker {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #8A93C4;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.timeline-marker:hover {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.3);
}
.timeline-marker.is-total { background: #F5B740; }
.timeline-marker.is-annular { background: #9FB4FF; }
.timeline-marker.is-hybrid { background: linear-gradient(135deg, #F5B740, #9FB4FF); }
.timeline-marker.is-lunar { background: #9FB4FF; }
.timeline-marker.is-dim { opacity: 0.18; }
.timeline-marker.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.7);
  box-shadow: 0 0 0 4px rgba(245, 183, 64, 0.18);
}

.timeline-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #E8ECFF;
  box-shadow: 0 0 0 4px rgba(232,236,255,0.12), 0 0 22px rgba(245,183,64,0.55);
  transition: box-shadow 0.2s ease, left 0.08s linear;
}
.timeline-track:active .timeline-thumb {
  box-shadow: 0 0 0 6px rgba(245,183,64,0.22), 0 0 28px rgba(245,183,64,0.75);
}

/* ---------- Toast ---------- */
#catalogToast.is-visible {
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-pop, #catalogToast.is-visible, #regionChip.is-visible {
    animation: none !important;
  }
  .timeline-thumb, .timeline-fill, .timeline-marker {
    transition: none !important;
  }
}
