/* ============================================================
   Video Surveillance Structured Cabling Design Guide
   Solution Mall - Knowledge Center Style
   ============================================================ */

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

:root {
  --blue: #0D6EFD;
  --green: #198754;
  --white: #FFFFFF;
  --dark: #212529;
  --gray: #6C757D;
  --light: #F8F9FA;
  --border: #DEE2E6;
  --shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

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

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

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

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

.sidebar-logo a {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  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: 80px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--dark);
  font-size: 1rem;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 4px solid transparent;
}

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

.nav-item.active {
  background: var(--light);
  border-left-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-right: 16px;
  color: var(--blue);
  stroke: var(--blue);
}

.nav-item span {
  flex: 1;
  line-height: 1.3;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  background: var(--white);
  padding: 40px 50px;
}

.content-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

/* ---- HERO SECTION ---- */
.hero {
  background: linear-gradient(135deg, #0D6EFD 0%, #5DADE2 100%);
  border-radius: 16px;
  padding: 60px 50px;
  color: white;
  margin-bottom: 40px;
}

.hero-tag {
  display: inline-block;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 16px;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 20px;
}

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

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

.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  background: var(--white);
  color: var(--blue);
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}

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

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.7);
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}

.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: 24px;
  border-radius: 12px;
  margin-bottom: 40px;
}

.chapter-card {
  background: var(--white);
  border-radius: 8px;
  padding: 15px;
  height: 130px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: #333333;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid var(--border);
}

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

.chapter-card svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  stroke: var(--blue);
  color: var(--blue);
}

.chapter-card-text {
  font-size: 16px;
  font-weight: 500;
  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(--blue);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---- SECTION HEADINGS ---- */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 32px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

h2 { font-size: 2rem; font-weight: 700; color: var(--blue); margin-bottom: 16px; }
h3 { font-size: 1.5rem; font-weight: 600; color: var(--blue); margin-bottom: 12px; margin-top: 32px; }
h4 { font-size: 1.25rem; font-weight: 600; color: var(--blue); margin-bottom: 10px; margin-top: 24px; }

p { font-size: 1rem; color: var(--dark); line-height: 1.6; margin-bottom: 24px; }

/* ---- PAGE TITLE AREA ---- */
.page-title-area { margin-bottom: 32px; }
.page-title-area h1 { font-size: 2.5rem; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.page-title-area .subtitle { font-size: 0.875rem; color: var(--gray); }

/* ---- IMAGES ---- */
.figure-wrap {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #E7F1FF;
  padding: 16px;
}

.figure-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.figure-caption {
  font-size: 0.875rem;
  color: var(--gray);
  text-align: center;
  margin-top: 10px;
  font-style: italic;
}

/* ---- TABLES ---- */
.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.9rem;
}

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

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--dark);
  line-height: 1.5;
}

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

/* ---- LISTS ---- */
ul.bullet-list, ol.num-list {
  padding-left: 24px;
  margin-bottom: 24px;
}

ul.bullet-list li, ol.num-list li {
  line-height: 1.6;
  margin-bottom: 8px;
  color: var(--dark);
}

/* ---- CARDS ---- */
.info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.info-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ---- SCENARIO CARDS ---- */
.scenario-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.scenario-card img {
  width: 100%;
  height: auto;
  display: block;
}

.scenario-card-body {
  padding: 24px;
}

.scenario-card-body h4 {
  margin-top: 0;
  color: var(--blue);
}

/* ---- CALCULATOR ---- */
.calc-container {
  background: var(--light);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.calc-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.calc-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

.calc-field input, .calc-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s;
}

.calc-field input:focus, .calc-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}

.calc-result {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}

.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.calc-result-row:last-child { border-bottom: none; }

.calc-result-label { font-size: 0.9rem; color: var(--gray); }
.calc-result-value { font-size: 1.1rem; font-weight: 700; color: var(--blue); }

.calc-result-value.pass { color: var(--green); }
.calc-result-value.fail { color: #dc3545; }

.calc-btn {
  background: var(--blue);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.calc-btn:hover {
  background: #0b5ed7;
  transform: scale(1.02);
}

/* ---- HIGHLIGHT BOX ---- */
.highlight-box {
  background: #E7F1FF;
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.highlight-box p { margin-bottom: 0; color: var(--dark); }

/* ---- QUICK TARGETS TABLE ---- */
.quick-table { margin: 24px 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; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar { width: 0; overflow: hidden; }
  .main-content { margin-left: 0; padding: 20px; }
  .chapter-grid { grid-template-columns: 1fr 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
}
