/* ═══════════════════════════════════════════════
   FEATURES.CSS — 7 fitur baru portfolio Rizki
   ═══════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   1. SCROLL PROGRESS BAR
───────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #00d9ff, #00ffc8, #7c3aed);
  z-index: 99999;
  transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(0, 217, 255, 0.8), 0 0 20px rgba(0, 217, 255, 0.4);
}

/* ─────────────────────────────────────────
   2. ACTIVE NAVBAR HIGHLIGHT
───────────────────────────────────────── */
nav a {
  position: relative;
  transition: color 0.3s ease;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s ease;
  box-shadow: 0 0 6px rgba(0, 217, 255, 0.8);
}

nav a.active {
  color: var(--primary) !important;
}

nav a.active::after {
  width: 100%;
}

/* ─────────────────────────────────────────
   3. BACKGROUND GRID CYBER INFRA (ANIMATED)
───────────────────────────────────────── */
#cyber-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

#cyber-grid canvas {
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

/* ─────────────────────────────────────────
   4. MOUSE GLOW FOLLOW CURSOR
───────────────────────────────────────── */
#mouse-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(0, 217, 255, 0.07) 0%,
    rgba(0, 217, 255, 0.03) 40%,
    transparent 70%
  );
  transition: left 0.12s ease-out, top 0.12s ease-out;
  will-change: left, top;
}

/* ─────────────────────────────────────────
   5. SECTION REVEAL — STAGGER ANIMATION
───────────────────────────────────────── */
.reveal-child {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-child.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger delay untuk anak-anak elemen */
.reveal-child:nth-child(1) { transition-delay: 0.05s; }
.reveal-child:nth-child(2) { transition-delay: 0.15s; }
.reveal-child:nth-child(3) { transition-delay: 0.25s; }
.reveal-child:nth-child(4) { transition-delay: 0.35s; }
.reveal-child:nth-child(5) { transition-delay: 0.45s; }
.reveal-child:nth-child(6) { transition-delay: 0.55s; }

/* ─────────────────────────────────────────
   6. COMMAND PALETTE  (Ctrl+K)
───────────────────────────────────────── */
#cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#cmd-overlay.open {
  opacity: 1;
  visibility: visible;
}

#cmd-box {
  width: 100%;
  max-width: 580px;
  background: rgba(11, 16, 32, 0.98);
  border: 1px solid rgba(0, 217, 255, 0.25);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 217, 255, 0.08),
    0 24px 80px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(0, 217, 255, 0.08);
  transform: translateY(-12px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#cmd-overlay.open #cmd-box {
  transform: translateY(0) scale(1);
}

#cmd-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#cmd-search-wrap .cmd-icon {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 14px;
  opacity: 0.7;
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e5e7eb;
  font-family: var(--font-mono);
  font-size: 14px;
  caret-color: var(--primary);
}

#cmd-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

#cmd-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

#cmd-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px 0;
}

#cmd-results::-webkit-scrollbar {
  width: 4px;
}

#cmd-results::-webkit-scrollbar-track {
  background: transparent;
}

#cmd-results::-webkit-scrollbar-thumb {
  background: rgba(0, 217, 255, 0.2);
  border-radius: 2px;
}

.cmd-section-label {
  padding: 6px 18px 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(0, 217, 255, 0.5);
  text-transform: uppercase;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 0;
}

.cmd-item:hover,
.cmd-item.selected {
  background: rgba(0, 217, 255, 0.07);
}

.cmd-item .cmd-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 217, 255, 0.08);
  border: 1px solid rgba(0, 217, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.cmd-item .cmd-item-text {
  flex: 1;
}

.cmd-item .cmd-item-name {
  font-size: 13px;
  color: #e5e7eb;
  font-family: var(--font-body);
}

.cmd-item .cmd-item-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--font-mono);
  margin-top: 1px;
}

.cmd-item .cmd-item-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(0, 217, 255, 0.5);
  padding: 2px 6px;
  border: 1px solid rgba(0, 217, 255, 0.15);
  border-radius: 4px;
}

#cmd-footer {
  display: flex;
  gap: 16px;
  padding: 8px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cmd-key-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
}

.cmd-key-hint kbd {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
}

/* ─────────────────────────────────────────
   7. TERMINAL BOOT INTRO
───────────────────────────────────────── */
#terminal-boot {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #050a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#terminal-boot.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#terminal-window {
  width: 100%;
  max-width: 680px;
  padding: 0 24px;
}

#terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 10px 16px;
}

.t-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.t-dot.red   { background: #ff5f57; }
.t-dot.yellow{ background: #febc2e; }
.t-dot.green { background: #28c840; }

#terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
}

#terminal-body {
  background: rgba(5, 10, 15, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 10px 10px;
  padding: 24px 28px 28px;
  min-height: 280px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  overflow: hidden;
}

.t-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  opacity: 0;
  animation: tLineIn 0.15s ease forwards;
}

@keyframes tLineIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.t-prompt {
  color: #00d9ff;
  flex-shrink: 0;
}

.t-cmd {
  color: #e5e7eb;
}

.t-out {
  color: rgba(255, 255, 255, 0.45);
}

.t-ok    { color: #28c840; }
.t-warn  { color: #febc2e; }
.t-error { color: #ff5f57; }
.t-cyan  { color: #00d9ff; }
.t-dim   { color: rgba(255, 255, 255, 0.25); }

#terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #00d9ff;
  animation: tBlink 0.8s steps(1) infinite;
  vertical-align: middle;
  margin-left: 2px;
}

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

#terminal-skip {
  margin-top: 20px;
  text-align: right;
}

#terminal-skip button {
  background: transparent;
  border: 1px solid rgba(0, 217, 255, 0.2);
  color: rgba(0, 217, 255, 0.5);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 1px;
}

#terminal-skip button:hover {
  border-color: rgba(0, 217, 255, 0.6);
  color: #00d9ff;
  background: rgba(0, 217, 255, 0.05);
}

/* ── Kb shortcut pill — diganti dengan toast di main.js ── */
#cmd-trigger-hint {
  display: none;
}