/* ============================================================
   glo.css — Διερμηνευτής ΓΛΩΣΣΑΣ/Ψευδογλώσσας · Didactics
   Brand tokens: DESIGN-SYSTEM.md (teal #005959, gold #FFCD57,
   Geologica, κουτιά 18px, κουμπιά 50px pill).
   ============================================================ */
.glo-app {
  --teal: #005959;
  --teal-dark: #004949;
  --gold: #FFCD57;
  --ink: #1F1F1F;
  --ink-deep: #003333;
  --surface: #ffffff;
  --surface-2: #f8f7f5;
  --surface-3: #e8e7e2;
  --muted: #5b6b6b;
  --line: rgba(0, 51, 51, .10);
  --line-strong: rgba(0, 51, 51, .18);
  --err: #b3261e;
  --err-bg: #fdecea;
  --ok: #1b7f4d;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.glo-app *, .glo-app *::before, .glo-app *::after { box-sizing: border-box; }

/* ---------- Κεφαλίδα ---------- */
.glo-head { margin-bottom: 18px; }
.glo-head h1 {
  color: var(--teal); font-weight: 700; letter-spacing: -.02em;
  line-height: 1.12; font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: 0 0 6px;
}
.glo-head p { color: var(--muted); margin: 0; font-size: .95rem; line-height: 1.5; }

/* ---------- Toolbar ---------- */
/* Ίδιες στήλες με το .glo-grid ώστε τα selects να ευθυγραμμίζονται με την κονσόλα */
.glo-toolbar {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 10px 14px; align-items: center; margin-bottom: 14px;
}
.glo-toolbar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.glo-toolbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.glo-toolbar-right .glo-select { flex: 1 1 0; min-width: 0; }
@media (max-width: 900px) { .glo-toolbar { grid-template-columns: 1fr; } }
.glo-btn {
  font-family: inherit; font-weight: 600; font-size: .92rem;
  border-radius: 50px; padding: 10px 22px; cursor: pointer;
  border: 2px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .15s ease;
}
.glo-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(0, 51, 51, .28); }
.glo-btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.glo-btn--run { background: var(--gold); color: var(--ink-deep); border-color: var(--gold); }
.glo-btn--step { background: var(--teal); color: #fff; border-color: var(--teal); }
.glo-btn--ghost { background: transparent; color: var(--teal); border-color: var(--line-strong); }
.glo-btn--ghost:hover { border-color: var(--teal); }
.glo-btn--stop { background: transparent; color: var(--err); border-color: var(--err); display: none; }
.glo-select {
  font-family: inherit; font-size: .88rem; color: var(--ink-deep);
  border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 9px 34px 9px 14px; background: var(--surface); cursor: pointer;
  /* appearance:none αλλιώς Safari/Chrome ζωγραφίζουν native κουτί και αγνοούν το radius */
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23003333' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
@media (max-width: 640px) {
  .glo-toolbar-right { flex-wrap: wrap; }
  .glo-toolbar-right .glo-select { flex: 1 1 100%; }
}

/* ---------- Grid ---------- */
.glo-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; }
@media (max-width: 900px) { .glo-grid { grid-template-columns: 1fr; } }

.glo-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 51, 51, .06), 0 1px 2px rgba(0, 51, 51, .04);
}
.glo-box-title {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 8px;
}
.glo-box-title .glo-mini { margin-left: auto; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--muted); }

