/* ═══════════════════════════════════════════════════════════
   Terminal / CMD  ·  terminal.css
   ═══════════════════════════════════════════════════════════ */

/* ── WINDOW ── */
#termWindow {
  position: fixed;
  top: 60px; left: 140px;
  width: 750px; height: 460px;
  min-width: 400px; min-height: 260px;
  z-index: 420;
  display: flex; flex-direction: column;
  background: #0c0c0c;
  border: 1px solid #555;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
  transform-origin: center bottom;
  animation: termOpen .2s cubic-bezier(.16,1,.3,1) both;
  font-family: 'Consolas', 'Courier New', monospace;
}
@keyframes termOpen {
  from { opacity:0; transform:scale(.93) translateY(14px); }
  to   { opacity:1; transform:scale(1)   translateY(0); }
}
#termWindow.minimising {
  animation: termMin .2s cubic-bezier(.4,0,1,1) both;
  pointer-events: none;
}
@keyframes termMin {
  from { opacity:1; transform:scale(1)   translateY(0); }
  to   { opacity:0; transform:scale(.4)  translateY(100vh); }
}
#termWindow.restoring  { animation: termOpen .2s cubic-bezier(.16,1,.3,1) both; }
#termWindow.maximised  {
  top:0 !important; left:0 !important;
  width:100vw !important; height:calc(100vh - 44px) !important;
  border:none;
}

