/* ===== Global helpers ===== */
html {
  scroll-behavior: smooth;
}

/* Copy button on code blocks */
.code-block-wrap {
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  color: #e6fff2;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.15s ease;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}
.copy-btn.copied {
  background: #1fb562;
  border-color: #1fb562;
}

pre code.hljs {
  border-radius: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Step number badge */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #1fb562, #14914f);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(31, 181, 98, 0.35);
  flex-shrink: 0;
}

/* Timeline connector */
.timeline-item {
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 3rem;
  bottom: -1.5rem;
  width: 2px;
  background: linear-gradient(to bottom, #79e6a5, #d6fae2);
}

/* Accordion (FAQ / lỗi thường gặp) */
.accordion-item .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion-item.open .accordion-content {
  max-height: 2000px;
}
.accordion-item .accordion-chevron {
  transition: transform 0.25s ease;
}
.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
}

/* Tabs */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Card hover lift */
.hover-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(19, 116, 66, 0.25);
}

/* Fade-in on scroll */
.fade-in-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #eefdf3;
}
::-webkit-scrollbar-thumb {
  background: #aef2c6;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: #79e6a5;
}

/* Badge pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Table styling for guide pages */
.guide-table th, .guide-table td {
  padding: 0.6rem 1rem;
  border: 1px solid #d6fae2;
}
.guide-table th {
  background: #eefdf3;
  text-align: left;
}

/* Alert boxes */
.alert-box {
  border-left: 4px solid;
  border-radius: 0.6rem;
  padding: 1rem 1.2rem;
}
.alert-info { border-color: #1fb562; background: #eefdf3; }
.alert-warn { border-color: #f59e0b; background: #fffbeb; }
.alert-danger { border-color: #ef4444; background: #fef2f2; }

/* ============================================================
   HERO — Animated gradient "Linux Mint" title
   ============================================================ */
.hero-gradient-text {
  background: linear-gradient(90deg, #d6fae2 0%, #79e6a5 25%, #1fb562 50%, #79e6a5 75%, #d6fae2 100%);
  background-size: 250% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: hero-gradient-flow 5s linear infinite;
  filter: drop-shadow(0 0 18px rgba(121, 230, 165, 0.35));
}
@keyframes hero-gradient-flow {
  0% { background-position: 0% center; }
  100% { background-position: 250% center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-gradient-text { animation: none; }
}

/* Rotating word typewriter under hero title */
.hero-rotator-wrap {
  display: inline-flex;
  align-items: center;
  min-height: 1.4em;
}
.hero-rotator-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  background: currentColor;
  animation: term-blink 0.9s steps(1) infinite;
  vertical-align: text-bottom;
}
@keyframes term-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ============================================================
   TERMINAL WINDOW — authentic Linux terminal look & feel
   ============================================================ */
.term-window {
  font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.term-body {
  min-height: 19rem;
}
.term-line {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  min-height: 1.65em;
}
.term-user { color: #4ade80; font-weight: 700; }
.term-sep { color: #94a3b8; }
.term-path { color: #38bdf8; font-weight: 600; }
.term-dollar { color: #e2e8f0; }
.term-cmd { color: #f8fafc; font-weight: 500; }
.term-flag { color: #fbbf24; }
.term-label { color: #f8fafc; font-weight: 700; }
.term-colon { color: #4ade80; }
.term-value { color: #a7f3d0; }
.term-comment { color: #64748b; font-style: italic; }
.term-success { color: #4ade80; font-weight: 700; }
.term-emoji { filter: saturate(1.3); }

.term-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  background: #79e6a5;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: term-blink 1s steps(1) infinite;
  box-shadow: 0 0 8px rgba(121, 230, 165, 0.7);
}

/* Traffic-light buttons subtle glow on hover */
.term-dot {
  transition: filter 0.2s ease, transform 0.2s ease;
}
.term-window:hover .term-dot {
  filter: brightness(1.25);
}