/* ---------- Editor ---------- */
.glo-ed { position: relative; display: flex; min-height: 380px; max-height: 560px; background: var(--surface); }
.glo-ed-gutter {
  flex: 0 0 auto; min-width: 44px; padding: 12px 8px 12px 4px; text-align: right;
  font-family: var(--mono); font-size: .88rem; line-height: 1.5;
  color: #9aa8a8; background: var(--surface-2); border-right: 1px solid var(--line);
  user-select: none; overflow: hidden; white-space: pre;
}
.glo-ed-gutter .errln { color: var(--err); font-weight: 700; }
.glo-ed-main { position: relative; flex: 1; overflow: auto; }
.glo-ed-hl, .glo-ed-ta {
  font-family: var(--mono); font-size: .88rem; line-height: 1.5;
  padding: 12px 14px; margin: 0; border: 0; white-space: pre; tab-size: 4;
}
.glo-ed-hl {
  position: absolute; inset: 0; pointer-events: none; overflow: visible;
  color: var(--ink); min-width: 100%; width: max-content; min-height: 100%;
}
.glo-ed-ta {
  position: relative; display: block; width: 100%; height: 100%; resize: none;
  background: transparent; color: transparent; caret-color: var(--ink-deep);
  outline: none; overflow: hidden; overscroll-behavior: contain;
}
.glo-ed-hl .k { color: #0550ae; font-weight: 600; }     /* keywords */
.glo-ed-hl .s { color: #0a7a4a; }                        /* strings */
.glo-ed-hl .n { color: #953800; }                        /* αριθμοί */
.glo-ed-hl .c { color: #8b949e; font-style: italic; }    /* σχόλια */
.glo-ed-hl .line { display: block; min-height: 1.5em; }
.glo-ed-hl .line.err { background: var(--err-bg); border-radius: 4px; }
.glo-ed-hl .line.active { background: rgba(255, 205, 87, .35); border-radius: 4px; }

/* ---------- Κονσόλα ---------- */
.glo-console-wrap { display: flex; flex-direction: column; max-height: 320px; }
.glo-console {
  list-style: none; margin: 0; padding: 10px 14px; overflow: auto; flex: 1;
  font-family: var(--mono); font-size: .88rem; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; min-height: 120px;
}
.glo-console li.err { color: var(--err); }
.glo-console li.hint { color: var(--teal); }
.glo-console li.in { color: var(--muted); }
.glo-console li.sys { color: var(--muted); font-style: italic; }
.glo-inputrow {
  display: none; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line);
  background: #fffbef; align-items: center;
}
.glo-inputrow.active { display: flex; }
.glo-inputrow label { font-size: .82rem; color: var(--ink-deep); font-weight: 600; white-space: nowrap; }
.glo-inputrow input {
  flex: 1; min-width: 60px; font-family: var(--mono); font-size: .9rem;
  border: 1px solid var(--line-strong); border-radius: 18px; padding: 8px 12px; outline: none;
}
.glo-inputrow input:focus { border-color: var(--teal); }
.glo-inputrow button {
  font-family: inherit; font-weight: 600; font-size: .82rem; cursor: pointer;
  background: var(--teal); color: #fff; border: 0; border-radius: 50px; padding: 8px 16px;
}

/* ---------- Πίνακας τιμών ---------- */
.glo-vars { max-height: 300px; overflow: auto; }
.glo-vars table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.glo-vars th {
  text-align: left; font-weight: 600; color: var(--teal); font-size: .75rem;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--surface);
}
.glo-vars td { padding: 6px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.glo-vars td.name { color: var(--ink-deep); font-weight: 600; }
.glo-vars td.novalue { color: #b9b9b9; font-style: italic; }
.glo-vars .glo-vars-scope {
  padding: 6px 14px; font-size: .75rem; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.glo-vars-empty { padding: 14px; color: var(--muted); font-size: .85rem; }

/* ---------- Status ---------- */
.glo-status { margin-top: 10px; font-size: .85rem; color: var(--muted); min-height: 1.3em; }
.glo-status.ok { color: var(--ok); }
.glo-status.err { color: var(--err); }

/* ---------- Footer ---------- */
.glo-foot {
  margin-top: 28px; padding: 22px 24px;
  background: var(--teal-dark); border-radius: 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px;
}
.glo-foot-copy { color: rgba(255, 255, 255, .85); font-size: .88rem; flex: 1 1 auto; }
.glo-foot-credit { margin-top: 4px; font-size: .82rem; color: rgba(255, 255, 255, .65); }
/* !important: το global link color του Kajabi (teal #005959) αλλιώς νικάει και ο
   σύνδεσμος εξαφανίζεται πάνω στο teal footer — μετρημένο live 31/7 */
.glo-app .glo-foot-credit a {
  color: var(--gold) !important; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; transition: color .15s ease;
}
.glo-app .glo-foot-credit a:hover { color: #fff !important; }
.glo-foot-right { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.glo-foot-socials { display: flex; align-items: center; gap: 10px; }
.glo-soc {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28); color: #fff;
  transition: color .15s ease, border-color .15s ease, transform .18s ease;
}
.glo-soc svg { width: 17px; height: 17px; }
.glo-soc:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-2px); }
.glo-foot-cta.glo-btn { text-decoration: none; display: inline-block; }
@media (max-width: 640px) {
  .glo-foot { flex-direction: column; text-align: center; }
  .glo-foot-right { flex-direction: column; }
}
