/* ------------------------------------------------------------------
   MT4 Demo-Terminal – Look & Feel des MetaTrader-4-Windows-Terminals
   ------------------------------------------------------------------ */

.mt4 {
  --mt4-chrome:  #f0efe9;
  --mt4-chrome2: #e4e2da;
  --mt4-line:    #b9b6ab;
  --mt4-line2:   #d6d3c9;
  --mt4-text:    #1c1c1c;
  --mt4-blue:    #0a246a;
  --mt4-chartbg: #000000;
  --mt4-green:   #00c000;
  --mt4-grid:    #3a3a3a;
  --mt4-profit:  #0a8a0a;
  --mt4-loss:    #c00000;

  font-family: "Segoe UI", Tahoma, "MS Sans Serif", Arial, sans-serif;
  font-size: 12px;
  color: var(--mt4-text);
  background: var(--mt4-chrome);
  border: 1px solid var(--mt4-line);
  box-shadow: 0 2px 14px rgba(0,0,0,.18);
  border-radius: 3px;
  overflow: hidden;
  user-select: none;
  line-height: 1.35;
}
.mt4 *, .mt4 *::before, .mt4 *::after { box-sizing: border-box; }
.mt4 button { font-family: inherit; }

/* Vollbreite auf der Terminal-Seite */
body.mt4dt-page .entry-content,
body.mt4dt-page .site-content,
body.mt4dt-page .content-area { max-width: none; }

/* ---------- Menueleiste ---------- */
.mt4-menubar {
  display: flex; align-items: center; gap: 14px;
  padding: 3px 10px;
  background: linear-gradient(#fbfbf8, var(--mt4-chrome2));
  border-bottom: 1px solid var(--mt4-line);
  font-size: 12px;
}
.mt4-menubar span { cursor: default; padding: 1px 3px; }
.mt4-menubar span:hover:not(.mt4-menubar-right) { background: var(--mt4-blue); color: #fff; }
.mt4-menubar-right {
  margin-left: auto; font-family: Consolas, "Courier New", monospace;
  color: #555; letter-spacing: .5px;
}

/* ---------- Werkzeugleiste ---------- */
.mt4-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 8px;
  background: var(--mt4-chrome);
  border-bottom: 1px solid var(--mt4-line);
}
.mt4-tb-group { display: flex; gap: 3px; flex-wrap: wrap; }
.mt4-tb-sep { width: 1px; height: 18px; background: var(--mt4-line); margin: 0 3px; }
.mt4-tb-spacer { flex: 1 1 auto; }

.mt4-tf, .mt4-sym {
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  color: var(--mt4-text);
}
.mt4-tf:hover, .mt4-sym:hover { border-color: #a8bdd8; background: #dceaf7; }
.mt4-tf-active, .mt4-sym-active {
  border-color: #7a9cc6; background: #cfe0f2; font-weight: 600;
}

.mt4-readonly {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #4a4a4a;
  padding: 2px 8px; border: 1px solid var(--mt4-line2);
  background: #fbfbf8; border-radius: 2px;
}
.mt4-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mt4-green); box-shadow: 0 0 5px rgba(0,192,0,.8);
  animation: mt4pulse 2s infinite;
}
@keyframes mt4pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ---------- Grundlayout ---------- */
.mt4-body { display: flex; align-items: stretch; min-height: 560px; }
.mt4-left {
  width: 206px; flex: 0 0 206px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--mt4-line);
  background: var(--mt4-chrome);
}
.mt4-center { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }

