/* ============================================================
   Robusr's Utopia — Terminal-style personal homepage
   ============================================================ */

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Fira Code', 'Menlo', 'Consolas', 'SF Mono', 'Monaco', monospace;
}

/* ===== Fullscreen Background ===== */
.bg {
  position: fixed;
  inset: 0;
  background: url('../assets/img/Street.webp') center / cover no-repeat;
  z-index: 0;
}

/* ===== Terminal Window ===== */
.terminal {
  position: relative;
  z-index: 1;
  width: min(94vw, 780px);
  max-height: 88vh;
  margin: 3vh auto 0;
  display: flex;
  flex-direction: column;
  background: rgba(30, 30, 40, 0.72);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.55),
    0 0 0 0.5px rgba(255, 255, 255, 0.08) inset;
  overflow: hidden;
}

/* ===== Title Bar ===== */
.titlebar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  background: rgba(50, 50, 58, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
  cursor: default;
  flex-shrink: 0;
}

.traffic-lights {
  display: flex;
  gap: 8px;
  margin-right: 12px;
}

.light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.light.red    { background: #FF5F57; }
.light.yellow { background: #FFBD2E; }
.light.green  { background: #28CA41; }

.title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Terminal Body ===== */
.body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  cursor: text;
  min-height: 150px;
}

/* Custom scrollbar */
.body::-webkit-scrollbar { width: 5px; }
.body::-webkit-scrollbar-track { background: transparent; }
.body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}
.body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}
.body { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }

/* ===== Output Area ===== */
.output {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cmd-line {
  display: flex;
  flex-wrap: wrap;
  line-height: 1.6;
  font-size: 14px;
}

.prompt-arrow { color: #A6E22E; }
.prompt-path  { color: #66D9EF; }
.cmd-text     { color: #F8F8F2; margin-left: 4px; word-break: break-all; }

.response {
  color: #C0C0C8;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  padding-bottom: 10px;
}

.response a        { color: #66D9EF; text-decoration: underline; text-underline-offset: 3px; }
.response .hl      { color: #A6E22E; }
.response .dim     { color: #8888A0; }
.response .accent  { color: #66D9EF; }
.response .bold    { color: #F8F8F2; font-weight: bold; }
.response .warn    { color: #FFBD2E; }
.response .err     { color: #F92672; }
.response .tag     {
  display: inline-block;
  color: #FFBD2E;
  background: rgba(255, 189, 46, 0.12);
  padding: 0 6px;
  border-radius: 3px;
  font-size: 11px;
  margin-left: 6px;
  vertical-align: middle;
}

.welcome {
  color: #8888A0;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ASCII logo */
.ascii-logo {
  font-size: 12px;
  line-height: 1.25;
  white-space: pre;
  margin-bottom: 8px;
}

.sysinfo {
  color: #C0C0C8;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

/* ===== Input Line ===== */
.input-line {
  display: flex;
  align-items: center;
  line-height: 1.6;
  font-size: 14px;
  margin-top: 4px;
}

#cmdInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #F8F8F2;
  font-family: inherit;
  font-size: 14px;
  caret-color: #A6E22E;
  margin-left: 4px;
  min-width: 20px;
}

#cmdInput::placeholder { color: rgba(255,255,255,0.2); }

/* ===== Spinner ===== */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #66D9EF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

/* ===== Mobile ===== */
@media (max-width: 520px) {
  .terminal {
    width: 97vw;
    max-height: 90vh;
    margin-top: 1vh;
    border-radius: 8px;
  }
  .body { padding: 10px 12px; }
  .cmd-line, .input-line, #cmdInput { font-size: 13px; }
  .response { font-size: 12.5px; }
  .ascii-logo { font-size: 7px; }
  .light { width: 10px; height: 10px; }
}
