/* ═══════════════════════════════════════════════════════════════════════════
   CyberHub — Shared Knowledge-Page Stylesheet
   Loaded by all pages in /security/ and /ai/
   Hub pages (index.html, security.html, ai.html) use their own inline CSS.
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ── DESIGN TOKENS ────────────────────────────────────────────────────────── */
:root {
  --bg-dark:        #0a0e27;
  --bg-darker:      #050711;
  --bg-card:        #1a1f3a;
  --accent-cyan:    #00d9ff;
  --accent-blue:    #0066ff;
  --accent-purple:  #8b5cf6;
  --accent-orange:  #f97316;
  --accent-red:     #ef4444;
  --text-primary:   #e0e8ff;
  --text-secondary: #a0aec0;
  --success:        #10b981;
  --warning:        #f59e0b;
}

/* ── BASE ─────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(0, 217, 255, .05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, .05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── NAVIGATION ───────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 39, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 217, 255, .1);
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  transition: color .3s;
}

nav a:hover { color: var(--accent-cyan); }

.btn-nav {
  padding: .5rem 1.2rem;
  border: 1px solid var(--accent-cyan);
  border-radius: 6px;
  color: var(--accent-cyan) !important;
  font-size: .9rem;
  transition: background .2s;
}

.btn-nav:hover { background: rgba(0, 217, 255, .1); }

/* ── PAGE HEADER ──────────────────────────────────────────────────────────── */
.page-header {
  padding: 4rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid rgba(0, 217, 255, .1);
  margin-bottom: 3rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(135deg,
    var(--accent-cyan)   0%,
    var(--accent-blue)  50%,
    var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── PAGE METADATA BAR ────────────────────────────────────────────────────── */
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.25rem;
  margin-top: 1.25rem;
  justify-content: center;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  color: var(--text-secondary);
  background: rgba(0, 217, 255, .04);
  border: 1px solid rgba(0, 217, 255, .15);
  padding: .28rem .85rem;
  border-radius: 20px;
  white-space: nowrap;
}

.meta-item.difficulty-beginner    { border-color: rgba(16, 185, 129, .35); color: var(--success); }
.meta-item.difficulty-intermediate { border-color: rgba(245, 158, 11, .35); color: var(--warning); }
.meta-item.difficulty-advanced    { border-color: rgba(239, 68, 68, .35);  color: var(--accent-red); }

/* ── SERIES NAV & PREV/NEXT ───────────────────────────────────────────────── */
.series-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.5rem;
}

.series-nav a {
  background: rgba(0, 217, 255, .08);
  border: 1px solid rgba(0, 217, 255, .2);
  border-radius: 20px;
  padding: .4rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .85rem;
  transition: all .2s;
}

.series-nav a:hover {
  background: rgba(0, 217, 255, .15);
  color: var(--text-primary);
}

.series-nav a.active {
  background: rgba(0, 217, 255, .2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.prev-next {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  margin-bottom: 3rem;
}

.prev-next a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: .9rem;
  padding: .5rem 1rem;
  border: 1px solid rgba(0, 217, 255, .2);
  border-radius: 6px;
  transition: all .2s;
}

.prev-next a:hover { background: rgba(0, 217, 255, .1); }

/* ── MAIN CONTENT ─────────────────────────────────────────────────────────── */
main { padding: 0 0 4rem; }

.section { margin-bottom: 4rem; }

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(26, 31, 58, .6) 100%);
  border: 1px solid rgba(0, 217, 255, .2);
  border-radius: 12px;
  padding: 2rem;
  transition: all .3s;
}

.card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0, 217, 255, .12);
}

.card h3 { font-size: 1.2rem; color: var(--accent-blue); margin-bottom: .75rem; }
.card p  { color: var(--text-secondary); line-height: 1.7; margin-bottom: 1rem; }

/* ── LISTS ────────────────────────────────────────────────────────────────── */
.knowledge-list { list-style: none; }

.knowledge-list li {
  padding: .7rem 0 .7rem 2rem;
  position: relative;
  color: var(--text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid rgba(0, 217, 255, .06);
}

.knowledge-list li:last-child { border-bottom: none; }

.knowledge-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-weight: bold;
}

/* ── TAGS ─────────────────────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.tag {
  background: rgba(0, 217, 255, .1);
  color: var(--accent-cyan);
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .8rem;
  border: 1px solid rgba(0, 217, 255, .3);
}

.tag.danger  { background: rgba(239, 68, 68, .1);   color: var(--accent-red);    border-color: rgba(239, 68, 68, .3); }
.tag.warning { background: rgba(245, 158, 11, .1);  color: var(--warning);       border-color: rgba(245, 158, 11, .3); }
.tag.success { background: rgba(16, 185, 129, .1);  color: var(--success);       border-color: rgba(16, 185, 129, .3); }
.tag.purple  { background: rgba(139, 92, 246, .1);  color: var(--accent-purple); border-color: rgba(139, 92, 246, .3); }

/* ── TABLES ───────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  /* vertical margin handled by .table-wrapper */
}

th {
  background: linear-gradient(135deg, rgba(0, 217, 255, .1), rgba(139, 92, 246, .1));
  border: 1px solid rgba(0, 217, 255, .2);
  padding: 1rem;
  text-align: left;
  color: var(--accent-cyan);
  font-weight: 600;
  white-space: nowrap;
}

td {
  border: 1px solid rgba(0, 217, 255, .1);
  padding: 1rem;
  color: var(--text-secondary);
  vertical-align: top;
}

tr:hover td { background: rgba(0, 217, 255, .03); }

/* ── CALLOUTS ─────────────────────────────────────────────────────────────── */
.callout {
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--accent-cyan);
  background: rgba(0, 217, 255, .05);
  border-radius: 0 8px 8px 0;
  margin: 2rem 0;
}

.callout.danger  { border-left-color: var(--accent-red);    background: rgba(239, 68, 68, .05); }
.callout.warning { border-left-color: var(--warning);       background: rgba(245, 158, 11, .05); }
.callout.success { border-left-color: var(--success);       background: rgba(16, 185, 129, .05); }
.callout.purple  { border-left-color: var(--accent-purple); background: rgba(139, 92, 246, .05); }

.callout h4              { margin-bottom: .5rem; color: var(--accent-cyan); }
.callout.danger h4       { color: var(--accent-red); }
.callout.warning h4      { color: var(--warning); }
.callout.success h4      { color: var(--success); }
.callout.purple h4       { color: var(--accent-purple); }
.callout p, .callout li  { color: var(--text-secondary); line-height: 1.7; }

/* ── CODE ─────────────────────────────────────────────────────────────────── */
pre {
  background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(0, 217, 255, .15);
  border-radius: 8px;
  padding: 1.5rem;
  color: #a8d8a8;
  font-size: .9rem;
  overflow-x: auto;
  line-height: 1.6;
  margin: 1rem 0;
}

/* ── DIVIDER ──────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 217, 255, .3), transparent);
  margin: 3rem 0;
}

/* ── FOOTER ───────────────────────────────────────────────────────────────── */
footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(0, 217, 255, .1);
  color: var(--text-secondary);
  text-align: center;
  margin-top: 5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color .3s;
}

.footer-links a:hover { color: var(--accent-cyan); }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .content-grid   { grid-template-columns: 1fr; }
  h1              { font-size: 1.8rem; }
  .section-title  { font-size: 1.4rem; }
  th, td          { padding: .75rem; }
  .page-meta      { gap: .4rem .9rem; }
  .prev-next      { flex-direction: column; gap: .75rem; }
}
