/* OpenSecurityWiki Style System - Plantilla Theme */

:root {
  --bg:        #0d0d0d;
  --bg-card:   #111111;
  --bg-input:  #161616;
  --border:    #1e1e1e;
  --border-hover: #00ff8844;
  --accent:    #00ff88;
  --accent-dim:#00cc6a;
  --text:      #e0e0e0;
  --text-muted:#888888;
  --text-dim:  #444444;
  --red:       #f85149;
  --blue:      #58a6ff;
  --yellow:    #e3b341;
}

/* Themes from app.js */
body.theme-blue {
    --accent: #1fbaff;
    --accent-dim: #0088cc;
    --border-hover: rgba(31, 186, 255, 0.3);
}

body.theme-red {
    --accent: #fa2420;
    --accent-dim: #cc1111;
    --border-hover: rgba(250, 36, 32, 0.3);
}

body.theme-yellow {
    --accent: #fbbf24;
    --accent-dim: #d97706;
    --border-hover: rgba(251, 191, 36, 0.3);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 58px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s;
}

.logo-icon span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  transition: color 0.3s;
}

.logo-text {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
}

.logo-text em {
  color: var(--accent);
  font-style: normal;
  transition: color 0.3s;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* Language Selector (integrated in nav) */
.language-selector {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-flag {
  width: 20px;
  height: auto;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  border-radius: 2px;
  filter: grayscale(0.7);
}

.lang-flag:hover,
.lang-flag.active {
  transform: scale(1.1);
  filter: grayscale(0);
}

.nav-search {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s;
}

.nav-search:focus-within {
  border-color: var(--accent);
}

.nav-search i {
  font-size: 14px;
  color: var(--text-dim);
}

.nav-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  width: 160px;
}

.nav-search input::placeholder {
  color: var(--text-dim);
}

/* ── MAIN SEARCH (above categories) ── */
.main-search {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.main-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--border-hover);
}

.main-search i {
  font-size: 16px;
  color: var(--text-dim);
}

.main-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  width: 100%;
}

.main-search input::placeholder {
  color: var(--text-dim);
}

/* ── MAIN CONTENT ── */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2.5rem 4rem;
  width: 100%;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#wiki-content {
  animation: fade-in 0.3s ease-out;
}

/* ── MARKDOWN BODY STYLES ── */
.markdown-body {
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: #fff;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  position: relative;
}

.markdown-body h1 {
  font-size: 2.2rem;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.markdown-body h1::before {
  content: '>';
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  font-weight: bold;
}

.markdown-body h2 {
  font-size: 1.6rem;
  color: var(--text);
}

.markdown-body h3 {
  font-size: 1.3rem;
  color: var(--text);
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  margin-bottom: 1.2rem;
  font-size: 15px;
  color: var(--text-muted);
}

.markdown-body ul, .markdown-body ol {
  padding-left: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.5rem;
}

.markdown-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.4rem 1.6rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

.markdown-body pre::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 16px 0 0 var(--yellow), 32px 0 0 #3fb950; /* macOS terminal dots style */
  opacity: 0.8;
}

.markdown-body pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
  display: block;
  margin-top: 15px; /* space for the dots */
  background: transparent;
  padding: 0;
}

.markdown-body code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-input);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
  border: 1px solid var(--border);
}

.markdown-body a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.markdown-body a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1rem 0;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 0 6px 6px 0;
  color: var(--text);
  margin: 1.5rem 0;
  font-style: italic;
}

.markdown-body blockquote > :last-child {
  margin-bottom: 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  font-size: 14px;
}

.markdown-body th {
  background: var(--bg-card);
  color: #ccc;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
}

/* Glass Cards & Profile styling from old CSS for Team page */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.team-grid > a {
  display: flex !important; /* Override inline block */
  text-decoration: none;
  color: inherit;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, border-color 0.2s;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.profile-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
}

.profile-content {
  padding: 1.5rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: var(--bg-input);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent);
  overflow: hidden;
}

