/* ============================================================
   Cybersecurity Monitoring Architecture Design Guide
   Shared CSS - Solution Mall Knowledge Center
   ============================================================ */

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

:root {
  --primary: #0D6EFD;
  --secondary: #198754;
  --bg: #FFFFFF;
  --text-dark: #212529;
  --text-gray: #6C757D;
  --light-gray: #F8F9FA;
  --border: #DEE2E6;
  --sidebar-width: 280px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-dark);
  background: #f0f2f5;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar-logo {
  padding: 1rem;
  background: var(--light-gray);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-align: center;
}

.sidebar-logo img {
  max-width: 180px;
  height: auto;
}

.sidebar-logo a {
  display: block;
  margin-top: 0.5rem;
  color: var(--primary);
  font-size: 0.8rem;
  text-decoration: none;
}

.sidebar-logo a:hover { text-decoration: underline; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 5rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-dark);
  position: relative;
  border-left: 4px solid transparent;
  transition: background 0.15s;
  gap: 1rem;
}

.nav-item:hover { background: var(--light-gray); cursor: pointer; }

.nav-item.active {
  background: var(--light-gray);
  border-left-color: var(--primary);
}

.nav-item svg {
  flex-shrink: 0;
  width: 24px; height: 24px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item span {
  font-size: 0.9rem;
  line-height: 1.3;
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: #fff;
}

.content-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 3rem;
}

/* ---- Hero Section ---- */
.hero {
  background: linear-gradient(135deg, #0D6EFD 0%, #1a7aff 60%, #5DADE2 100%);
  border-radius: 1rem;
  padding: 60px 50px;
  color: #fff;
  margin-bottom: 2.5rem;
}

.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover { background: #e8f0fe; transform: scale(1.02); }

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.7);
  padding: 0.625rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover { background: rgba(255,255,255,0.15); }

/* ---- Chapter Cards Grid ---- */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  background: #F4F7F6;
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 2.5rem;
}

.chapter-card {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  height: 130px;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  text-decoration: none;
  color: #333;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid var(--border);
  overflow: hidden;
}

.chapter-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.chapter-card svg {
  flex-shrink: 0;
  width: 40px; height: 40px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chapter-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chapter-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--primary);
  color: #fff;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ---- Page Title ---- */
.page-title-area {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-title-area h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.page-title-area .subtitle {
  font-size: 0.875rem;
  color: var(--text-gray);
}

/* ---- Section headings ---- */
h2 { font-size: 2rem; font-weight: 700; color: var(--primary); margin: 2rem 0 1rem; }
h3 { font-size: 1.5rem; font-weight: 600; color: var(--primary); margin: 1.75rem 0 0.875rem; }
h4 { font-size: 1.25rem; font-weight: 600; color: var(--primary); margin: 1.5rem 0 0.75rem; }

p { margin-bottom: 1.5rem; line-height: 1.6; color: var(--text-dark); }

/* ---- Figure / Image ---- */
.figure-block {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #E7F1FF;
}

.figure-block img {
  width: 100%;
  display: block;
  aspect-ratio: 3/2;
  object-fit: cover;
}

.figure-caption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-gray);
  background: var(--light-gray);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.9rem;
}

thead th {
  background: var(--light-gray);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafafa; }

/* ---- Info Cards ---- */
.info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.info-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

/* ---- Lists ---- */
ul.bullet-list, ol.numbered-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

ul.bullet-list li, ol.numbered-list li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-dark);
}

/* ---- KPI Badge ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.kpi-card {
  background: linear-gradient(135deg, #0D6EFD 0%, #1a7aff 100%);
  color: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-align: center;
}

.kpi-card .kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  display: block;
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

/* ---- Section divider ---- */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ---- Highlight box ---- */
.highlight-box {
  background: #E7F1FF;
  border-left: 4px solid var(--primary);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.highlight-box p { margin-bottom: 0; }

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