.mt4-panel { display: flex; flex-direction: column; min-height: 0; }
.mt4-panel-title {
  padding: 3px 8px; font-size: 11px; font-weight: 600;
  background: linear-gradient(#fdfdfb, var(--mt4-chrome2));
  border-bottom: 1px solid var(--mt4-line2);
}

/* ---------- Marktuebersicht ---------- */
.mt4-marketwatch { flex: 1 1 58%; min-height: 190px; }
.mt4-mw-head, .mt4-mw-row {
  display: grid; grid-template-columns: 1fr 62px 62px 22px;
  gap: 2px; padding: 2px 6px; font-size: 11px;
}
.mt4-mw-head {
  background: var(--mt4-chrome2); border-bottom: 1px solid var(--mt4-line2);
  font-weight: 600; color: #444;
}
.mt4-mw-rows { overflow-y: auto; flex: 1 1 auto; background: #fff; }
.mt4-mw-row { border-bottom: 1px solid #f2f1ec; cursor: pointer; }
.mt4-mw-row:hover { background: #eaf2fb; }
.mt4-mw-row.mt4-mw-sel { background: #cfe0f2; font-weight: 600; }
.mt4-mw-row span:nth-child(n+2) {
  font-family: Consolas, "Courier New", monospace; text-align: right;
}
.mt4-up   { color: #0a63c9; }
.mt4-down { color: var(--mt4-loss); }
.mt4-arrow { text-align: center !important; font-size: 9px; }

/* ---------- Navigator ---------- */
.mt4-navigator { flex: 1 1 42%; border-top: 1px solid var(--mt4-line); min-height: 150px; }
.mt4-nav {
  list-style: none; margin: 0; padding: 4px 6px; font-size: 11px;
  overflow-y: auto; flex: 1 1 auto; background: #fff;
}
.mt4-nav ul { list-style: none; margin: 0; padding-left: 14px; }
.mt4-nav li { padding: 1px 0; }
.mt4-nav-root { font-weight: 600; }
.mt4-nav-root::before { content: "▸ "; color: #666; }
.mt4-nav-acc::before, .mt4-nav-ea::before { content: "• "; color: #0a63c9; }
.mt4-nav-acc { color: #0a246a; font-weight: 600; }

/* ---------- Chartfenster ---------- */
.mt4-chart-window {
  flex: 1 1 auto; display: flex; flex-direction: column;
  margin: 3px; border: 1px solid var(--mt4-line);
  background: var(--mt4-chartbg); min-height: 300px;
}
.mt4-chart-caption {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 6px; font-size: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(#2a5d9e, #12386b);
}
.mt4-caption-btns { display: flex; gap: 3px; }
.mt4-caption-btns i {
  font-style: normal; width: 15px; height: 13px; line-height: 12px;
  text-align: center; font-size: 10px;
  background: var(--mt4-chrome); color: #222; border: 1px solid #0a2a52;
}
.mt4-chart-host { position: relative; flex: 1 1 auto; min-height: 260px; }
.mt4-chart-host canvas { display: block; width: 100%; height: 100%; }

.mt4-ohlc, .mt4-crosshair-info {
  position: absolute; font-family: Consolas, "Courier New", monospace;
  font-size: 11px; color: #cfcfcf; pointer-events: none; white-space: nowrap;
}
.mt4-ohlc { top: 4px; left: 8px; }
.mt4-crosshair-info { bottom: 4px; left: 8px; color: #9fd39f; }

/* ---------- Terminal-Fenster ---------- */
.mt4-terminal {
  height: 218px; flex: 0 0 218px;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--mt4-line);
  background: var(--mt4-chrome);
}
.mt4-term-tabs {
  display: flex; gap: 0; padding: 2px 4px 0;
  background: var(--mt4-chrome2); border-bottom: 1px solid var(--mt4-line);
}
.mt4-term-tab {
  border: 1px solid var(--mt4-line); border-bottom: none;
  background: var(--mt4-chrome2); padding: 3px 14px;
  font-size: 11px; cursor: pointer; margin-right: 2px;
  border-radius: 3px 3px 0 0; color: #333;
}
.mt4-term-tab-active { background: #fff; font-weight: 600; position: relative; top: 1px; }
.mt4-term-pane { display: none; flex: 1 1 auto; min-height: 0; background: #fff; }
.mt4-term-pane-active { display: flex; flex-direction: column; }

/* ---------- Tabellen ---------- */
.mt4-grid { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.mt4-grid-head, .mt4-grid-rows .mt4-row {
  display: grid; gap: 2px; padding: 2px 6px; font-size: 11px; align-items: center;
}
.mt4-grid-trade .mt4-grid-head, .mt4-grid-trade .mt4-row {
  grid-template-columns: 74px 104px 44px 44px 64px 64px 52px 64px 64px 48px 62px 1fr;
}
.mt4-grid-hist .mt4-grid-head, .mt4-grid-hist .mt4-row {
  grid-template-columns: 74px 104px 44px 44px 64px 64px 104px 64px 48px 1fr;
}
.mt4-grid-head {
  background: var(--mt4-chrome2); border-bottom: 1px solid var(--mt4-line);
  font-weight: 600; color: #444; position: sticky; top: 0; z-index: 2;
}
.mt4-grid-rows { overflow-y: auto; flex: 1 1 auto; }
.mt4-row { border-bottom: 1px solid #f4f3ef; font-family: Consolas, "Courier New", monospace; }
.mt4-row:nth-child(even) { background: #fafaf7; }
.mt4-row:hover { background: #eaf2fb; }
.mt4-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt4-cell-num { text-align: right; }
.mt4-buy  { color: #0a63c9; font-weight: 600; }
.mt4-sell { color: var(--mt4-loss); font-weight: 600; }
.mt4-pos  { color: var(--mt4-profit); }
.mt4-neg  { color: var(--mt4-loss); }
.mt4-empty { padding: 14px; color: #888; font-size: 11px; text-align: center; }

.mt4-balance-row {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 4px 8px; font-size: 11px; font-weight: 600;
  background: var(--mt4-chrome2); border-top: 1px solid var(--mt4-line);
  font-family: Consolas, "Courier New", monospace;
}
.mt4-balance-row b { font-weight: 600; color: #444; }

/* ---------- Journal ---------- */
.mt4-journal {
  flex: 1 1 auto; overflow-y: auto; padding: 4px 8px;
  font-family: Consolas, "Courier New", monospace; font-size: 11px; background: #fff;
}
.mt4-journal div { padding: 1px 0; border-bottom: 1px solid #f6f5f1; white-space: nowrap; }
.mt4-jt { color: #777; margin-right: 8px; }

/* ---------- Statusleiste ---------- */
.mt4-statusbar {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 10px; font-size: 11px;
  background: linear-gradient(#fbfbf8, var(--mt4-chrome2));
  border-top: 1px solid var(--mt4-line);
  font-family: Consolas, "Courier New", monospace;
}
.mt4-sb-sep { width: 1px; height: 13px; background: var(--mt4-line); }
.mt4-sb-spacer { flex: 1 1 auto; }
.mt4-conn::before {
  content: "▮▮▮"; letter-spacing: -2px; margin-right: 6px; color: var(--mt4-green);
}
.mt4-conn.mt4-off::before { color: #c00000; }
.mt4-conn.mt4-off { color: #c00000; }

.mt4-disclaimer {
  margin: 0; padding: 7px 10px;
  font-size: 11px; line-height: 1.5; color: #5a5a5a;
  background: #fbfbf8; border-top: 1px solid var(--mt4-line2);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

/* ---------- Login-Sperre ---------- */
.mt4dt-gate {
  border: 1px solid #d9d6cc; background: #f7f6f1; border-radius: 4px;
  padding: 42px 22px; text-align: center;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.mt4dt-gate-inner { max-width: 470px; margin: 0 auto; }
.mt4dt-gate-icon { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.mt4dt-gate h3 { margin: 0 0 10px; font-size: 20px; }
.mt4dt-gate p { margin: 0 0 14px; color: #555; font-size: 14px; }
.mt4dt-gate-btn {
  display: inline-block; padding: 10px 26px; border-radius: 3px;
  background: #12386b; color: #fff !important; text-decoration: none; font-weight: 600;
}
.mt4dt-gate-btn:hover { background: #0a246a; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 900px) {
  .mt4-body { flex-direction: column; min-height: 0; }
  .mt4-left { width: auto; flex: 0 0 auto; flex-direction: row; border-right: none; border-bottom: 1px solid var(--mt4-line); }
  .mt4-marketwatch { flex: 1 1 50%; min-height: 168px; }
  .mt4-navigator { display: none; }
  .mt4-chart-window { min-height: 260px; }
  .mt4-terminal { height: 250px; flex: 0 0 250px; }
  .mt4-grid-trade .mt4-grid-head span:nth-child(n+9),
  .mt4-grid-trade .mt4-row span:nth-child(n+9),
  .mt4-grid-hist  .mt4-grid-head span:nth-child(n+7),
  .mt4-grid-hist  .mt4-row span:nth-child(n+7) { display: none; }
  .mt4-grid-trade .mt4-grid-head, .mt4-grid-trade .mt4-row { grid-template-columns: 1fr 78px 36px 40px 62px 62px 62px 62px; }
  .mt4-grid-hist  .mt4-grid-head, .mt4-grid-hist  .mt4-row  { grid-template-columns: 1fr 78px 36px 40px 62px 62px; }
}
