/* ============================================================================
   events1.modern.css — Додатни стилови за модернизираната табла (ДОДАТОК)
   ----------------------------------------------------------------------------
   Се вчитува ПОСЛЕ events1.css (Dash ги реди азбучно). Содржи само стилови за
   новите класи од актуелниот events1.py — ништо од базниот CSS не се препишува,
   освен колоната на .metrics-grid (5 × 2 наместо 4).
   ============================================================================ */

/* ---------- Generic "geo-техно" panel (glass) ---------- */
.panel {
  position: relative;
  background: linear-gradient(168deg, rgba(13, 30, 52, 0.62), rgba(6, 14, 26, 0.82));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.035), transparent 30%, transparent 70%, rgba(34, 211, 238, 0.045));
}

/* ---------- HERO (нов .hero-strip) ---------- */
.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 14px 18px;
  margin-bottom: 12px;
  overflow: hidden;
}
.hero-text { min-width: 0; }
.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 190px;
  flex: 0 0 auto;
}
.hero-level-label {
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.75;
  margin-right: 8px;
}
.hero-level-value {
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}
.hero-level-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid;
  font-size: 12px;
  transition: all 0.3s ease;
}

/* ---------- TOP NAV дополнувања ---------- */
.gold { color: var(--gold, #d4af37); }
.brand-badge-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
  flex: 0 0 auto;
}
.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.top-nav .soft-status { font-size: 10.5px; }

/* ---------- Софтверски статус (sync pill) ---------- */
.sync-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.sync-pill i { font-size: 11px; }
.sync-pill.ok { background: rgba(52, 211, 153, 0.09); }
.sync-pill.working { background: rgba(251, 191, 36, 0.09); animation: blink 1.6s ease-in-out infinite; }
.sync-pill.offline { background: rgba(251, 113, 133, 0.09); }
.sync-sub { font-size: 9.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ---------- KPI мрежа: 5 колони за 10 картички ---------- */
.metrics-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------- Чипови под мапата ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid;
  font-size: 11px;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.chip:hover { transform: translateY(-1px); }
.chip-label { color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; }
.chip-sep { color: var(--text-dim); opacity: 0.5; }
.chip-value { font-variant-numeric: tabular-nums; }

/* ---------- Забелешки под блокови ---------- */
.panel-note {
  color: var(--text-soft);
  font-size: 10.5px;
  line-height: 1.55;
  margin-top: 8px;
}

/* ---------- Геотехнички анализи (редови) ---------- */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.analysis-rows { display: flex; flex-direction: column; gap: 8px; }
.analysis-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(125, 180, 255, 0.10);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.analysis-row:hover { transform: translateX(3px); border-color: rgba(34, 211, 238, 0.35); }
.analysis-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #041018;
  font-size: 13px;
}
.analysis-mid { min-width: 0; }
.analysis-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 2px;
}
.analysis-sub { font-size: 9.5px; color: var(--text-dim); line-height: 1.3; }
.analysis-valwrap { text-align: right; white-space: nowrap; }
.analysis-value { font-size: 15px; font-weight: 900; font-family: var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.analysis-unit { font-size: 10px; color: var(--text-dim); }
.analysis-class {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

/* ---------- Каталошки анализи (плочки + хистограм) ---------- */
.stat-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}
.stat-tile {
  padding: 10px 12px;
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(125, 180, 255, 0.10);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.stat-tile:hover { transform: translateY(-2px); border-color: rgba(167, 139, 250, 0.4); }
.stat-value { font-size: 19px; font-weight: 900; font-family: var(--font-display); font-variant-numeric: tabular-nums; line-height: 1.05; }
.stat-label { font-size: 9px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase; color: var(--text-soft); margin-top: 4px; }
.stat-sub { font-size: 9px; color: var(--text-dim); margin-top: 2px; }
.hist-wrap { margin: 8px -6px 2px -6px; }
.catalog-hist { border-radius: 12px; overflow: hidden; }

/* ---------- MINE PROXIMITY ---------- */
.mine-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.mine-row {
  padding: 10px 12px;
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(125, 180, 255, 0.10);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
}
.mine-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mine-head i { color: #f0d36d; font-size: 13px; }
.mine-name { font-size: 12.5px; font-weight: 800; color: var(--text); }
.mine-tag, .mine-blast-tag {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.mine-tag { background: rgba(52, 211, 153, 0.12); color: #5fe8b4; border: 1px solid rgba(52, 211, 153, 0.4); }
.mine-blast-tag { background: rgba(251, 146, 60, 0.14); color: #ffb36b; border: 1px solid rgba(251, 146, 60, 0.5); }
.mine-mid { display: flex; align-items: baseline; gap: 8px; }
.mine-dist { font-size: 14px; font-weight: 900; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.mine-r { font-size: 9.5px; color: var(--text-dim); }
.mine-bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); grid-column: 1 / -1; overflow: hidden; }
.mine-bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.mine-foot { font-size: 10px; color: var(--text-dim); }

/* ---------- EVENT SUMMARY (преглед на избраниот настан) ---------- */
.event-summary {
  margin-bottom: 10px;
  border-radius: 14px;
  padding: 11px 12px;
  background: linear-gradient(180deg, rgba(18, 28, 48, 0.82), rgba(10, 18, 32, 0.88));
  border: 1px solid rgba(125, 180, 255, 0.18);
}
.sum-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sum-mag {
  font-size: 24px;
  font-weight: 900;
  font-family: var(--font-display);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sum-place { font-size: 12px; font-weight: 700; color: var(--text); min-width: 0; }
.sum-tag {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.sum-rows { display: flex; flex-direction: column; gap: 4px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; line-height: 1.4; }
.sum-k { color: var(--text-dim); }
.sum-v { color: var(--text-soft); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.tsunami-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.10);
  color: #5fe8b4;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.tsunami-badge.on { background: rgba(251, 113, 133, 0.12); color: #fb8a9a; border-color: rgba(251, 113, 133, 0.5); }

/* ---------- Табела на настани ---------- */
.table-wrap { margin-top: 2px; }
.tbl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.tbl-hint { font-size: 10.5px; color: var(--text-soft); line-height: 1.4; }
.live-btn {
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.16s ease;
  white-space: nowrap;
}
.live-btn:hover { border-color: rgba(52, 211, 153, 0.65); }
.live-btn.active {
  background: linear-gradient(135deg, var(--green), var(--accent-2));
  color: #041018;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}
.events-table { border-radius: 14px; overflow: hidden; }
.events-table .dash-table-container { border-radius: 14px; }

/* ---------- Viz grid (timeline / mag-depth / catalog map / mining) ---------- */
.viz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.viz-box.wide { grid-column: 1 / -1; }

/* ---------- Влезни анимации ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.hero-strip { animation: riseIn 0.5s ease both; }
.metrics-grid .metric-card { animation: riseIn 0.45s ease both; }
.metrics-grid .metric-card:nth-child(2) { animation-delay: 0.04s; }
.metrics-grid .metric-card:nth-child(3) { animation-delay: 0.08s; }
.metrics-grid .metric-card:nth-child(4) { animation-delay: 0.12s; }
.metrics-grid .metric-card:nth-child(5) { animation-delay: 0.16s; }
.metrics-grid .metric-card:nth-child(6) { animation-delay: 0.20s; }
.metrics-grid .metric-card:nth-child(7) { animation-delay: 0.24s; }
.metrics-grid .metric-card:nth-child(8) { animation-delay: 0.28s; }
.metrics-grid .metric-card:nth-child(9) { animation-delay: 0.32s; }
.metrics-grid .metric-card:nth-child(10) { animation-delay: 0.36s; }
.panel, .hero-strip, .top-nav { animation: riseIn 0.55s ease both; }

/* ---------- Скролбар ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(6, 14, 26, 0.6); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.35), rgba(69, 96, 148, 0.35));
  border-radius: 999px;
  border: 2px solid rgba(6, 14, 26, 0.8);
}
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.55); }

::selection { background: rgba(34, 211, 238, 0.30); color: #ffffff; }

/* ---------- Focus (a11y) ---------- */
button:focus-visible, a:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.7);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- РЕСПОНЗИВНО ---------- */
@media (max-width: 1600px) {
  .metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1350px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1250px) {
  .analysis-grid, .viz-grid { grid-template-columns: 1fr; }
  .viz-box.wide { grid-column: auto; }
  .hero-strip { flex-direction: column; align-items: flex-start; }
  .hero-side { flex-direction: row; align-items: center; min-width: auto; flex-wrap: wrap; }
}
@media (max-width: 1000px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .analysis-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .analysis-class { grid-column: 2 / -1; justify-self: start; }
  .stat-tiles { grid-template-columns: 1fr; }
}
/* =========================================================
   КОМПАКТНИ РЕДОВИ НАД КАРТАТА (додадено 2026-10-20)
   Цел: да се намали висината на блоковите над 3D картата
   (hero-strip → now-banner → metrics-grid), за да се „покачи“
   картата горе и да се гледа веднаш при отворање.
   Овој блок е во modern.css намерно — тој се вчитува ПО events1.css,
   па правилата овде победуваат без !important.
   Сè е на едно место за лесно штелување.
   ========================================================= */

/* --- 1. ХЕРО-ЛЕНТА: покомпактна --- */
.hero-strip { padding: 12px 18px; margin-bottom: 8px; gap: 12px; }
.hero-title { font-size: clamp(18px, 2.2vw, 28px); }
.hero-subtitle { font-size: 12px; }
.eyebrow { font-size: 10.5px; letter-spacing: 1.6px; }
.hero-meta { font-size: 11.5px; }
.hero-side { gap: 5px; }

/* --- 2. ГОЛЕМ БАНЕР НА НАСТАНОТ: покомпактен, но од 2026-10-21 +5% висина,
   а од 2026-10-22 уште +10% (побарано: да не се сечат долните текстови) --- */
.now-banner { padding: 16px 22px; gap: 18px; }
.now-mag-value { font-size: 2.05rem; }
.now-cell { padding: 8px 14px; }

/* --- 3. KPI МРЕЖА: пониски картички --- */
.metric-card { padding: 7px 10px; gap: 9px; border-radius: 13px; }
.metric-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 12px;
}
.metric-title { font-size: 8.5px; }
.metric-value { font-size: 15.5px; }
.metric-subtitle { font-size: 8.5px; }

/* --- 4. ПОМАЛИ РАСТОЈАНИЈА МЕЃУ БЛОКОВИТЕ (ги качува сите) --- */
.main-wrap { gap: 9px; margin-top: 9px; }

/* --- 5. ГУСТА KPI МРЕЖА + ПОМАЛ ПАНЕЛ (картата уште погоре) --- */
.metrics-grid { gap: 8px; }
.map-panel { padding-top: 11px; }
.map-panel .panel-title { margin-bottom: 7px; }

/* =========================================================
   ПРОМЕНИ 2026-10-21
   А) КАРТАТА ВЕДНАШ ПОД „ПРИКАЖАН НАСТАН“ — цела ширина и
      доволно висока глобусот да се гледа БЕЗ скролување
   Б) S−P ЛЕНТА ЗА ПРИСТИГНУВАЊЕ ВО ГОЛЕМИОТ БАНЕР
   В) АТЕНУАЦИОНА КРИВА (PGA)
   ========================================================= */

/* --- А) Голем КВАДРАТЕН глобус горе (целата планета, 2026-10-21) --- */
.map-panel { width: 100%; }
.map-graph-prop, .map3d {
  width: min(100%, 90vh);
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 6px auto 0;
}
.map3d-status {
  font-size: 11.5px;
  width: min(100%, 90vh);
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 700px) {
  .map-graph-prop, .map3d { width: 100%; }
}

/* --- Б) S−P лента за пристигнување на брановите --- */
.sp-strip {
  flex-basis: 100%;
  min-width: 100%;
  padding-top: 12px;
  border-top: 1px dashed rgba(125, 180, 255, 0.22);
}
.sp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-soft);
}
.sp-head i { color: var(--accent); font-size: 11px; }
.sp-title-sp { color: var(--gold-2); }
.sp-title-hint {
  margin-left: auto;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: none;
  font-size: 9.5px;
  color: var(--text-dim);
}
.sp-bar {
  position: relative;
  padding-top: 16px;
  padding-bottom: 30px;   /* место за тиковите — инаку се сечат од overflow:hidden */
  margin: 0 3px;
}
.sp-track {
  display: flex;
  position: relative;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(125, 180, 255, 0.18);
}
.sp-seg-p {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.30), #22d3ee);
  box-shadow: inset 0 0 8px rgba(34, 211, 238, 0.45);
}
.sp-seg-s {
  background: linear-gradient(90deg, #fb923c, rgba(251, 146, 60, 0.70));
  box-shadow: inset 0 0 8px rgba(251, 146, 60, 0.40);
}
/* скенирачко светло: 1 циклус = 1 S−P прозорец (2.2 s) */
.sp-scan {
  position: absolute;
  top: 16px;
  left: 0;
  width: 3px;
  height: 10px;
  border-radius: 99px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 0 0 26px rgba(34, 211, 238, 0.8);
  animation: spScan 2.2s linear infinite;
}
@keyframes spScan {
  0%   { left: 0%; opacity: 0; }
  4%   { opacity: 1; }
  96%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-scan { animation: none; }
}
.sp-ticks {
  position: absolute;
  left: 0;
  top: 30px;
  width: 100%;
  height: 22px;
}
.sp-tick {
  position: absolute;
  top: 0;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-dim);
  white-space: nowrap;
}
.sp-tick-p { color: #22d3ee; }
.sp-tick-s { color: #fb923c; }

/* --- В) Атенуациона крива (PGA) --- */
.att-box .js-plotly-plot {
  border-radius: 13px;
  border: 1px solid rgba(125, 180, 255, 0.12);
  background: linear-gradient(180deg, rgba(4, 10, 19, 0.55), rgba(8, 16, 30, 0.75));
  overflow: hidden;
}

/* =========================================================
   ПРОМЕНА 2026-10-22: ЛЕГЕНДА ЛЕВО ОД ГЛОБУСОТ (+ глобус −20%)
   ========================================================= */
.globe-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 6px;
}
.globe-arena .map3d { margin: 0; }
@media (max-width: 1150px) {
  .globe-arena { flex-direction: column; gap: 10px; }
  .globe-arena .gl3d-legend { width: min(94%, 560px); }
}

/* =========================================================
   ПРОМЕНА 2026-10-22: „ШОК-БРАН“ ОД ЕПИЦЕНТАРОТ ВО КОСМОСОТ
   Светли прстени што тргнуваат од епицентарот и се шират
   преку глобусот и надвор од него — секогаш видливи.
   ========================================================= */
.burst-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
  border-radius: 16px;
}
.burst-ring {
  position: absolute;
  left: var(--bx, 50%);
  top: var(--by, 50%);
  width: 340px;
  height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  border: 4px solid var(--bc, #22d3ee);
  box-shadow:
    0 0 46px var(--bc, #22d3ee),
    0 0 90px rgba(34, 211, 238, 0.55),
    inset 0 0 42px rgba(255, 255, 255, 0.30);
  opacity: 0;
  animation: burstRing 2.6s cubic-bezier(0.16, 0.55, 0.3, 1) forwards;
  animation-delay: var(--bd, 0s);
}
@keyframes burstRing {
  0%   { transform: scale(0.10); opacity: 1; }
  60%  { opacity: 0.85; }
  100% { transform: scale(3.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .burst-ring { animation: none; }
}
