/* =========================================
   TERMINAL PORTFOLIO — CSS
   ========================================= */

:root {
  --bg: #0a0e14;
  --terminal-bg: #0d1117;
  --header-bg: #161b22;
  --border: #30363d;
  --green: #00ff9c;
  --green-dim: #00cc7a;
  --cyan: #00e5ff;
  --yellow: #ffeb3b;
  --orange: #ff9800;
  --red: #ff5252;
  --pink: #ff6bcb;
  --purple: #c792ea;
  --blue: #82aaff;
  --white: #e6edf3;
  --gray: #8b949e;
  --font: "Fira Code", "Courier New", monospace;
  --glow: 0 0 8px rgba(0, 255, 156, 0.4);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font);
  color: var(--green);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

/* CRT & Scanline Overlays */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.35) 100%
  );
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
}

/* Terminal Window */
#terminal {
  position: absolute;
  width: 92vw;
  max-width: 960px;
  height: 88vh;
  max-height: 720px;
  min-width: 360px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  resize: both;
  box-shadow:
    0 0 40px rgba(0, 255, 156, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 80px rgba(0, 255, 156, 0.02);
  animation: terminalBoot 0.8s ease-out;
}

@keyframes terminalBoot {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#terminal::-webkit-resizable {
  display: none;
}

/* Terminal Header (title bar) — draggable */
#terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

#terminal-header:active {
  cursor: grabbing;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.terminal-buttons span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}

.btn-close {
  background: #ff5f57;
}
.btn-minimize {
  background: #febc2e;
}
.btn-maximize {
  background: #28c840;
}

.terminal-title {
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 0.5px;
}

/* Terminal Body */
#terminal-body {
  flex: 1;
  background: var(--terminal-bg);
  padding: 20px 24px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

#terminal-body::-webkit-scrollbar {
  width: 6px;
}

#terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

#terminal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

#terminal-body::-webkit-scrollbar-thumb:hover {
  background: var(--gray);
}

/* Output Area */
#output {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.7;
  font-size: 14px;
}

#output .line {
  opacity: 0;
  animation: fadeInLine 0.15s ease forwards;
}

@keyframes fadeInLine {
  to {
    opacity: 1;
  }
}

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

.prompt {
  color: var(--cyan);
  font-weight: 500;
  white-space: nowrap;
}

#command-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  caret-color: transparent;
  line-height: 1.7;
  width: 0;
  min-width: 2px;
  flex: 0 1 auto;
}

#cursor {
  color: var(--green);
  font-size: 14px;
  line-height: 1;
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* =========================================
   TEXT STYLES — used from JS via classnames
   ========================================= */
.color-green {
  color: var(--green);
}
.color-cyan {
  color: var(--cyan);
}
.color-yellow {
  color: var(--yellow);
}
.color-orange {
  color: var(--orange);
}
.color-red {
  color: var(--red);
}
.color-pink {
  color: var(--pink);
}
.color-purple {
  color: var(--purple);
}
.color-blue {
  color: var(--blue);
}
.color-white {
  color: var(--white);
}
.color-gray {
  color: var(--gray);
}

.bold {
  font-weight: 700;
}
.dim {
  opacity: 0.55;
}
.italic {
  font-style: italic;
}

/* ASCII Art / Banner */
.ascii-art {
  color: var(--green);
  text-shadow: var(--glow);
  line-height: 1.15;
  font-size: 12px;
  white-space: pre;
  display: block;
  overflow-x: auto;
}

/* Section Headers */
.section-header {
  color: var(--cyan);
  font-weight: 700;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 4px;
  margin-bottom: 2px;
  display: inline-block;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.3);
}

/* Links */
.terminal-link {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
  transition: color 0.2s;
}

.terminal-link:hover {
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

/* Skill Bars */
.skill-bar-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.skill-bar {
  display: inline-block;
  width: 120px;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  vertical-align: middle;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width 1s ease;
  box-shadow: 0 0 8px rgba(0, 255, 156, 0.4);
}

/* Command echo (the typed command shown in output) */
.cmd-echo {
  color: var(--white);
}

.cmd-prompt {
  color: var(--cyan);
  font-weight: 500;
}

/* History navigation highlight */
#command-input::selection {
  background: var(--green);
  color: var(--bg);
}

/* Mobile tweaks */
@media (max-width: 600px) {
  #terminal {
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }

  #terminal-body {
    padding: 12px 14px;
  }

  #output,
  #command-input,
  .prompt,
  #cursor {
    font-size: 12px;
  }

  .ascii-art {
    font-size: 7px;
  }

  .skill-bar {
    width: 80px;
  }
}
