/* Call Flow App – Light (Xelion) theme
   - Primary accent: #FF5D15
   - Font: Urbanist (fallbacks)
   Add this to your HTML <head> to load Urbanist:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Urbanist:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
*/

:root{
  /* Brand */
  --primary: #FF5D15;
  --primary-2: #ff7a3f;

  /* Neutrals */
  --bg: #f6f7f9;
  --panel: #f5f5f5;
  --card: #ffffff;

  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15,23,42,.10);

  /* Buttons */
  --btn: rgba(15,23,42,.06);
  --btn2: rgba(15,23,42,.10);

  /* Focus glow */
  --focus-ring: rgba(255,93,21,.28);
  --focus-border: rgba(255,93,21,.65);

  /* Status */
  --ok: #16a34a;
  --warn: #FF5D15;
  --inactive: #94a3b8;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: "Urbanist", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Links */
a{ color: var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }

/* App Shell */
.app-shell header{
  position: sticky;
  top: 0;
  background: rgba(246,247,249,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.app-main{
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
}

.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  border-bottom: 1px solid var(--line);
}

.card-title{
  font-weight: 800;
  letter-spacing: .2px;
}

/* Section titles (small caps feel) */
.section-title{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Table -> “rows as cards” */
.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-size: 14px;
}

.table thead th{
  text-align:left;
  color: rgba(15,23,42,.65);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 0 10px 6px 10px;
}

.table tbody td{
  padding: 12px 10px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.table tbody tr td:first-child{
  border-left: 1px solid var(--line);
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

.table tbody tr td:last-child{
  border-right: 1px solid var(--line);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.table tbody tr{
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
  transform: translateY(0);
  transition: box-shadow .12s ease, transform .12s ease, background .12s ease;
}

.table tbody tr:hover{
  box-shadow: 0 10px 24px rgba(15,23,42,.10);
  transform: translateY(-1px);
}

/* Inputs */
.input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.16);
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.input:focus{
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Password masking hint (applies when you add the attribute in HTML)
   input[type="password"] { font-family: inherit; }
*/

/* Buttons */
.btn{
  border: 1px solid rgba(15,23,42,.14);
  background: #ffffff;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 6px 14px rgba(15,23,42,.06);
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}

.btn:hover{
  background: rgba(15,23,42,.03);
  box-shadow: 0 10px 18px rgba(15,23,42,.08);
}

.btn:active{
  transform: translateY(1px);
}

.btn:disabled{
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary{
  background: var(--primary);
  border-color: rgba(0,0,0,.08);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(255,93,21,.18);
}

.btn-primary:hover{
  background: var(--primary-2);
}

.btn-danger{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.22);
  color: #7f1d1d;
}

.btn-danger:hover{
  background: rgba(239,68,68,.16);
}

/* Canvas layout */
.canvas-column{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

/* Toolbar */
.toolbar{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Tool pills (draggable) */
.tool-pill{
  display:flex;
  gap: 8px;
  align-items:center;
  border: 1px solid rgba(15,23,42,.14);
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: grab;
  user-select:none;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.tool-pill:active{ cursor: grabbing; }

.dot{
  width:10px;
  height:10px;
  border-radius: 999px;
}

/* Canvas wrapper */
.flow-canvas-wrapper{
  position: relative;
  height: calc(100vh - 190px);
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
}

/* Zoom controls */
.zoom-controls{
  position:absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display:flex;
  gap: 8px;
  align-items:center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.flow-canvas{
  position: absolute;
  inset: 0;
  overflow: auto;
}

.flow-content{
  position: relative;
  width: 3000px;
  height: 2200px;
}

/* Faint grid */
.flow-content::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:
    linear-gradient(to right, rgba(15,23,42,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,.06) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: .55;
  pointer-events:none;
}

/* Nodes */
.flow-node{
  position:absolute;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--node-border, rgba(15,23,42,.14));
  background: var(--node-bg, rgba(255,93,21,.10));
  color: var(--text);
  box-shadow: 0 10px 22px rgba(15,23,42,.10);
  cursor: grab;
  user-select:none;
  z-index: 2;
}

.flow-node.selected{
  outline: 3px solid var(--focus-ring);
}

.flow-node-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}

.flow-node-title{
  font-weight: 800;
  font-size: 13px;
  max-width: 128px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-node-type-badge{
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(15,23,42,.10);
  color: rgba(15,23,42,.80);
}

.flow-node-sub{
  margin-top: 4px;
  font-size: 11px;
  color: rgba(15,23,42,.72);
  max-width: 160px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ports */
.flow-node-port{
  position:absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid rgba(255,93,21,.55);
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15,23,42,.10);
}
.flow-node-port--top{ top: -7px; left: calc(50% - 6px); }
.flow-node-port--right{ right: -7px; top: calc(50% - 6px); }
.flow-node-port--bottom{ bottom: -7px; left: calc(50% - 6px); }
.flow-node-port--left{ left: -7px; top: calc(50% - 6px); }

/* SVG connectors */
.flow-connections{
  z-index: 1;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow: visible;
}

.conn{
  fill:none;
  stroke: rgba(15,23,42,.45);
  stroke-width: 2.0;
}

.conn.selected{
  stroke: rgba(255,93,21,.95);
  stroke-width: 2.6;
}

.conn-hit{
  fill:none;
  stroke: rgba(255,255,255,0);
  stroke-width: 18;
  cursor: pointer;
}

/* Waypoints */
.wp rect{
  fill: rgba(255,93,21,.95);
  stroke: rgba(0,0,0,.12);
  stroke-width: 1;
  rx: 3;
  ry: 3;
}
.wp-hit{
  fill: rgba(255,255,255,0);
  stroke: rgba(255,255,255,0);
  stroke-width: 1;
}

/* Properties panel helpers */
.hint{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

/* AA grid */
.aa-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.aa-row{
  display:grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items:center;
}

.aa-digit{
  font-size: 12px;
  color: rgba(15,23,42,.65);
}

.aa-full{
  grid-column: 1 / -1;
}

.aa-check{
  display:flex;
  gap: 8px;
  align-items:center;
  color: rgba(15,23,42,.72);
  font-size: 12px;
}

/* Radio cards */
.radio-group{
  display:grid;
  gap: 8px;
}

.radio-item{
  display:flex;
  gap: 8px;
  align-items:flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}

.radio-item strong{
  display:block;
  font-size: 12px;
  color: rgba(15,23,42,.90);
  font-weight: 800;
}

.radio-item span{
  display:block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
}

/* Status pills (optional use)
   <span class="pill pill-ok">OK</span>
*/
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.04);
  color: rgba(15,23,42,.75);
}

.pill-ok{
  background: rgba(22,163,74,.10);
  border-color: rgba(22,163,74,.22);
  color: rgba(22,163,74,.95);
}

.pill-warn{
  background: rgba(255,93,21,.12);
  border-color: rgba(255,93,21,.26);
  color: rgba(255,93,21,.95);
}

.pill-inactive{
  background: rgba(148,163,184,.18);
  border-color: rgba(148,163,184,.32);
  color: rgba(71,85,105,.95);
}

/* Monospace helper for IDs/tokens/debug */
.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Debug blocks */
pre, code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

pre{
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  padding: 12px;
  overflow:auto;
  color: rgba(15,23,42,.90);
}

/* Accessibility */
:focus-visible{
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
