/* ============================================================
   MUSTAFA REHAEF – Terminal Portfolio CSS
   ============================================================ */

:root {
  /* Color palette */
  --bg:           #0d1117;
  --bg-terminal:  #0a0e14;
  --bg-titlebar:  #161b22;
  --bg-tab:       #1c2128;
  --bg-tab-act:   #0a0e14;
  --border:       #30363d;
  --green:        #39d353;
  --green-dim:    #2ea043;
  --cyan:         #58e6d9;
  --yellow:       #e3b341;
  --red:          #ff7b72;
  --purple:       #bc8cff;
  --blue:         #79c0ff;
  --orange:       #f0883e;
  --white:        #e6edf3;
  --gray:         #8b949e;
  --gray-dim:     #484f58;
  --scanline-col: rgba(18, 255, 128, 0.03);

  /* Glow effects */
  --glow-green:   0 0 8px rgba(57, 211, 83, 0.5), 0 0 20px rgba(57, 211, 83, 0.15);
  --glow-cyan:    0 0 8px rgba(88, 230, 217, 0.4);

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --radius: 10px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* ── Scanlines ─────────────────────────────────────────── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    var(--scanline-col) 2px,
    var(--scanline-col) 4px
  );
  animation: scanline-drift 12s linear infinite;
}
@keyframes scanline-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 0 40px; }
}

/* ── Boot Screen ───────────────────────────────────────── */
#boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
}
.boot-content {
  width: min(700px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ascii-logo {
  color: var(--green);
  font-size: clamp(12px, 2.5vw, 20px);
  text-shadow: var(--glow-green);
  white-space: pre;
  font-family: var(--font-mono);
  line-height: 1.2;
  letter-spacing: 0;
}
.boot-logo {
  text-align: center;
  margin-bottom: 8px;
}
.boot-log {
  color: var(--green);
  font-size: 12px;
  min-height: 120px;
  opacity: 0.85;
}
.boot-log .log-line {
  display: flex;
  gap: 12px;
  animation: fade-in 0.2s ease both;
}
.boot-log .log-ok   { color: var(--green); }
.boot-log .log-info { color: var(--cyan); }
.boot-log .log-warn { color: var(--yellow); }
.boot-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.boot-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green-dim), var(--cyan));
  border-radius: 2px;
  transition: width 0.1s ease;
  box-shadow: 0 0 6px var(--green);
}

/* ── Terminal Window ───────────────────────────────────── */
.terminal-window {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-terminal);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s ease;
  border: 1px solid var(--border);
}
.terminal-window.visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Title Bar ─────────────────────────────────────────── */
.title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-titlebar);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
  user-select: none;
  flex-shrink: 0;
}
.title-bar-buttons {
  display: flex;
  gap: 7px;
}
.title-bar-buttons span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: filter 0.2s;
}
.title-bar-buttons span:hover { filter: brightness(1.3); }
.btn-close    { background: #ff5f57; }
.btn-minimize { background: #febc2e; }
.btn-maximize { background: #28c840; }
.title-bar-text {
  flex: 1;
  text-align: center;
  color: var(--gray);
  font-size: 12px;
  letter-spacing: 0.5px;
}
.title-bar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gray);
  font-size: 11px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: var(--glow-green);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Tab Bar ───────────────────────────────────────────── */
.tab-bar {
  display: flex;
  align-items: stretch;
  background: var(--bg-tab);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab {
  padding: 6px 20px;
  font-size: 12px;
  color: var(--gray);
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.tab.active {
  background: var(--bg-tab-act);
  color: var(--white);
  border-bottom: 2px solid var(--green);
}
.tab-add {
  padding: 6px 14px;
  color: var(--gray-dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.tab-add:hover { color: var(--white); }

/* ── Terminal Body ─────────────────────────────────────── */
.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  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-dim); }

/* ── Output Lines ──────────────────────────────────────── */
#output-area {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.output-block {
  margin-bottom: 4px;
  animation: fade-in 0.15s ease both;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.echo-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--gray);
  font-size: 13px;
}
.echo-prompt {
  color: var(--green);
  white-space: nowrap;
  flex-shrink: 0;
}
.echo-cmd { color: var(--white); }

/* ── Rich output types ─────────────────────────────────── */
.out-text   { color: var(--white); }
.out-green  { color: var(--green); }
.out-cyan   { color: var(--cyan); }
.out-yellow { color: var(--yellow); }
.out-red    { color: var(--red); }
.out-purple { color: var(--purple); }
.out-gray   { color: var(--gray); }
.out-orange { color: var(--orange); }
.out-blue   { color: var(--blue); }
.out-bold   { font-weight: 700; }
.out-dim    { opacity: 0.6; }
.out-link   { color: var(--cyan); text-decoration: underline; cursor: pointer; }
.out-link:hover { color: var(--white); }
.out-pre    { white-space: pre; }

/* Sections */
.section-header {
  color: var(--cyan);
  font-weight: 700;
  font-size: 13px;
  margin: 10px 0 4px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header::before { content: '▶'; color: var(--green); font-size: 10px; }
.section-header::after  {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.key-val {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2px 12px;
  font-size: 13px;
  padding: 2px 0;
}
.key-val .k { color: var(--green); }
.key-val .v { color: var(--white); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}
.tag {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
  cursor: default;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tag:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.tag-green  { color: var(--green);  border-color: var(--green);  background: rgba(57,211,83,0.08); }
.tag-cyan   { color: var(--cyan);   border-color: var(--cyan);   background: rgba(88,230,217,0.08); }
.tag-purple { color: var(--purple); border-color: var(--purple); background: rgba(188,140,255,0.08); }
.tag-yellow { color: var(--yellow); border-color: var(--yellow); background: rgba(227,179,65,0.08); }
.tag-blue   { color: var(--blue);   border-color: var(--blue);   background: rgba(121,192,255,0.08); }
.tag-orange { color: var(--orange); border-color: var(--orange); background: rgba(240,136,62,0.08); }
.tag-red    { color: var(--red);    border-color: var(--red);    background: rgba(255,123,114,0.08); }

.progress-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin: 2px 0;
}
.progress-bar-outer {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green-dim), var(--cyan));
  box-shadow: 0 0 6px rgba(57,211,83,0.4);
  transition: width 0.6s ease;
  width: 0;
}
.progress-label { color: var(--gray); min-width: 34px; text-align: right; font-size: 11px; }

.job-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 6px 0;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s, background 0.2s;
}
.job-card:hover {
  border-color: var(--green-dim);
  background: rgba(57,211,83,0.04);
}
.job-title  { color: var(--white); font-weight: 700; font-size: 14px; }
.job-meta   { color: var(--cyan); font-size: 11px; margin: 2px 0; }
.job-period { color: var(--gray); font-size: 11px; }
.job-desc   { color: var(--gray); font-size: 12px; margin-top: 6px; line-height: 1.7; }
.job-bullet::before { content: '  → '; color: var(--green-dim); }

.cert-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(48,54,61,0.5);
}
.cert-icon  { color: var(--yellow); font-size: 14px; }
.cert-name  { color: var(--white); flex: 1; }
.cert-issuer{ color: var(--gray); font-size: 11px; }
.cert-year  { color: var(--cyan); font-size: 11px; }

