/* IVR Designer - shares BPOC dashboard tokens: indigo #4f46e5, violet #7c3aed, dark sidebar #191330 */

:root{
    --ivr-indigo:#4f46e5;
    --ivr-violet:#7c3aed;
    --ivr-bg:#f6f5fb;
    --ivr-panel:#ffffff;
    --ivr-border:#e4e1f2;
    --ivr-text:#1f1b33;
    --ivr-muted:#7a7594;
}

.builder-shell{ display:flex; flex-direction:column; height:calc(100vh - 60px); background:var(--ivr-bg); }

.builder-topbar{
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 20px; background:var(--ivr-panel); border-bottom:1px solid var(--ivr-border);
}
.builder-title{ display:flex; align-items:center; gap:12px; }
.builder-title h2{ margin:0; font-family:'Space Grotesk', sans-serif; font-size:18px; color:var(--ivr-text); }
.back-link{ color:var(--ivr-muted); text-decoration:none; font-size:13px; }
.builder-actions{ display:flex; align-items:center; gap:10px; }

.builder-body{ flex:1; display:grid; grid-template-columns:220px 1fr 280px; overflow:hidden; }

.node-palette{
    background:var(--ivr-panel); border-right:1px solid var(--ivr-border); padding:16px; overflow-y:auto;
}
.node-palette h4{ margin:0 0 12px; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--ivr-muted); }
.palette-item{
    padding:10px 12px; margin-bottom:8px; border-radius:8px; background:#f1effa;
    border:1px solid var(--ivr-border); cursor:grab; font-size:13px; color:var(--ivr-text);
    transition:transform .12s ease, box-shadow .12s ease;
}
.palette-item:hover{ box-shadow:0 2px 8px rgba(79,70,229,.15); transform:translateY(-1px); }
.palette-hint{ margin-top:16px; line-height:1.5; }

.drawflow-canvas{
    position:relative; background:
        linear-gradient(90deg, rgba(79,70,229,.04) 1px, transparent 1px),
        linear-gradient(rgba(79,70,229,.04) 1px, transparent 1px);
    background-size:24px 24px;
    background-color:#fbfaff;
}

.node-properties{
    background:var(--ivr-panel); border-left:1px solid var(--ivr-border); padding:16px; overflow-y:auto;
}
.node-properties h4{ margin:0 0 12px; font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--ivr-muted); }
.node-properties label{ display:block; font-size:12px; color:var(--ivr-muted); margin:12px 0 4px; }
.node-properties label.checkbox-label{ display:flex; align-items:flex-start; gap:8px; font-size:12.5px; color:var(--ivr-text); line-height:1.4; }
.node-properties label.checkbox-label input{ width:auto; margin-top:2px; }
.node-properties input, .node-properties textarea, .node-properties select{
    width:100%; padding:8px 10px; border:1px solid var(--ivr-border); border-radius:6px; font-size:13px; box-sizing:border-box;
}
.prop-actions{ display:flex; gap:8px; margin-top:16px; }

/* Drawflow node styling */
.drawflow .drawflow-node{
    background:transparent; padding:0; border:none; box-shadow:none; width:auto; min-width:170px;
}
.drawflow-node-inner{
    border-radius:10px; background:linear-gradient(135deg, var(--ivr-indigo), var(--ivr-violet)); color:#fff;
    box-shadow:0 4px 14px rgba(79,70,229,.25); font-size:13px; overflow:hidden;
}
.node-main{ display:flex; align-items:center; gap:8px; padding:10px 14px; }
.node-icon{ font-size:16px; }
.node-label{ font-weight:600; }
.node-voice-badge{ margin-left:6px; font-size:12px; }
.drawflow .drawflow-node.selected .drawflow-node-inner{ outline:2px solid #191330; outline-offset:2px; }

/* AI IVR nodes get a distinct teal/cyan gradient so they read as "the AI one" at a glance during a demo */
.node-type-ai_ivr{ background:linear-gradient(135deg, #0891b2, #0e7490) !important; box-shadow:0 4px 14px rgba(8,145,178,.3) !important; }

/* Legend rows for DTMF/Speech menu nodes — one row per output, roughly aligned to each output dot */
.node-port-legend{ border-top:1px solid rgba(255,255,255,.25); background:rgba(0,0,0,.12); }
.port-row{
    padding:6px 14px; font-size:11.5px; white-space:nowrap; border-bottom:1px solid rgba(255,255,255,.08);
}
.port-row:last-child{ border-bottom:none; }

/* Drawflow spaces multiple outputs evenly down the right edge by default;
   give menu nodes extra height so each legend row has room to breathe next to its dot */
.drawflow .drawflow-node.ivr-node .outputs{ justify-content:flex-start; padding-top:44px; }
.drawflow .drawflow-node.ivr-node .output{ height:27px; }

.drawflow .connection .main-path{ stroke:#a5a0c9; stroke-width:2px; }
.drawflow .connection .main-path:hover{ stroke:var(--ivr-indigo); }

/* Buttons / badges reused across ivr views */
.btn-primary{ background:linear-gradient(135deg, var(--ivr-indigo), var(--ivr-violet)); color:#fff; border:none; padding:9px 16px; border-radius:8px; font-size:13px; cursor:pointer; }
.btn-ghost{ background:#fff; color:var(--ivr-text); border:1px solid var(--ivr-border); padding:9px 16px; border-radius:8px; font-size:13px; cursor:pointer; text-decoration:none; }
.btn-danger{ background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; padding:6px 10px; border-radius:6px; font-size:12px; cursor:pointer; }
.btn-sm{ padding:6px 10px; font-size:12px; }
.muted{ color:var(--ivr-muted); }
.small{ font-size:12px; }

.badge{ padding:3px 9px; border-radius:999px; font-size:11px; font-weight:600; }
.badge-draft{ background:#fef3c7; color:#92400e; }
.badge-published{ background:#dcfce7; color:#166534; }
.badge-archived{ background:#e5e7eb; color:#4b5563; }