.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.profile-role {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.profile-bio {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  color: var(--text-muted);
  flex-grow: 1;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.social-btn {
  text-decoration: none;
  color: var(--text);
  background: var(--bg-input);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.social-btn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Portfolio Header */
.portfolio-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  margin-top: 1rem;
}
.portfolio-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.portfolio-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: var(--bg-input);
  margin: 0 !important;
}
.portfolio-header .markdown-body h1,
.portfolio-header h1 {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}
.portfolio-name {
  color: var(--text-muted);
  font-size: 15px;
  padding-bottom: 5px;
}

@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
    padding: 1rem;
    height: auto;
    gap: 1rem;
  }
  
  .nav-search {
    width: 100%;
    order: 3;
  }
  
  .nav-search input {
    width: 100%;
  }

  .main-content {
    padding: 2rem 1.5rem;
  }

  .home-cat-grid {
    grid-template-columns: 1fr;
  }

  .home-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }
}

/* ─── Home Hero ──────────────────────────────────────── */
.home-hero {
  padding: 2rem 0 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.home-hero-stats {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  padding-left: 2rem;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.home-stat-divider {
  width: 1px;
  height: 100%;
  min-height: 40px;
  background: var(--border);
  margin: 0 16px;
  align-self: stretch;
}

.home-terminal-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.4em;
}

.home-prompt {
  color: var(--accent);
  flex-shrink: 0;
}

.home-typewriter {
  color: var(--text-secondary);
}

.home-cursor-lema {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 300;
}

@keyframes blink {
  50% { opacity: 0; }
}

.home-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--text-primary);
  border: none !important;
}

.home-accent {
  color: var(--accent);
}

.home-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 2rem;
}

.home-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.home-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.home-stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-stat-sep {
  color: var(--border);
  font-size: 1.5rem;
}

/* ─── Home Categories ───────────────────────────────────── */
.home-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none !important;
  letter-spacing: 0.04em;
}

.home-prompt-small {
  color: var(--accent);
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

.home-cat-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.home-cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.home-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  text-decoration: none;
  color: inherit;
}