.achievement-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(48,54,61,0.4);
  font-size: 12px;
}
.achievement-item .ai-icon { color: var(--yellow); margin-right: 6px; }
.achievement-item .ai-text { color: var(--white); }

/* Help table */
.help-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  margin: 4px 0;
}
.help-table td { padding: 3px 10px 3px 0; vertical-align: top; }
.help-table .hcmd { color: var(--green); white-space: nowrap; }
.help-table .hdesc{ color: var(--gray); }

/* Contact form */
.contact-prompt {
  color: var(--cyan);
  font-size: 12px;
  margin: 4px 0;
  animation: fade-in 0.2s ease;
}
.contact-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.contact-arrow { color: var(--green); flex-shrink: 0; }
.contact-field { color: var(--yellow); flex-shrink: 0; }

/* Typing cursor in output */
.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--green);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Input Line ────────────────────────────────────────── */
.input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
  flex-shrink: 0;
}
.prompt {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.prompt-user   { color: var(--green); font-weight: 700; }
.prompt-at     { color: var(--gray); }
.prompt-host   { color: var(--cyan); font-weight: 700; }
.prompt-colon  { color: var(--gray); }
.prompt-dir    { color: var(--purple); }
.prompt-dollar { color: var(--white); margin-left: 4px; }
.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 14px;
  caret-color: transparent;
  width: 100%;
}
.cursor-block {
  position: absolute;
  width: 9px;
  height: 17px;
  background: var(--green);
  opacity: 0.8;
  animation: blink 1s step-end infinite;
  pointer-events: none;
  box-shadow: var(--glow-green);
}

/* ── Welcome Banner ────────────────────────────────────── */
.welcome-banner pre {
  color: var(--green);
  font-size: clamp(8px, 1.8vw, 13px);
  text-shadow: var(--glow-green);
  white-space: pre;
  line-height: 1.15;
  font-family: var(--font-mono);
}
.welcome-sub {
  color: var(--cyan);
  font-size: 13px;
  margin: 6px 0 2px;
}
.welcome-hint {
  color: var(--gray);
  font-size: 11px;
}

/* ── Matrix rain canvas ─────────────────────────────────── */
#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
}

/* ── Mobile hint ────────────────────────────────────────── */
.mobile-hint {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22,27,34,0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--gray);
  z-index: 100;
  display: none;
  white-space: nowrap;
}
.mobile-hint code { color: var(--green); }

/* ── Send mail animation ────────────────────────────────── */
.send-animation {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: 12px;
}
.send-progress { display: flex; gap: 3px; }
.send-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: send-bounce 0.8s infinite;
}
.send-dot:nth-child(2) { animation-delay: 0.15s; }
.send-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes send-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%            { transform: translateY(-6px); opacity: 1; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  html, body { font-size: 12px; }
  .title-bar-text { display: none; }
  .key-val { grid-template-columns: 130px 1fr; }
  .mobile-hint { display: block; }
}

/* ── Hire / CTA banner ──────────────────────────────────── */
.hire-banner {
  border: 1px solid var(--green-dim);
  border-radius: 8px;
  padding: 12px 18px;
  background: rgba(46,160,67,0.07);
  margin: 8px 0;
  box-shadow: 0 0 20px rgba(46,160,67,0.08);
}
.hire-banner .hb-title {
  color: var(--green);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.hire-banner .hb-sub { color: var(--cyan); font-size: 12px; }
.hire-banner .hb-cta { color: var(--yellow); font-size: 11px; margin-top: 8px; }
