/* ============================================================
   Core Switch Security Hardening Design Guide - Shared Styles
   ============================================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

a { color: #0D6EFD; text-decoration: none; }
a:hover { text-decoration: underline; color: #0a58ca; }

/* ============================================================
   LEFT SIDEBAR - Fixed 280px
   ============================================================ */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #DEE2E6;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid #DEE2E6;
  background: #F8F9FA;
  flex-shrink: 0;
}

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

.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-track { background: #f1f1f1; }
.sidebar-menu::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  height: 80px; /* 5rem */
  padding: 12px 16px;
  text-decoration: none;
  color: #212529;
  border-left: 4px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.nav-item:hover {
  background: #F8F9FA;
  text-decoration: none;
  color: #212529;
}

.nav-item.active {
  border-left-color: #0D6EFD;
  background: #F8F9FA;
  color: #0D6EFD;
}

.nav-item.active span { color: #0D6EFD; font-weight: 600; }

.nav-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  color: #0D6EFD;
  margin-right: 16px;
}

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

/* ============================================================
   MAIN CONTENT AREA - left margin 280px
   ============================================================ */
#main-content {
  margin-left: 280px;
  min-height: 100vh;
  background: #f0f2f5;
}

.content-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 40px 60px;
}

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

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

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

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

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

.btn-primary-white {
  background: #ffffff;
  color: #0D6EFD;
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}
.btn-primary-white:hover { background: #f0f0f0; text-decoration: none; color: #0a58ca; transform: translateY(-1px); }

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

/* ============================================================
   CHAPTER NAVIGATION CARDS
   ============================================================ */
.chapter-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.chapter-nav-card {
  background: #ffffff;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  padding: 15px;
  height: 130px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: #333333;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.075);
  overflow: hidden;
}

.chapter-nav-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
  text-decoration: none;
  color: #333333;
}

.chapter-nav-card .card-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  color: #0D6EFD;
}

.chapter-nav-card .card-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  color: #333333;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chapter-nav-card .card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #0D6EFD;
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.section-divider {
  border: none;
  border-top: 1px solid #DEE2E6;
  margin: 32px 0;
}

h1.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0D6EFD;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #6C757D;
  margin-bottom: 16px;
}

h2.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #0D6EFD;
  margin: 40px 0 16px;
}

h3.subsection-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0D6EFD;
  margin: 32px 0 12px;
}

h4.sub-subsection-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0D6EFD;
  margin: 24px 0 10px;
}

p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  color: #212529;
}

/* ============================================================
   IMAGES & FIGURES
   ============================================================ */
.figure-container {
  background: #ffffff;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0;
  text-align: center;
}

.figure-container img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  aspect-ratio: 3/2;
  object-fit: cover;
}

.figure-caption {
  font-size: 0.875rem;
  color: #6C757D;
  margin-top: 12px;
  text-align: center;
  font-style: italic;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 8px;
  border: 1px solid #DEE2E6;
}

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

thead th {
  background: #F8F9FA;
  color: #212529;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid #DEE2E6;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #DEE2E6;
  color: #212529;
  vertical-align: top;
  line-height: 1.5;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #F8F9FA; }

/* ============================================================
   LISTS
   ============================================================ */
ul.content-list, ol.content-list {
  padding-left: 24px;
  margin-bottom: 1.5rem;
}

ul.content-list li, ol.content-list li {
  line-height: 1.6;
  margin-bottom: 8px;
  color: #212529;
}

/* ============================================================
   INFO BOXES
   ============================================================ */
.info-box {
  background: #E7F1FF;
  border-left: 4px solid #0D6EFD;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.warning-box {
  background: #FFF3CD;
  border-left: 4px solid #FFC107;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.success-box {
  background: #D1E7DD;
  border-left: 4px solid #198754;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

/* ============================================================
   FEATURE CARDS (used in homepage)
   ============================================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.feature-card {
  background: #ffffff;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.075);
  transition: box-shadow 0.2s;
}

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

.feature-card .feature-icon {
  width: 40px;
  height: 40px;
  color: #0D6EFD;
  margin-bottom: 12px;
}

.feature-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.875rem;
  color: #6C757D;
  margin-bottom: 0;
  line-height: 1.5;
}

/* ============================================================
   SCENARIO CARDS (Chapter 3)
   ============================================================ */
.scenario-card {
  background: #ffffff;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  overflow: hidden;
  margin: 32px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.scenario-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  object-fit: cover;
}

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

.scenario-card-body h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0D6EFD;
  margin-bottom: 12px;
}

.scenario-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.metric-item {
  background: #F8F9FA;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0D6EFD;
}

.metric-label {
  font-size: 0.75rem;
  color: #6C757D;
  margin-top: 4px;
}

/* ============================================================
   CALCULATOR (Chapter 9)
   ============================================================ */
.calc-container {
  background: #ffffff;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.calc-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0D6EFD;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #E7F1FF;
}

.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: #212529;
  margin-bottom: 6px;
}

.calc-field input[type="number"],
.calc-field input[type="range"],
.calc-field select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #DEE2E6;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #212529;
  background: #ffffff;
  transition: border-color 0.15s;
}

.calc-field input[type="number"]:focus,
.calc-field select:focus {
  outline: none;
  border-color: #0D6EFD;
  box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}

.calc-result {
  background: linear-gradient(135deg, #0D6EFD, #1a7fe0);
  border-radius: 8px;
  padding: 20px;
  color: #ffffff;
  margin-top: 16px;
}

.calc-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.calc-result-item { text-align: center; }
.calc-result-value { font-size: 1.75rem; font-weight: 700; }
.calc-result-label { font-size: 0.8rem; opacity: 0.85; margin-top: 4px; }

.calc-btn {
  background: #0D6EFD;
  color: #ffffff;
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}
.calc-btn:hover { background: #0a58ca; transform: translateY(-1px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  #sidebar { width: 240px; }
  #main-content { margin-left: 240px; }
  .content-wrapper { padding: 24px 20px 40px; }
  .chapter-nav-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .scenario-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  #sidebar { display: none; }
  #main-content { margin-left: 0; }
  .chapter-nav-grid { grid-template-columns: 1fr; }
  .hero-section { padding: 40px 24px; }
  .hero-section h1 { font-size: 1.75rem; }
}
