/* ==========================================================================
   Protium Tools — shared dark design system
   --------------------------------------------------------------------------
   Matched to the Protium MCP Gateway (mcp-gateway.protium.co.in): dark navy
   surfaces, blue accent, green/amber/red semantics, full-bleed app shell with
   a top nav bar. One tokenised foundation every tool inherits. Restraint over
   decoration — flat surfaces, hairline borders, one accent, 120ms motion.
   ========================================================================== */

:root {
  /* Surfaces — gateway navy ramp --------------------------------------- */
  --bg: #0b1322;
  --nav: #0e1626;
  --surface: #141f36;     /* cards / rows                                  */
  --surface-2: #1a2742;   /* raised panels (hero card)                     */
  --surface-3: #213152;   /* hover / controls                              */
  --field: #0e1830;       /* inputs, editor                                */
  --elevated: #1c2a48;

  /* Lines -------------------------------------------------------------- */
  --border: #243352;
  --border-strong: #33456b;
  --border-faint: rgba(255, 255, 255, 0.06);

  /* Text --------------------------------------------------------------- */
  --text: #e9eefb;
  --text-muted: #8e9cbd;
  --text-faint: #5c6a8c;

  /* Accent (blue, from gateway) ---------------------------------------- */
  --accent: #3b82f6;
  --accent-hover: #5a96f8;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-ring: rgba(59, 130, 246, 0.4);

  /* Semantic ----------------------------------------------------------- */
  --ok: #2fbf6c;
  --ok-soft: rgba(47, 191, 108, 0.13);
  --ok-border: rgba(47, 191, 108, 0.4);
  --bad: #ef5a6f;
  --bad-soft: rgba(239, 90, 111, 0.13);
  --bad-border: rgba(239, 90, 111, 0.4);
  --warn: #f5a623;
  --warn-soft: rgba(245, 166, 35, 0.14);

  /* Brand (kept for accents that should stay Protium) ------------------ */
  --brand-purple: #6558d3;

  /* Type --------------------------------------------------------------- */
  --font-sans: "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Poppins", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;

  /* Radius & shadow ---------------------------------------------------- */
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 13px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 28px -16px rgba(0, 0, 0, 0.7);

  /* Motion ------------------------------------------------------------- */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t: 120ms var(--ease);

  /* Layout ------------------------------------------------------------- */
  --content: 1240px;
  --nav-h: 56px;
  --status-h: 30px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent-soft); }

/* Full-bleed app shell: nav + fill + status, no page scroll -------------- */
body.pt-fill {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   Top nav bar (gateway style)
   ========================================================================== */
.pt-nav {
  flex: none;
  height: var(--nav-h);
  background: var(--nav);
  border-bottom: 1px solid var(--border);
}
.pt-nav-inner {
  height: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.pt-nav--wide .pt-nav-inner { max-width: none; }

.pt-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.pt-brand img { height: 30px; width: auto; filter: brightness(0) invert(1); opacity: 0.96; }
/* hairline divider between the Protium mark and the "Tools" wordmark */
.pt-brand::after {
  content: "Tools";
  padding-left: 13px;
  border-left: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-weight: 500;
}

.pt-nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.pt-nav-inner { position: relative; }

.pt-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pt-nav-user { font-size: 13px; color: var(--text-muted); }

/* status pill in nav (like "Connected") */
.pt-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  padding: 3px 10px;
  border-radius: 999px;
}
.pt-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.pt-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
  white-space: nowrap;
}
.pt-btn:hover { background: var(--surface-3); }
.pt-btn:active { transform: translateY(1px); }
.pt-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.pt-btn svg { width: 15px; height: 15px; flex: none; }

.pt-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pt-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.pt-btn--blue-ghost { background: transparent; border-color: var(--accent); color: var(--accent); }
.pt-btn--blue-ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }

.pt-btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.pt-btn--ghost:hover { background: var(--surface-2); color: var(--text); }

.pt-btn--sm { padding: 6px 11px; font-size: 12.5px; }
.pt-btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ==========================================================================
   Segmented control (nav tabs / view toggle)
   ========================================================================== */
.pt-segment {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  gap: 2px;
}
.pt-segment button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 7px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.pt-segment button:hover { color: var(--text); }
.pt-segment button.is-active { background: var(--accent); color: #fff; }

/* ==========================================================================
   Inputs
   ========================================================================== */
.pt-input,
.pt-textarea {
  font: inherit;
  width: 100%;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  transition: border-color var(--t), box-shadow var(--t);
}
.pt-input:focus,
.pt-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.pt-textarea { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; resize: vertical; }
.pt-input::placeholder,
.pt-textarea::placeholder { color: var(--text-faint); }

/* ==========================================================================
   Panels, badges, pills
   ========================================================================== */
.pt-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.pt-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.pt-badge--ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-border); }
.pt-badge--bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-border); }
.pt-badge--info { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-ring); }

.pt-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.pt-pill svg { width: 14px; height: 14px; }
.pt-pill--ok  { color: var(--ok);  background: var(--ok-soft);  border-color: var(--ok-border); }
.pt-pill--bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-border); }

/* ==========================================================================
   Status bar (replaces footer in full-bleed tools)
   ========================================================================== */
.pt-statusbar {
  flex: none;
  height: var(--status-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--nav);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
}
.pt-statusbar kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast
   ========================================================================== */
.pt-toast {
  position: fixed;
  bottom: calc(var(--status-h) + 16px);
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
  z-index: 1000;
}
.pt-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Utility
   ========================================================================== */
.pt-hidden { display: none !important; }
.pt-content { max-width: var(--content); margin: 0 auto; width: 100%; }

@media (max-width: 720px) {
  .pt-nav-center { position: static; transform: none; margin-left: auto; }
  .pt-nav-user { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