/* Blue Team */
.home-cat-blue:hover { border-color: #3b82f6; }
.home-cat-blue .home-cat-icon { color: #3b82f6; }
.home-cat-blue:hover .home-cat-icon { text-shadow: 0 0 20px #3b82f680; }
.home-cat-blue:hover::before { background: radial-gradient(circle at 20% 50%, #3b82f615, transparent 60%); opacity: 1; }

/* Red Team */
.home-cat-red:hover { border-color: #ef4444; }
.home-cat-red .home-cat-icon { color: #ef4444; }
.home-cat-red:hover .home-cat-icon { text-shadow: 0 0 20px #ef444480; }
.home-cat-red:hover::before { background: radial-gradient(circle at 20% 50%, #ef444415, transparent 60%); opacity: 1; }

/* Active Directory */
.home-cat-purple:hover { border-color: #a855f7; }
.home-cat-purple .home-cat-icon { color: #a855f7; }
.home-cat-purple:hover .home-cat-icon { text-shadow: 0 0 20px #a855f780; }
.home-cat-purple:hover::before { background: radial-gradient(circle at 20% 50%, #a855f715, transparent 60%); opacity: 1; }

/* CTF Writeups */
.home-cat-yellow:hover { border-color: #eab308; }
.home-cat-yellow .home-cat-icon { color: #eab308; }
.home-cat-yellow:hover .home-cat-icon { text-shadow: 0 0 20px #eab30880; }
.home-cat-yellow:hover::before { background: radial-gradient(circle at 20% 50%, #eab30815, transparent 60%); opacity: 1; }

/* AppSec */
.home-cat-green:hover { border-color: #22c55e; }
.home-cat-green .home-cat-icon { color: #22c55e; }
.home-cat-green:hover .home-cat-icon { text-shadow: 0 0 20px #22c55e80; }
.home-cat-green:hover::before { background: radial-gradient(circle at 20% 50%, #22c55e15, transparent 60%); opacity: 1; }

.home-cat-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 42px;
  text-align: center;
  transition: text-shadow 0.3s;
}

.home-cat-body {
  flex: 1;
  min-width: 0;
}

.home-cat-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--text-primary);
}

.home-cat-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.7rem;
  line-height: 1.5;
}

.home-cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.home-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: var(--bg-input);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 0.03em;
}

.home-cat-arrow {
  color: var(--border);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: color 0.25s, transform 0.25s;
}

.home-cat-card:hover .home-cat-arrow {
  transform: translateX(4px);
  color: var(--text-muted);
}

/* ─── Plantilla-style category cards (home) ───────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none !important;
}

.section-title::before { content: '// '; color: var(--text-dim); }

.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 2rem;
}

.cat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.cat:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.cat-link {
  text-decoration: none;
  color: inherit;
}

.cat-link:hover {
  text-decoration: none;
  color: inherit;
}

.cat-icon {
  font-size: 22px;
  color: var(--accent);
}

.cat-name {
  font-size: 13px;
  color: #ccc;
  font-weight: 500;
}

.cat-count {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.cat-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 9px;
  border-radius: 4px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag-green  { background: #0d1f15; border: 1px solid #0d3320; color: #00cc6a; }
.tag-red    { background: #1f0d0d; border: 1px solid #3d1515; color: #f85149; }
.tag-blue   { background: #0d1525; border: 1px solid #0d2a4d; color: #58a6ff; }
.tag-yellow { background: #1f1a0a; border: 1px solid #3d3010; color: #e3b341; }
.tag-purple { background: #160d1f; border: 1px solid #2e0d4d; color: #a855f7; }

/* ─── Category card color variants ─────────────────────── */
.cat-blue:hover   { border-color: #4972f8; box-shadow: 0 4px 20px rgba(73,114,248,.15); }
.cat-red:hover    { border-color: #f85149; box-shadow: 0 4px 20px rgba(248,81,73,.15); }
.cat-purple:hover { border-color: #a855f7; box-shadow: 0 4px 20px rgba(168,85,247,.15); }
.cat-yellow:hover { border-color: #e3b341; box-shadow: 0 4px 20px rgba(227,179,65,.15); }
.cat-green:hover  { border-color: #22c55e; box-shadow: 0 4px 20px rgba(34,197,94,.15); }

/* cat hidden by filters */
.cat.cat-hidden {
  display: none !important;
}

/* ─── Filter Bar ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.4rem;
  margin-bottom: 1.6rem;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 4px;
  user-select: none;
}

.filter-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
  letter-spacing: 0.03em;
}

.filter-chip:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

/* Active state base */
.filter-chip.active {
  background: var(--bg-card);
  color: #fff;
  border-color: var(--text-muted);
}

/* Colored active states */
.filter-chip-blue.active  { background: #0d1525; border-color: #4972f8; color: #7a9eff; box-shadow: 0 0 8px rgba(73,114,248,.25); }
.filter-chip-red.active   { background: #1f0d0d; border-color: #f85149; color: #f8776e; box-shadow: 0 0 8px rgba(248,81,73,.25); }
.filter-chip-purple.active{ background: #160d1f; border-color: #a855f7; color: #c07ef9; box-shadow: 0 0 8px rgba(168,85,247,.25); }
.filter-chip-green.active { background: #0d1f15; border-color: #22c55e; color: #4ade80; box-shadow: 0 0 8px rgba(34,197,94,.25); }


/* ─── Category Pages (Article Grid) ───────────────────── */
.cat-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cat-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}

.breadcrumb-home { color: var(--text-muted); transition: color 0.2s; font-weight: 600; text-decoration: none; }
.breadcrumb-home:hover { color: var(--accent); opacity: 1 !important; text-decoration: none; }
.breadcrumb-home i { margin-right: 4px; }
.breadcrumb-sep { color: var(--border); font-weight: 600; }
.breadcrumb-link { color: var(--text-muted); transition: color 0.2s; font-weight: 600; text-decoration: none; }
.breadcrumb-link:hover { color: var(--accent); opacity: 1 !important; text-decoration: none; }
.breadcrumb-current { color: var(--accent); }

.cat-page-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.article-search-bar {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
  transition: border-color 0.2s;
}

.article-search-bar:focus-within { border-color: var(--accent); }
.article-search-bar i { font-size: 16px; color: var(--text-dim); }
.article-search-bar input {
  background: none; border: none; outline: none;
  font-size: 14px; color: var(--text);
  font-family: 'Inter', sans-serif;
  width: 100%;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: #151515;
  text-decoration: none !important;
}

.article-card:hover .article-card-title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.article-card:hover .article-card-tags,
.article-card:hover .article-meta,
.article-card-tags,
.article-meta,
.article-tag {
  text-decoration: none !important;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  width: fit-content;
}

.article-tag i { font-size: 12px; }

/* Tag variants for articles */
.article-tag-green  { background: #0d1f15; color: #4ade80; border: 1px solid #0d3320; }
.article-tag-red    { background: #1f0d0d; color: #f87171; border: 1px solid #3d1515; }
.article-tag-blue   { background: #0d1525; color: #60a5fa; border: 1px solid #0d2a4d; }
.article-tag-yellow { background: #1f1a0a; color: #fbbf24; border: 1px solid #3d3010; }
.article-tag-purple { background: #160d1f; color: #c084fc; border: 1px solid #2e0d4d; }

.article-title {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
  line-height: 1.4;
  margin-top: 4px;
  flex-grow: 1;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  margin-top: 8px;
}
.article-meta span {
  display: flex; align-items: center; gap: 4px;
}


.home-shell,
.page-shell { width: 100%; }

/* ─── Hero Section ────────────────────────────────────── */
.hero-section {
  padding: 4rem 2.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

.hero-left {
  flex: 1;
  max-width: 560px;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  flex-shrink: 0;
  min-width: 400px;
  max-width: 540px;
}

.hero-stats-box {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  overflow: hidden;
  margin-top: 2rem;
  width: fit-content;
}

.hero-stat-block {
  text-align: center;
  padding: 1rem 1.5rem;
}

.hero-stat-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

.hero-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-label::before { content: '> '; }

.hero-title {
  font-size: 2.6rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1.1rem;
  border: none !important;
}

.hero-title span { color: var(--accent); }

.hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.8rem;
  max-width: 480px;
}

.hero-btns {
  display: flex;
  gap: 12px;
  margin-bottom: 2.5rem;
}

.btn-primary {
  background: var(--accent);
  color: #0d0d0d;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: opacity 0.2s;
  display: inline-block;
}

.btn-primary:hover { opacity: 0.88; text-decoration: none; color: #0d0d0d; }

.btn-ghost {
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
}

.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); text-decoration: none; }

.hero-stats {
  display: flex;
  gap: 2rem;
  padding-top: 1.8rem;
  border-top: 1px solid #1a1a1a;
}

.stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  color: #fff;
  font-weight: 600;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ─── Main shell (categories / tools) ────────────────── */
.main-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem 4rem;
}

/* ─── Tool cards ──────────────────────────────────────── */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 3rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.2s;
}

.tool-card:hover { border-color: var(--border-hover); }

.tool-icon {
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.tool-name {
  font-size: 13px;
  color: #ccc;
  font-weight: 500;
}

.tool-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.5;
}

.see-all {
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.see-all:hover { color: var(--accent); text-decoration: none; }

/* ─── Site Footer ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid #161616;
  padding: 1.2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-txt {
  font-size: 11px;
  color: #2e2e2e;
  font-family: 'JetBrains Mono', monospace;
}

.footer-txt span { color: #00ff8844; }
.footer-dim { color: #2a2a2a !important; }

/* ─── Mini Terminal ───────────────────────────────────── */
.mini-terminal {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  margin-top: 1rem;
  flex-shrink: 0;
}

.mini-term-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: #161616;
  border-bottom: 1px solid var(--border);
}

.mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.mini-term-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #444;
  margin-left: 6px;
}

.mini-term-body {
  padding: 0.9rem 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  line-height: 1.8;
  height: 250px;
  overflow-y: hidden;
  color: #888;
  margin-bottom: 1.1rem;
  border: none !important;
}

.hero-title span { color: var(--accent); }

.hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.8rem;
  max-width: 480px;
}

.hero-btns {
  display: flex;
  gap: 12px;
  margin-bottom: 2.5rem;
}

.btn-primary {
  background: var(--accent);
  color: #0d0d0d;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: opacity 0.2s;
  display: inline-block;
}

.btn-primary:hover { opacity: 0.88; text-decoration: none; color: #0d0d0d; }

.btn-ghost {
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
}

.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); text-decoration: none; }

.hero-stats {
  display: flex;
  gap: 2rem;
  padding-top: 1.8rem;
  border-top: 1px solid #1a1a1a;
}

.stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  color: #fff;
  font-weight: 600;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ─── Main shell (categories / tools) ────────────────── */
.main-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem 4rem;
}

/* ─── Tool cards ──────────────────────────────────────── */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 3rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.2s;
}

.tool-card:hover { border-color: var(--border-hover); }

.tool-icon {
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.tool-name {
  font-size: 13px;
  color: #ccc;
  font-weight: 500;
}

.tool-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.5;
}

.see-all {
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.see-all:hover { color: var(--accent); text-decoration: none; }

/* ─── Site Footer ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid #161616;
  padding: 1.2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-txt {
  font-size: 11px;
  color: #2e2e2e;
  font-family: 'JetBrains Mono', monospace;
}

.footer-txt span { color: #00ff8844; }
.footer-dim { color: #2a2a2a !important; }

/* ─── Mini Terminal ───────────────────────────────────── */
.mini-terminal {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  margin-top: 1rem;
  flex-shrink: 0;
}

.mini-term-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: #161616;
  border-bottom: 1px solid var(--border);
}

.mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.mini-term-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #444;
  margin-left: 6px;
}

.mini-term-body {
  padding: 1.2rem 1.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  height: 340px;
  overflow-y: hidden;
  color: #888;
  scrollbar-width: none;
}

.mini-term-body::-webkit-scrollbar { display: none; }

/* Search and Filter template styles */
.search-filter-section { padding: 0 24px 24px; }
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #444; pointer-events: none; }
.osw-search { width: 100%; padding: 10px 14px 10px 36px; background: #111; border: 0.5px solid #222; border-radius: var(--radius, 8px); color: #e0e0e0; font-size: 12px; font-family: monospace; outline: none; transition: border-color 0.15s; }
.osw-search::placeholder { color: #333; }
.osw-search:focus { border-color: #00ff8844; }

.filters-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filter-group { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.filter-divider { width: 0.5px; height: 20px; background: #222; }
.filter-label { font-size: 10px; color: #333; font-family: monospace; letter-spacing: 0.05em; }

.ftag {
  font-size: 10px; padding: 4px 10px; border-radius: 99px;
  border: 0.5px solid #222; background: #111; color: #444;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.ftag:hover { border-color: #333; color: #888; }
.ftag.on-blue   { background: #0f2040; color: #4d9ef7; border-color: #1a3a6a; }
.ftag.on-red    { background: #2a0f0f; color: #f75a5a; border-color: #5a1a1a; }
.ftag.on-green  { background: #0f2a18; color: #00cc6a; border-color: #1a4a2a; }
.ftag.on-purple { background: #1a1030; color: #a080f0; border-color: #3a2060; }
.ftag.on-gray   { background: #2b2b2b; color: #ffffff; border-color: #666; }
.ftag.on-amber  { background: #2a1e0a; color: #f0a040; border-color: #4a3010; }
.ftag.on-orange { background: #2a1500; color: #ff6a20; border-color: #5a2a00; }
.ftag.on-yellow { background: #2a2a00; color: #e6c300; border-color: #5a5a00; }
.section-label { font-size: 10px; color: #333; letter-spacing: 0.1em; font-family: monospace; margin-bottom: 12px; padding: 0 24px; }

/* Categories Overview Grid */
.categories-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 24px 24px;
}

@media (max-width: 900px) {
  .categories-overview-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .categories-overview-grid { grid-template-columns: 1fr; }
}

.cat-overview-card {
  background: #0d0d0d;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-overview-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.cat-overview-card .cat-icon {
  font-size: 16px;
  margin-bottom: 8px;
}

.cat-overview-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e0;
}

.cat-overview-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #555;
}

.subcat-filters {
  margin-bottom: 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-subcat {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-subcat:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-subcat.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

/* Split View Layout */
.split-view-container {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.split-view-main {
  flex: 1;
  min-width: 0;
}

.split-view-sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 10px;
}

/* Scrollbar sidebar */
.split-view-sidebar::-webkit-scrollbar {
  width: 6px;
}
.split-view-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.split-view-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.sidebar-article-card {
  display: block;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  margin-bottom: 0.8rem;
  transition: all 0.2s;
}

.sidebar-article-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.sidebar-article-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.sidebar-article-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
