/* ═══════════════════════════════════════════════════════════
   TERMINAL INTERACTIF — styles adaptés au portfolio
   Toujours sombre, même en mode clair (un terminal reste sombre)
   ═══════════════════════════════════════════════════════════ */

/* ─── Section ───────────────────────────────────────────── */
#terminal-section {
  padding-bottom: calc(var(--sec-py) * 0.65);
}

/* Note inline sous le titre */
#terminal-section .section-sub code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9em;
  background: rgba(155, 127, 218, 0.15);
  color: var(--accent);
  padding: 0.08em 0.4em;
  border-radius: 3px;
}

/* ─── Carte principale ──────────────────────────────────── */
.terminal-card {
  --card-rot: 0deg;   /* pas de rotation — les terminaux sont droits */
  overflow: hidden;
  /* Fond toujours sombre, ignoré le mode clair */
  background: #0c0a17 !important;
}

html[data-theme="light"] .terminal-card {
  background: #0c0a17 !important;
}

/* ─── Barre de titre (style macOS) ──────────────────────── */
.term-titlebar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 1.2rem;
  background: #141126;
  border-bottom: 1px solid rgba(155, 127, 218, 0.22);
  user-select: none;
  flex-shrink: 0;
}

.term-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: filter 0.2s;
  cursor: default;
}
.dot:hover  { filter: brightness(1.35); }
.dot-red    { background: #ff6058; box-shadow: 0 0 5px rgba(255,  96,  88, 0.45); }
.dot-yellow { background: #ffbd2e; box-shadow: 0 0 5px rgba(255, 189,  46, 0.45); }
.dot-green  { background: #29c941; box-shadow: 0 0 5px rgba( 41, 201,  65, 0.45); }

.term-title {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.84rem;
  color: #8a7ab8;
  flex: 1;
  text-align: center;
  letter-spacing: 0.3px;
}

.term-badge {
  font-family: 'Fira Code', monospace;
  font-size: 0.7rem;
  color: #5c5090;
  background: rgba(155, 127, 218, 0.1);
  padding: 0.12rem 0.55rem;
  border-radius: 3px;
  letter-spacing: 0.6px;
}

/* ─── Zone de terminal ──────────────────────────────────── */
.vterm {
  height: 650px;
  overflow-y: auto;
  padding: 1.1rem 1.5rem 0.6rem;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.87rem;
  line-height: 1.7;
  cursor: text;
  color: #c8bce0;
  /* Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 127, 218, 0.28) transparent;
}

.vterm::-webkit-scrollbar       { width: 4px; }
.vterm::-webkit-scrollbar-track { background: transparent; }
.vterm::-webkit-scrollbar-thumb { background: rgba(155, 127, 218, 0.28); border-radius: 2px; }

/* ─── Lignes de sortie ──────────────────────────────────── */
.vterm-line {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1em;
}

/* Greeting */
.vterm-greeting {
  color: #8a7ab8;
  margin-bottom: 0.6rem;
}

/* Ligne d'historique (commande tapée) */
.vterm-history { color: #c8bce0; }
.vterm-history .vterm-ps  { color: #c4aaff; font-weight: 600; }
.vterm-history .vterm-cmd { color: #f0ecff; }

/* Couleurs sémantiques */
.vterm-err    { color: #ff7070; }
.vterm-ok     { color: #6ee7b7; }
.vterm-warn   { color: #fbbf24; }

/* Tags inline */
.vterm-accent { color: #c4aaff; font-weight: 600; }
.vterm-dim    { color: #5c5090; }
.vterm-hi     { color: #f0ecff; font-weight: 600; }

/* Neofetch */
.vterm-line.nf-art  { color: #7c52d6; line-height: 1.3; }
.vterm-line.nf-info { color: #c8bce0; }

/* ─── Ligne de prompt courante ──────────────────────────── */
.vterm-current-line {
  display: flex;
  align-items: baseline;
  padding-bottom: 0.9rem;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.87rem;
}

.vterm-ps     { color: #c4aaff; font-weight: 600; white-space: pre; }
.vterm-typed  { color: #f0ecff; white-space: pre; }
.vterm-cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: #c4aaff;
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: term-blink 1s step-end infinite;
  border-radius: 1px;
}

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

/* Input caché qui capte les frappes */
.vterm-hidden-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  top: 0; left: 0;
}

/* ─── Easter eggs ───────────────────────────────────────── */

/* rm -rf / — secousse de panique */
@keyframes sys-panic-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); filter: none; }
  15%      { transform: translate(-5px, 3px) rotate(-0.6deg); filter: hue-rotate(180deg) brightness(0.7); }
  30%      { transform: translate(5px, -2px) rotate(0.6deg); filter: hue-rotate(90deg)  brightness(1.3); }
  50%      { transform: translate(-3px, -4px); filter: contrast(1.8) saturate(2); }
  70%      { transform: translate(4px, 3px); filter: invert(0.15); }
  85%      { transform: translate(-2px, 2px); filter: sepia(0.5); }
}

body.sys-panic {
  animation: sys-panic-shake 0.35s ease infinite;
}

/* matrix — teinte verte pendant 5s */
body.matrix-mode {
  filter: hue-rotate(148deg) saturate(1.2);
  transition: filter 0.5s;
}
