/* HTB Writeups - Custom Theme Overrides */
/* Extends just-the-docs dark theme with HTB branding */

:root {
  --htb-green: #9fef00;
  --htb-dark: #141d2b;
  --htb-darker: #0a0e17;
  --htb-card: #1a2332;
  --htb-border: #2a3a4e;
  --htb-text: #a4b1cd;
  --htb-text-bright: #d4dae5;
  --easy: #4ade80;
  --medium: #fb923c;
  --hard: #ef4444;
  --insane: #a855f7;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better heading anchors */
h1, h2, h3, h4, h5, h6 {
  scroll-margin-top: 80px;
}

/* HTB-branded callout boxes */
.htb-box {
  border-left: 4px solid var(--htb-green);
  background: rgba(159, 239, 0, 0.05);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
}

.htb-box-title {
  color: var(--htb-green);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Difficulty badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-easy {
  background: rgba(74, 222, 128, 0.15);
  color: var(--easy);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-medium {
  background: rgba(251, 146, 60, 0.15);
  color: var(--medium);
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-hard {
  background: rgba(239, 68, 68, 0.15);
  color: var(--hard);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-insane {
  background: rgba(168, 85, 247, 0.15);
  color: var(--insane);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* OS badges */
.badge-linux {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-windows {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

/* Stats cards grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: linear-gradient(135deg, rgba(159, 239, 0, 0.08), rgba(159, 239, 0, 0.02));
  border: 1px solid rgba(159, 239, 0, 0.15);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(159, 239, 0, 0.4);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--htb-green);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--htb-text);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.feature-card {
  background: rgba(26, 35, 50, 0.6);
  border: 1px solid var(--htb-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--htb-green);
  transform: translateY(-2px);
}

.feature-card h3 {
  color: var(--htb-green);
  margin-top: 0;
  font-size: 1.1rem;
}

.feature-card p {
  color: var(--htb-text);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Better table styling */
.main-content table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
}

.main-content table thead th {
  background: rgba(159, 239, 0, 0.1);
  border-bottom: 2px solid rgba(159, 239, 0, 0.2);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
}

.main-content table tbody tr {
  transition: background 0.15s;
}

.main-content table tbody tr:hover {
  background: rgba(159, 239, 0, 0.04);
}

.main-content table td {
  padding: 0.6rem 1rem;
}

/* Mermaid diagram container improvements */
.mermaid {
  background: rgba(10, 14, 23, 0.5);
  border: 1px solid var(--htb-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
  overflow-x: auto;
}

/* Navigation highlight for current section */
.nav-list .nav-list-item .nav-list-link.active {
  border-left-color: var(--htb-green);
  color: var(--htb-green);
}

/* Link styling */
.main-content a {
  transition: color 0.15s;
}

.main-content a:hover {
  color: var(--htb-green);
}

/* Code block improvements */
.main-content code {
  border-radius: 4px;
  font-size: 0.85em;
}

/* Details/accordion improvements */
details {
  border: 1px solid var(--htb-border);
  border-radius: 8px;
  margin: 1rem 0;
  overflow: hidden;
}

details summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}

details summary:hover {
  background: rgba(159, 239, 0, 0.04);
}

details[open] summary {
  border-bottom: 1px solid var(--htb-border);
}

details > *:not(summary) {
  padding: 0 1rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Print improvements */
@media print {
  .stat-card, .feature-card {
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
