/* zeedili.com — tarayıcı çalışma alanı (IDE yerleşimi). site.css token'larını kullanır. */

.zee-workbench {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--header));
  min-height: 560px;
  background: var(--bg);
}

.wb-arac {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.wb-baslik { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wb-baslik h1 { font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.wb-eylem { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.wb-dugme {
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink-2);
  font-size: .86rem; font-weight: 560; cursor: pointer;
}
.wb-dugme:hover { background: var(--bg-sunk); color: var(--ink); }

.engine-state {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 .74rem/1 var(--mono); color: var(--muted); white-space: nowrap;
}
.engine-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.engine-state[data-state="ready"] { color: var(--ok); }
.engine-state[data-state="ready"]::before { background: var(--ok); }
.engine-state[data-state="loading"]::before { background: var(--warn); }
.engine-state[data-state="error"] { color: var(--err); }
.engine-state[data-state="error"]::before { background: var(--err); }

.wb-izgara {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(320px, 400px);
}

/* sol: örnekler + rehber */
.wb-yan {
  overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg-alt);
}
.wb-bolum { padding: 16px; border-bottom: 1px solid var(--line); }
.wb-bolum h2 {
  font: 700 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.example-list { display: grid; gap: 2px; }
.example-list button {
  display: grid; gap: 2px; text-align: left;
  padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer;
}
.example-list button b { font: 600 .84rem/1.3 var(--mono); color: var(--ink); }
.example-list button span { font-size: .8rem; color: var(--muted); }
.example-list button:hover { background: var(--bg-sunk); }
.example-list button.active { background: var(--bg); border-color: var(--line-2); box-shadow: inset 2px 0 0 var(--accent); }
.wb-rehber h3 { font-size: 1rem; margin-bottom: 6px; }
.wb-rehber p { color: var(--muted); font-size: .9rem; }
.kavramlar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.kavramlar span {
  font: 600 .74rem/1 var(--mono); padding: 5px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.wb-not { font-size: .84rem; color: var(--muted); border-bottom: 0; }
.wb-not b { display: block; color: var(--ink); margin-bottom: 4px; }

/* orta: düzenleyici */
.wb-editor {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--code-bg); color: var(--code-ink);
}
.wb-sekme {
  display: flex; align-items: center; justify-content: space-between;
  height: 38px; padding: 0 14px;
  background: var(--code-bg-2); border-bottom: 1px solid var(--code-line);
  font: 600 .78rem/1 var(--mono); color: var(--code-muted);
}
.wb-sekme span:first-child { color: #fff; }
.wb-yuzey { flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); }
.satir-no {
  margin: 0; padding: 16px 10px 16px 16px; overflow: hidden;
  font: .9rem/1.65 var(--mono); text-align: right; color: #3d4f70; user-select: none;
  border-right: 1px solid var(--code-line); min-width: 48px;
}
.wb-yuzey .editor { min-height: 0; height: 100%; }

/* sağ: konsol */
.wb-konsol {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-left: 1px solid var(--code-line); background: #050a14; color: var(--code-ink);
}
.console-tabs {
  display: flex; align-items: center; gap: 2px;
  height: 38px; padding: 0 8px; background: var(--code-bg-2); border-bottom: 1px solid var(--code-line);
}
.console-tabs button {
  height: 28px; padding: 0 10px; border: 0; border-radius: 5px;
  background: transparent; color: var(--code-muted);
  font: 600 .78rem/1 var(--mono); cursor: pointer;
}
.console-tabs button:hover { color: #fff; }
.console-tabs button.active { background: rgba(255, 255, 255, .08); color: #fff; }
.console-tabs span { margin-left: auto; font: .74rem/1 var(--mono); color: var(--code-muted); padding-right: 6px; }
#zee-output, #zee-diagnostics {
  flex: 1; min-height: 0; margin: 0; overflow: auto;
  padding: 14px 16px; font: .86rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
#zee-diagnostics.clean { color: #52d6b0; }

.input-box {
  border-top: 1px solid var(--code-line); padding: 12px 14px 14px; background: var(--code-bg-2);
  display: grid; gap: 8px;
}
.input-box label { font: 700 .7rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--code-muted); }
.input-box label small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.input-box textarea, .input-box input {
  width: 100%; border: 1px solid var(--code-line); border-radius: var(--radius-sm);
  background: #050a14; color: var(--code-ink); font: .84rem/1.5 var(--mono); padding: 8px 10px;
}
.input-box textarea { height: 76px; resize: vertical; }
.input-box textarea:focus, .input-box input:focus { outline: none; border-color: var(--accent); }
.seed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seed-row input { width: 110px; }

@media (max-width: 1100px) {
  .wb-izgara { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(220px, 38%); }
  .wb-yan { grid-row: 1 / span 2; }
  .wb-konsol { border-left: 0; border-top: 1px solid var(--code-line); }
}

@media (max-width: 760px) {
  .zee-workbench { height: auto; min-height: 0; }
  .wb-arac { flex-direction: column; align-items: stretch; }
  .wb-eylem { justify-content: flex-start; }
  .wb-eylem .run-button { margin-left: auto; }
  .wb-izgara { display: flex; flex-direction: column; }
  .wb-yan { order: 3; border-right: 0; border-top: 1px solid var(--line); }
  .example-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-editor { height: 56vh; min-height: 320px; }
  .wb-konsol { min-height: 280px; }
}
