/* SSH-Simulant – Layout der Konsole, des Datei-Panels und der Login-Karte. */

/* Wichtig: eigene display-Regeln überschreiben sonst das [hidden]-Attribut. */
[hidden] { display: none !important; }

.ssh-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------------------------------------------------- Login / Setup ------- */
.ssh-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.ssh-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem 1.6rem 1.2rem;
}
.ssh-logo { font-size: 1.4rem; margin-bottom: 1.2rem; }
.ssh-field { display: block; margin-bottom: .9rem; }
.ssh-field > span { display: block; margin-bottom: .25rem; color: var(--fg-dim); font-size: 12.5px; }
.ssh-field input,
.ssh-codebox {
  width: 100%;
  font: inherit;
  padding: .55rem .65rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ssh-field input:focus,
.ssh-codebox:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.ssh-codebox { font-family: var(--mono); font-size: 12px; resize: vertical; margin-bottom: .6rem; white-space: pre; }
.ssh-card .ssh-btn--primary { width: 100%; justify-content: center; margin-top: .3rem; }
.ssh-card form + .ssh-muted,
.ssh-card .ssh-muted.ssh-tiny { margin-top: 1rem; margin-bottom: 0; }

/* ---------------------------------------------------- Header -------------- */
.ssh-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .8rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ssh-header__title { font-weight: 600; }
.ssh-header__cwd {
  font-family: var(--mono); font-size: 12.5px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .2rem .5rem;
  max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ssh-header__spacer { flex: 1; }
.ssh-inline-form { display: inline; margin: 0; }

/* ---------------------------------------------------- Banner -------------- */
.ssh-banner { padding: .55rem .9rem; font-size: 13px; border-bottom: 1px solid var(--border); }
.ssh-banner--warn { background: var(--warn-bg); color: var(--warn); }

/* ---------------------------------------------------- Main / Panes -------- */
.ssh-main {
  flex: 1;
  display: flex;
  min-height: 0;
}
.ssh-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ssh-pane--terminal { flex: 1 1 60%; background: #0c0f12; }
.ssh-pane--files {
  flex: 0 0 38%;
  max-width: 560px;
  border-left: 1px solid var(--border);
  background: var(--bg-2);
}
.ssh-body.ssh-files-hidden .ssh-pane--files { display: none; }

.ssh-terminal { flex: 1; min-height: 0; padding: .4rem .2rem .4rem .5rem; }
.ssh-terminal .xterm { height: 100%; }

/* ---------------------------------------------------- Datei-Panel --------- */
.ssh-files { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ssh-files__toolbar {
  display: flex; align-items: center; gap: .35rem;
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ssh-files__path {
  flex: 1; min-width: 80px;
  font-family: var(--mono); font-size: 12px;
  color: var(--fg-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: .25rem .4rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.ssh-files__list { list-style: none; margin: 0; padding: .2rem 0; overflow: auto; flex: 1; font-family: var(--mono); font-size: 13px; }
.ssh-file-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .22rem .6rem;
  cursor: default;
}
.ssh-file-row:hover { background: var(--bg-3); }
.ssh-file-row__icon { width: 1.1em; text-align: center; flex: none; }
.ssh-file-row__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssh-file-row__name.is-dir { color: var(--info); cursor: pointer; }
.ssh-file-row__name.is-link { font-style: italic; }
.ssh-file-row__meta { color: var(--fg-faint); font-size: 11.5px; flex: none; }
.ssh-file-row__actions { display: flex; gap: .2rem; flex: none; opacity: 0; }
.ssh-file-row:hover .ssh-file-row__actions { opacity: 1; }
.ssh-file-row__actions button {
  background: transparent; border: 0; color: var(--fg-dim); cursor: pointer; padding: 0 .25rem; font-size: 13px;
}
.ssh-file-row__actions button:hover { color: var(--fg); }
.ssh-files__status { padding: .35rem .6rem; font-size: 11.5px; color: var(--fg-faint); border-top: 1px solid var(--border); min-height: 1.6rem; }
.ssh-files__status.is-error { color: var(--danger); }

/* ---------------------------------------------------- Editor -------------- */
.ssh-editor { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg-2); }
.ssh-pane--files { position: relative; }
.ssh-editor__bar { display: flex; align-items: center; gap: .4rem; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.ssh-editor__name { font-family: var(--mono); font-size: 12.5px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssh-editor__area {
  flex: 1; width: 100%; resize: none;
  font-family: var(--mono); font-size: 13px; line-height: 1.4;
  background: #0c0f12; color: var(--fg);
  border: 0; padding: .6rem .7rem; tab-size: 4;
}
.ssh-editor__area:focus { outline: none; }

/* ---------------------------------------------------- Modal --------------- */
.ssh-modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.ssh-modal__box { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 1.4rem; max-width: 460px; width: 100%; }
.ssh-modal__box h2 { color: var(--danger); }
.ssh-modal__box input { width: 100%; font: inherit; font-family: var(--mono); padding: .5rem .6rem; margin: .6rem 0; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius); }
.ssh-modal__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.ssh-modal__out { background: #0c0f12; border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; margin-top: .8rem; font-size: 12px; max-height: 200px; overflow: auto; white-space: pre-wrap; }

/* ---------------------------------------------------- Mobil --------------- */
@media (max-width: 760px) {
  .ssh-main { flex-direction: column; }
  .ssh-pane--files { flex: 1 1 auto; max-width: none; border-left: 0; border-top: 1px solid var(--border); }
  .ssh-pane--terminal { flex: 1 1 50%; min-height: 240px; }
  .ssh-header__cwd { max-width: 100%; order: 99; width: 100%; }
}
