/* ── popup.css ───────────────────────────────────────────────
   Modal styles for CF / Net Diagnostics dashboard.
   Tokens mirror connection.css — no separate import needed.
─────────────────────────────────────────────────────────── */

/* ── Overlay ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

/* ── Box ─────────────────────────────────────────────────── */
.modal-box {
  width: 100%;
  max-width: 400px;
  background: #121416;                  /* --bg1 */
  border: 1px solid #272930;            /* --border */
  border-radius: 4px;                   /* --r */
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),    /* inner rim */
    0 32px 64px rgba(0,0,0,.7);
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
  overflow: hidden;
  animation: modal-up .16s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes modal-up {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ── Header ──────────────────────────────────────────────── */
.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid #272930;     /* --border */
  background: #18191d;                  /* --bg2 */
}

/* coloured left accent bar — swap class for context */
.modal-header::before {
  content: '';
  display: block;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: #4d8ef0;                  /* --blue (default) */
  flex-shrink: 0;
}

.modal-header.warn::before  { background: #e09a3a; }  /* --amber */
.modal-header.err::before   { background: #e05252; }  /* --red   */
.modal-header.ok::before    { background: #3dba7e; }  /* --green */

/* ── Title ───────────────────────────────────────────────── */
.modal-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #e4e7f0;                       /* --text-hi */
  flex: 1;
}

/* optional close × button in header */
.modal-close {
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  background: none;
  border: none;
  color: #3d4251;                       /* --text-3 */
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color .12s, background .12s;
}
.modal-close:hover {
  color: #b8bcc8;
  background: rgba(255,255,255,.06);
}

/* ── Body ────────────────────────────────────────────────── */
.modal-body {
  padding: 18px 16px 20px;
}

.modal-text {
  font-size: 13px;
  line-height: 1.75;
  color: #666c7e;                       /* --text-2 */
}

/* highlighted inline value — wrap anything notable */
.modal-text code {
  font-family: inherit;
  font-size: 11px;
  color: #e09a3a;                       /* --amber */
  background: rgba(224,154,58,.12);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Divider (optional) ──────────────────────────────────── */
.modal-line {
  height: 1px;
  background: #272930;                  /* --border */
  margin: 16px 0;
}

/* ── Actions ─────────────────────────────────────────────── */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #1f2026;       /* --bg3 as subtle separator */
  background: #0d0e10;                  /* --bg, slightly recessed */
}

/* ── Buttons — match .topbar-btn from connection.css ─────── */
.modal-btn {
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 4px;                   /* --r */
  border: 1px solid #33363f;           /* --border2 */
  background: #1f2026;                  /* --bg3 */
  color: #b8bcc8;                       /* --text */
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}

/* ghost — secondary action */
.modal-btn.ghost {
  background: transparent;
  color: #666c7e;                       /* --text-2 */
  border-color: #272930;               /* --border */
}
.modal-btn.ghost:hover {
  background: #18191d;
  color: #b8bcc8;
  border-color: #33363f;
}

/* primary — confirm / proceed */
.modal-btn.primary {
  border-color: #e09a3a;               /* --amber */
  color: #e09a3a;
  background: rgba(224,154,58,.08);
}
.modal-btn.primary:hover {
  background: rgba(224,154,58,.18);
  border-color: #e09a3a;
  color: #f0b05a;
}

/* danger — destructive action */
.modal-btn.danger {
  border-color: #e05252;               /* --red */
  color: #e05252;
  background: rgba(224,82,82,.08);
}
.modal-btn.danger:hover {
  background: rgba(224,82,82,.16);
  color: #e87070;
}

/* success — positive confirm */
.modal-btn.success {
  border-color: #3dba7e;               /* --green */
  color: #3dba7e;
  background: rgba(61,186,126,.08);
}
.modal-btn.success:hover {
  background: rgba(61,186,126,.16);
  color: #5ecf96;
}

/* disabled state — any variant */
.modal-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
  pointer-events: none;
}