/* ═══════════════════════════════════════════════════════════════
   Module Modals — Platform-wide interconnected modal system
   Allows cross-module references to open inline detail modals
   without navigating away from the current page.
   ═══════════════════════════════════════════════════════════════ */

/* ── Clickable reference styling ─────────────────────────────── */
.mod-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: text-decoration-style var(--transition-fast), color var(--transition-fast);
}
.mod-link:hover {
  text-decoration-style: solid;
  color: var(--accent-hover);
}

/* ── Overlay ─────────────────────────────────────────────────── */
body.mod-open { overflow: hidden; }

.mod-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.mod-overlay.active {
  display: flex;
}

/* ── Modal card ──────────────────────────────────────────────── */
.mod-modal {
  max-width: 620px;
  width: 92vw;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mod-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mod-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ── Header ──────────────────────────────────────────────────── */
.mod-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mod-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.mod-title {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.mod-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  line-height: 1;
}
.mod-close:hover {
  border-color: var(--border-hi);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Body (scrollable) ───────────────────────────────────────── */
.mod-body {
  overflow-y: auto;
  padding: 20px 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-md) transparent;
}
.mod-body::-webkit-scrollbar { width: 6px; }
.mod-body::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }

.mod-summary {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.72;
  margin-bottom: 22px;
}

/* Capabilities heading */
.mod-caps-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* Capabilities grid */
.mod-caps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.mod-cap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.mod-cap-icon {
  font-size: 16px;
  margin-bottom: 6px;
}
.mod-cap-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.mod-cap-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Compliance callout */
.mod-compliance {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin-bottom: 0;
}
.mod-compliance-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.mod-compliance-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────────── */
.mod-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.mod-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.mod-nav-btn:hover {
  border-color: var(--border-hi);
  color: var(--accent);
  background: var(--accent-dim);
}
.mod-footer-spacer { flex: 1; }
.mod-footer .btn { font-size: 13px; padding: 8px 18px; }

/* ── Responsive — mobile bottom sheet ────────────────────────── */
@media (max-width: 640px) {
  .mod-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .mod-modal {
    max-width: 100%;
    width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: mod-in-mobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes mod-in-mobile {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: none; }
  }
  .mod-caps-grid {
    grid-template-columns: 1fr;
  }
}