/* ── TITLE BAR ── */
.term-titlebar {
  height: 32px;
  background: #1e1e1e;
  border-bottom: 1px solid #333;
  display: flex; align-items: center;
  padding: 0 0 0 10px;
  flex-shrink: 0; cursor: default;
  user-select: none;
}
.term-titlebar-icon {
  width: 16px; height: 16px; object-fit: contain;
  margin-right: 8px; flex-shrink: 0;
}
.term-titlebar-text {
  font-size: 12px; color: rgba(255,255,255,.8);
  font-weight: 400; flex: 1;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.term-controls { display: flex; height: 100%; }
.term-btn {
  width: 44px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: rgba(255,255,255,.65);
  border: none; background: transparent;
  font-family: 'Segoe UI', Arial, sans-serif; line-height: 1;
  transition: background .12s, color .12s;
}
.term-btn:hover        { background: rgba(255,255,255,.1); color: #fff; }
.term-btn.close:hover  { background: #e81123; color: #fff; }

/* ── MENU BAR ── */
.term-menubar {
  height: 22px;
  background: #1e1e1e;
  border-bottom: 1px solid #2a2a2a;
  display: flex; align-items: stretch;
  flex-shrink: 0;
}
.term-menu { position: relative; }
.term-menu-label {
  height: 100%; padding: 0 10px;
  display: flex; align-items: center;
  font-size: 12px; color: rgba(255,255,255,.65);
  cursor: pointer; font-family: 'Segoe UI', Tahoma, sans-serif;
  transition: background .1s, color .1s;
  white-space: nowrap;
}
.term-menu-label:hover,
.term-menu.active .term-menu-label {
  background: #0078d7; color: #fff;
}
.term-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: #1e1e1e; border: 1px solid #444;
  min-width: 180px; padding: 3px 0; z-index: 9999;
  box-shadow: 2px 4px 16px rgba(0,0,0,.5);
}
.term-menu.active .term-dropdown { display: block; }
.term-dd-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 20px 5px 16px;
  font-size: 12px; color: rgba(255,255,255,.75);
  cursor: pointer; gap: 20px; white-space: nowrap;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  transition: background .08s;
}
.term-dd-item:hover    { background: #0078d7; color: #fff; }
.term-dd-item.disabled { color: #555; pointer-events: none; }
.term-dd-shortcut      { font-size: 11px; color: #666; }
.term-dd-item:hover .term-dd-shortcut { color: rgba(255,255,255,.6); }
.term-dd-sep           { height: 1px; background: #333; margin: 3px 0; }

/* ── TERMINAL BODY ── */
.term-body {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column;
  background: #0c0c0c;
  padding: 6px 8px;
  cursor: text;
}

/* output scroll area */
.term-output {
  flex: 1; overflow-y: auto; overflow-x: auto;
  font-size: 14px; line-height: 1.55;
  color: #cccccc;
  white-space: pre-wrap;
  word-break: break-all;
}
.term-output::-webkit-scrollbar { width: 6px; }
.term-output::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.term-output::-webkit-scrollbar-track { background: #0c0c0c; }

/* output text colour classes */
.term-white  { color: #ffffff; }
.term-grey   { color: #888888; }
.term-green  { color: #00ff00; }  /* success / output */
.term-yellow { color: #ffff00; }  /* warnings */
.term-red    { color: #ff6b6b; }  /* errors */
.term-cyan   { color: #00d4ff; }  /* info / system */
.term-blue   { color: #4fc3f7; }  /* directory */
.term-orange { color: #ffa726; }  /* compilation */
.term-magenta{ color: #ce93d8; }  /* java keywords */
.term-bold   { font-weight: 700; }

/* input row */
.term-input-row {
  display: flex; align-items: center;
  flex-shrink: 0; margin-top: 2px;
  font-size: 14px;
}
.term-prompt {
  color: #00d4ff; white-space: nowrap; flex-shrink: 0;
  user-select: none;
}
.term-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #cccccc; font-size: 14px; caret-color: #cccccc;
  font-family: 'Consolas', 'Courier New', monospace;
  padding: 0 0 0 4px;
  user-select: text; -webkit-user-select: text;
}

/* ── STATUS BAR ── */
.term-statusbar {
  height: 20px; background: #007acc;
  display: flex; align-items: center;
  padding: 0 10px; gap: 20px; flex-shrink: 0;
}
.term-status-item {
  font-size: 11px; color: rgba(255,255,255,.9);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  white-space: nowrap;
}

/* ── RESIZE HANDLE ── */
.term-resize {
  position: absolute; bottom: 0; right: 0;
  width: 16px; height: 16px; cursor: se-resize; z-index: 10;
}
.term-resize::after {
  content: ''; position: absolute; bottom: 3px; right: 3px;
  width: 8px; height: 8px;
  border-right: 2px solid #555; border-bottom: 2px solid #555;
}

/* ── CONTEXT MENUS ── */
#termCtx, #termIconCtx {
  position: fixed; z-index: 9500;
  background: #1e1e1e; border: 1px solid #444;
  box-shadow: 2px 4px 18px rgba(0,0,0,.55);
  min-width: 190px; padding: 3px 0;
  display: none;
  animation: termCtxPop .1s cubic-bezier(.16,1,.3,1) both;
}
@keyframes termCtxPop {
  from { opacity:0; transform:scale(.96) translateY(-3px); }
  to   { opacity:1; transform:scale(1)   translateY(0); }
}
#termCtx.open, #termIconCtx.open { display: block; }

.term-ctx-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 20px 6px 14px;
  font-size: 13px; color: rgba(255,255,255,.8);
  cursor: pointer; gap: 20px; white-space: nowrap;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  transition: background .08s;
}
.term-ctx-item:hover    { background: #0078d7; color: #fff; }
.term-ctx-item.disabled { color: #555; pointer-events: none; }
.term-ctx-sep           { height: 1px; background: #333; margin: 3px 0; }
.term-ctx-icon          { width: 18px; text-align: center; flex-shrink: 0; }

/* ── TASKBAR ENTRY ── */
#tbTerminal {
  height: 100%; display: flex; align-items: center;
  gap: 6px; padding: 0 10px; cursor: pointer;
  transition: background .15s; position: relative;
  min-width: 110px; max-width: 150px;
}
#tbTerminal:hover { background: rgba(255,255,255,.1); }
#tbTerminal img   { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
#tbTerminal span  { font-size: 12px; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tbTerminal::after {
  content: ''; position: absolute; bottom: 0; left: 10%;
  width: 80%; height: 2px; background: #0078d7;
}
#tbTerminal.minimised::after { background: rgba(255,255,255,.3); }
 