/**
 * terminal.css — Terminal window UI components (BEM naming)
 * 
 * All terminal-related styling: window frame, header dots,
 * body content, prompts, cursor, form inputs, and CRT effects.
 * Uses CSS custom properties from themes.css.
 */

/* ======================================================
   Terminal Window Base
   ====================================================== */

/** Base terminal window container */
.terminal {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: 0 10px 30px var(--shadow-color);
  overflow: hidden;
  font-family: var(--font-mono);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  position: relative;
}

/** Smaller card variant for sections (about, contact) */
.terminal--card {
  box-shadow: 0 6px 20px var(--shadow-color);
}

/* ======================================================
   Terminal Header — title bar with traffic-light dots
   ====================================================== */

.terminal__header {
  background-color: var(--terminal-header);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
}

/** Traffic-light dot base */
.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.terminal__dot--red    { background-color: #ff605c; }
.terminal__dot--yellow { background-color: #ffbd44; }
.terminal__dot--green  { background-color: #00ca4e; }

/** Title text inside header bar */
.terminal__title {
  flex-grow: 1;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  user-select: none;
}

/* ======================================================
   Terminal Body — main content area
   ====================================================== */

.terminal__body {
  padding: 20px;
  min-height: 120px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  font-family: var(--font-mono);
  position: relative;
}

/* ======================================================
   Terminal Lines, Prompts, and Text Styles
   ====================================================== */

/** A single line in the terminal */
.terminal__line {
  display: flex;
  align-items: baseline;
  margin-bottom: 4px;
}

/** The prompt symbol ($ or >) — non-selectable */
.terminal__prompt {
  color: var(--prompt-color);
  margin-right: 8px;
  user-select: none;
  font-weight: 600;
}

/** Typed command text */
.terminal__command {
  color: var(--command-color);
}

/** Generic output text */
.terminal__output {
  color: var(--output-color);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/** Highlighted / emphasized text */
.terminal__highlight {
  color: var(--text-heading);
  font-weight: 600;
}

/** Success / green text */
.terminal__success {
  color: var(--accent-green);
}

/** Error / red text */
.terminal__error {
  color: var(--accent-red);
}

/** Tag-styled output (for skill listings) */
.terminal__tag {
  color: var(--accent-purple);
}

/* ======================================================
   Blinking Cursor Effect
   ====================================================== */

.terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background-color: var(--cursor-color);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from, to { background-color: transparent; }
  50% { background-color: var(--cursor-color); }
}

/* ======================================================
   Terminal Photo Frame (About section)
   ====================================================== */

.terminal__photo-frame {
  display: inline-block;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  line-height: 0; /* removes bottom gap inside inline-block */
}

.terminal__photo-frame img {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: cover;
}

/* ======================================================
   Terminal Form Elements (Contact section)
   Inputs and textarea styled to look like terminal I/O
   ====================================================== */

.terminal__input {
  background-color: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  transition: border-color var(--transition-speed) var(--transition-fn),
              box-shadow var(--transition-speed) var(--transition-fn);
}

.terminal__input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

textarea.terminal__input {
  resize: vertical;
  min-height: 100px;
}

/** Terminal-style submit button */
.terminal__submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
  border: none;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--transition-speed) var(--transition-fn),
              transform var(--transition-speed) var(--transition-fn);
  margin-top: 8px;
}

.terminal__submit:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.terminal__submit:active {
  transform: translateY(0);
}

/* ======================================================
   Scanline / CRT Overlay Effect
   Subtle retro terminal scanlines over the hero terminal
   ====================================================== */

.terminal--scanlines::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0px,
    rgba(0, 0, 0, 0.05) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

