﻿/* One Dark Pro Theme */
:root {
  --bg: #1e1e1e;
  --canvas-bg: #0d1117;
  --card: #282c34;
  --text: #abb2bf;
  --muted: #5c6370;
  --receiver: #61afef;
  --processor: #c678dd;
  --exporter: #98c379;
  --edge: #56b6c2;
  --primary: #61afef;
  --danger: #e06c75;
  --btn-primary: #528bff;
  --btn-secondary: #3e4451;
  --btn-text: #abb2bf;
  --editor-bg: #282c34;
  --editor-text: #abb2bf;
  --editor-gutter-bg: #21252b;
  --editor-gutter-text: #5c6370;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: 1fr; height: 100vh; overflow: hidden; }
#layout { display: flex; height: 100%; width: 100%; overflow: hidden; min-width: 0; }
aside { padding: 0; border-right: none; overflow: hidden; min-width: 260px; max-width: 50vw; width: 360px; resize: horizontal; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg); }
main { position: relative; background: var(--bg); overflow: hidden; min-height: 0; min-width: 0; flex: 1; }
h1 { margin: 0 0 12px; font-size: 18px; }
textarea { width: 100%; flex: 1; min-height: 0; background: transparent; color: transparent; border: none; padding: 0; font-family: "JetBrains Mono", Consolas, monospace; font-size: 12px; line-height: 1.4; position: relative; z-index: 2; resize: none; }
#flowInput { background: transparent; color: transparent; z-index: 2; flex: 1; display:none; }
input, select, textarea { font-family: inherit; }
input:not([type="checkbox"]):not([type="radio"]), select { background: #21252b; color: var(--text); border: 1px solid var(--muted); border-radius: 2px; padding: 6px 8px; font-size: 12px; }
button { background: var(--btn-primary); color: white; border: none; padding: 4px 8px; border-radius: 2px; cursor: pointer; font-weight: 500; margin-right: 4px; margin-top: 0; font-size: 12px; }
button.secondary { background: var(--btn-secondary); color: var(--btn-text); }
button.danger { background: var(--danger); color: white; }
.small { font-size: 11px; padding: 4px 10px; }
.status { margin: 0 8px; color: var(--muted); font-size: 12px; }
.panel { margin-bottom: 12px; }
.panel.card { display: flex; flex-direction: column; flex: 1; min-height: 0; margin-bottom: 0; }
.card { background: var(--card); border: 1px solid var(--muted); border-radius: 0; padding: 8px; box-shadow: none; }
label { font-size: 12px; color: var(--muted); }
.aside-label { display: block; padding: 12px 12px 8px 12px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; flex-shrink: 0; }
#canvas { display: block; width: 100%; height: 100%; background: var(--canvas-bg); min-width: 0; min-height: 0; cursor: grab; }
.context-menu { position: fixed; background: var(--card); border: 1px solid var(--muted); border-radius: 0; padding: 4px; display: none; z-index: 10; box-shadow: 0 6px 14px rgba(0,0,0,0.12); color: var(--text); min-width: 120px; }
.context-menu button { margin: 2px 0; width: 100%; text-align: left; font-size: 12px; padding: 4px 6px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 20; }
.modal .card { width: 520px; max-height: 80vh; overflow: auto; }
.modal textarea { min-height: 200px; background: #21252b; color: var(--text); border: 1px solid var(--muted); border-radius: 2px; padding: 8px; font-family: "JetBrains Mono", Consolas, monospace; font-size: 12px; }
.modal input:not([type="checkbox"]):not([type="radio"]), .modal select { background: #21252b; color: var(--text); border: 1px solid var(--muted); }
.graph-controls { display:flex; gap:6px; align-items:center; }
.graph-controls button { padding:6px 10px; font-size:12px; margin-top:0; }
.CodeMirror { height: 100%; border: none; font-size: 12px; font-family: "JetBrains Mono", Consolas, monospace; }
.CodeMirror-gutters { border-right: none; }
.panel.card .CodeMirror { flex: 1; min-height: 0; }
aside .CodeMirror { flex: 1; min-height: 0; }
.wizard-row { display:flex; flex-direction:column; gap:4px; margin-bottom:8px; }
.wizard-row label { font-size:11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.wizard-row input, .wizard-row select { padding:6px 8px; font-size:12px; background: #21252b; color: var(--text); border:1px solid var(--muted); border-radius: 2px; }
#wizardFields { display:flex; flex-direction:column; gap:6px; max-height: 320px; overflow:auto; }
#topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--muted); }
#topbar .brand { font-weight: 700; font-size: 16px; }
#topbar .top-actions { display: flex; gap: 8px; align-items: center; }
.menu-container { position: relative; }
.menu-btn { background: transparent; color: var(--text); border: 1px solid var(--muted); padding: 6px 12px; border-radius: 2px; cursor: pointer; font-size: 18px; line-height: 1; transition: all 0.2s; }
.menu-btn:hover { background: var(--btn-secondary); }
.menu-dropdown { display: none; position: absolute; top: 100%; left: 0; margin-top: 4px; background: var(--card); border: 1px solid var(--muted); border-radius: 2px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); min-width: 180px; z-index: 1000; }
.menu-dropdown.show { display: block; }
.menu-item { width: 100%; text-align: left; background: transparent; color: var(--text); border: none; padding: 10px 14px; cursor: pointer; font-size: 13px; transition: all 0.2s; border-bottom: 1px solid rgba(92, 99, 112, 0.3); }
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--btn-secondary); color: #fff; }
#footer { width: 100%; background: var(--card); border-top: 1px solid var(--muted); padding: 8px 14px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.footer-actions { display: flex; gap: 8px; align-items: center; }
.donate-link { color: var(--primary); text-decoration: none; font-size: 12px; padding: 4px 8px; border: 1px solid var(--primary); border-radius: 2px; transition: all 0.2s; }
.donate-link:hover { background: var(--primary); color: #fff; }
.intro-card { max-width: 600px; }
.intro-list { margin: 12px 0; padding-left: 20px; line-height: 1.6; }
.intro-list li { margin-bottom: 8px; }
.intro-actions { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
.intro-checkbox { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); cursor: pointer; }
.intro-checkbox input { margin-right: 6px; cursor: pointer; }
/* Custom scrollbars - estandarizadas para Chrome y Firefox */
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--muted) var(--bg);
}

/* Chrome, Safari, Edge */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 6px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #6e7681;
}

::-webkit-scrollbar-corner {
  background: var(--bg);
}

/* Responsive layout */
@media (max-width: 768px) {
  #layout { flex-direction: column; }
  aside { border-right: none; border-bottom: 1px solid var(--muted); resize: none; max-height: 40vh; width: 100%; max-width: 100%; flex-shrink: 0; }
  main { flex: 1; }
}
