/* ═══════════════════════════════════════════════════════════════
   SAUSHK.IN — Terminal with sidebar
   IBM Plex Mono · Blueprint · 0x1lab system
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a;
  --fg: #e0e0e0;
  --green: #22C55E;
  --green-dim: #16a34a;
  --green-ghost: rgba(34, 197, 94, 0.06);
  --cyan: #06b6d4;
  --amber: #f59e0b;
  --red: #ef4444;
  --gray-700: #404040;
  --gray-600: #525252;
  --gray-500: #737373;
  --gray-400: #a3a3a3;
  --gray-300: #d4d4d4;
  --mono: 'IBM Plex Mono', 'SF Mono', 'Fira Code', monospace;
  --grid-color: rgba(34, 197, 94, 0.04);
  --grid-size: 40px;
  --status-h: 36px;
  --sidebar-w: 180px;
}

html {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

body {
  height: 100vh;
  overflow: hidden;
}

::selection {
  background: var(--green);
  color: var(--bg);
}

/* ═══ STATUS BAR ═══ */

.terminal-status {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--status-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-size: 11px;
  color: var(--gray-500);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  z-index: 50;
  letter-spacing: 0.05em;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══ LAYOUT ═══ */

.layout {
  display: flex;
  height: calc(100vh - var(--status-h));
  margin-top: var(--status-h);
}

/* ═══ TERMINAL (left) ═══ */

.terminal {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 70px;
  overflow: hidden;
}

.terminal-scanline {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 100;
}

.terminal-grid {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  z-index: 1;
}

/* Output */
.terminal-output {
  flex: 1;
  overflow-y: auto;
  z-index: 10;
  padding: 4px 16px 16px;
}

.terminal-output::-webkit-scrollbar { width: 3px; }
.terminal-output::-webkit-scrollbar-track { background: transparent; }
.terminal-output::-webkit-scrollbar-thumb { background: var(--gray-700); }

/* Groups (dimming) */
.t-group { transition: opacity 0.4s ease; }
.t-group.dimmed { opacity: 0.25; }

/* Lines */
.t-line {
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  animation: line-appear 0.05s ease-out;
}

@keyframes line-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.t-line.green { color: var(--green); }
.t-line.dim { color: var(--gray-500); }
.t-line.cyan { color: var(--cyan); }
.t-line.amber { color: var(--amber); }
.t-line.red { color: var(--red); }
.t-line.bold { font-weight: 600; }
.t-line.header {
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  margin-top: 12px;
}

.t-line a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(6, 182, 212, 0.3);
  transition: border-color 0.2s;
}
.t-line a:hover { border-color: var(--cyan); }

/* ASCII art */
.t-ascii {
  color: var(--green);
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.9;
}

/* Command echo */
.t-cmd { color: var(--gray-400); margin-top: 16px; margin-bottom: 4px; }
.t-cmd .cmd-text { color: var(--fg); font-weight: 500; }

/* Table rows */
.t-table-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  line-height: 1.6;
}

.t-table-row .t-key { color: var(--gray-500); }
.t-table-row .t-val { color: var(--fg); }

/* Case block */
.t-case {
  border-left: 2px solid var(--green-dim);
  padding-left: 16px;
  margin: 12px 0;
}

.t-case-title { color: var(--green); font-weight: 600; }
.t-case-role { color: var(--gray-400); font-size: 12px; }

.t-case-metrics { margin-top: 4px; }
.t-case-metrics span {
  display: inline-block;
  color: var(--cyan);
  margin-right: 16px;
  font-size: 12px;
}

/* Input */
.terminal-input-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  z-index: 20;
  background: rgba(10, 10, 10, 0.95);
  padding: 12px 20px;
  border-top: 1px solid rgba(34, 197, 94, 0.15);
}

.prompt {
  color: var(--green);
  font-weight: 500;
  white-space: nowrap;
  font-size: 13px;
}

.prompt-sep { color: var(--gray-500); }
.prompt-dir { color: var(--cyan); }
.prompt-dollar { color: var(--fg); margin: 0 8px 0 0; }

.terminal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  caret-color: var(--green);
}

/* ═══ SIDEBAR (right) ═══ */

.sidebar {
  width: var(--sidebar-w);
  border-left: 1px solid rgba(34, 197, 94, 0.1);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--gray-600);
  margin-bottom: 10px;
}

.sidebar-cmds {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-cmd {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-left: 2px solid transparent;
}

.cmd-name {
  color: var(--green);
  font-weight: 600;
  font-size: 12px;
}

.cmd-desc {
  color: var(--gray-600);
  font-size: 10px;
  margin-top: 1px;
}

/* ═══ LANGUAGE ═══ */

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-opt {
  cursor: pointer;
  color: var(--gray-600);
  transition: color 0.2s;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.lang-opt:hover { color: var(--gray-400); }
.lang-opt.active { color: var(--green); font-weight: 600; }
.lang-sep { color: var(--gray-700); font-size: 10px; }

/* ═══ RESPONSIVE ═══ */

/* Tablet */
@media (max-width: 768px) {
  :root { --sidebar-w: 140px; }
  .terminal { padding: 12px 12px 70px; }
  .terminal-input-wrap { padding: 10px 12px; }
  .terminal-output { padding: 4px 8px 16px; }
  .t-table-row { grid-template-columns: 90px 1fr; gap: 8px; }
  .prompt { font-size: 11px; }
  .sidebar-cmd { padding: 6px 8px; }
  .cmd-name { font-size: 11px; }
}

/* Mobile: sidebar becomes top bar */
@media (max-width: 600px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-left: none;
    border-bottom: 1px solid rgba(34, 197, 94, 0.1);
    padding: 8px 12px;
    flex-direction: row;
    align-items: center;
    gap: 0;
    overflow-x: auto;
  }

  .sidebar-label { display: none; }

  .sidebar-cmds {
    flex-direction: row;
    gap: 0;
    width: 100%;
  }

  .sidebar-cmd {
    padding: 6px 10px;
    border-left: none;
    border-bottom: 2px solid transparent;
    flex-shrink: 0;
  }

  .sidebar-cmd:hover,
  .sidebar-cmd.active {
    border-left-color: transparent;
    border-bottom-color: var(--green);
  }

  .cmd-desc { display: none; }

  .terminal { padding: 8px 12px 70px; }
  .terminal-input-wrap { padding: 10px 12px; }
  .terminal-output { padding: 4px 4px 16px; }
  .t-table-row { grid-template-columns: 80px 1fr; gap: 6px; }
  .t-ascii { font-size: 8px; }
  .prompt { font-size: 10px; }
}
