/* ==========================================================================
   Oxus Viz — Shared Modal Design Language
   Used by every viz app's intro/about modal. Match resource-tracker's polish.
   Link this from each viz's index.html / map.html.
   ========================================================================== */

.oxus-modal-overlay {
  /* !important on display to beat Bootstrap 3's `.show { display: block !important }` utility class,
     which collides with our `.show` state class on viz apps that load Bootstrap. */
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(15, 61, 56, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: calc(64px + 20px) 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.oxus-modal-overlay.show {
  display: flex !important;
  animation: oxus-modal-fade 0.2s ease-out;
}
@keyframes oxus-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.oxus-modal {
  position: relative;
  background: #fff;
  border-radius: 10px;
  max-width: 560px;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  animation: oxus-modal-pop 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes oxus-modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Floating close button (layered on hero) ---- */
.oxus-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.35);
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s, transform 0.15s;
}
.oxus-modal-close:hover {
  background: rgba(255, 255, 255, 0.32);
  color: #fff;
  transform: scale(1.05);
}

/* ---- Hero ---- */
.oxus-modal-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 28px 22px;
  background: linear-gradient(135deg, #0F3D38 0%, #146B60 60%, #00AA9B 100%);
  color: #fff;
  flex-shrink: 0;
}
.oxus-modal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.4) 0, transparent 30%),
    repeating-linear-gradient(45deg, transparent 0, transparent 14px, rgba(255, 255, 255, 0.08) 14px, rgba(255, 255, 255, 0.08) 15px);
}
.oxus-modal-kicker {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #F1D240;
}
.oxus-modal-title {
  position: relative;
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.oxus-modal-title-accent {
  color: #F1D240;
}
.oxus-modal-subtitle {
  position: relative;
  margin: 0;
  max-width: 440px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

/* ---- Body (scrolls internally) ---- */
.oxus-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  padding: 20px 28px 24px;
  font-size: 13px;
  line-height: 1.6;
  color: #444;
}
.oxus-modal-body p {
  margin: 0 0 12px;
}
.oxus-modal-body p:last-child {
  margin-bottom: 0;
}
.oxus-modal-body a {
  color: #00AA9B;
  text-decoration: none;
}
.oxus-modal-body a:hover {
  text-decoration: underline;
}
.oxus-modal-body strong {
  color: #222;
  font-weight: 700;
}
.oxus-modal-body ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.oxus-modal-body li {
  margin-bottom: 4px;
}
.oxus-modal-body h5 {
  margin: 18px 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
}

/* ---- Project-link pill (optional) ---- */
.oxus-modal-project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 14px 0 18px;
  background: rgba(0, 170, 155, 0.06);
  border: 1px solid rgba(0, 170, 155, 0.2);
  border-left: 3px solid #00AA9B;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.oxus-modal-project-link:hover {
  background: rgba(0, 170, 155, 0.1);
  border-color: rgba(0, 170, 155, 0.4);
  transform: translateX(2px);
}
.oxus-modal-project-link-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
}
.oxus-modal-project-link-title {
  font-size: 13px;
  font-weight: 700;
  color: #00AA9B;
  text-align: right;
}

/* ---- Footer note (small text below body) ---- */
.oxus-modal-footer-note {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid #eee;
  font-size: 11px;
  color: #888;
  line-height: 1.5;
}

/* ---- Tabs (for viz apps that have About / Contact splits) ---- */
.oxus-modal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  margin: -1px 0 0;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.oxus-modal-tab {
  position: relative;
  z-index: 1;
  padding: 14px 4px;
  margin-bottom: -1px;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #888;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 170, 155, 0.2);
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.15s, border-color 0.15s;
  flex: 1;
  text-align: center;
}
.oxus-modal-tab + .oxus-modal-tab {
  margin-left: 16px;
}
.oxus-modal-tab:hover {
  color: #00AA9B;
}
.oxus-modal-tab.active {
  color: #0F3D38;
  border-bottom-color: #00AA9B;
}
.oxus-modal-tab-panel {
  display: none;
}
.oxus-modal-tab-panel.active {
  display: block;
}

/* ---- Mobile refinements ---- */
@media (max-width: 500px) {
  .oxus-modal-hero { padding: 22px 20px 18px; }
  .oxus-modal-title { font-size: 20px; }
  .oxus-modal-body { padding: 16px 20px 20px; }
  .oxus-modal-project-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .oxus-modal-project-link-title { text-align: left; }
  .oxus-modal-tabs { padding: 0 20px; }
}
