/* =========================================
   Solution Mall - Explosion-Proof Guide
   Shared Stylesheet
   ========================================= */

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

:root {
  --primary: #0D6EFD;
  --primary-dark: #0a58ca;
  --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;
  color: var(--text-dark);
  background: var(--bg);
  line-height: 1.6;
}

/* ---- 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: 12px 16px;
  background: var(--light-gray);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-align: center;
}

.sidebar-logo img {
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto 6px;
}

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

.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;
  width: 100%;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-dark);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 4px solid transparent;
}

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

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

.nav-indicator {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}

.nav-icon {
  width: 24px; height: 24px;
  color: var(--primary);
  flex-shrink: 0;
  margin-right: 16px;
  margin-left: 4px;
}

.nav-label {
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text-dark);
  flex: 1;
}

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

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

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

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

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

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

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

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

.btn-primary-hero:hover { background: #e8f0fe; transform: translateY(-1px); }

.btn-outline-hero {
  background: transparent;
  color: #fff;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s;
}

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

/* ---- SECTION HEADINGS ---- */
h1.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

h2.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  margin-top: 40px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

h3.subsection-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  margin-top: 32px;
}

h4.sub-sub-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
  margin-top: 24px;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-gray);
  margin-bottom: 16px;
}

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

/* ---- PARAGRAPHS ---- */
p {
  font-size: 1rem;
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

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

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

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

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

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

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

tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
  vertical-align: top;
  line-height: 1.5;
}

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

/* ---- CARDS ---- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.075);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

/* ---- CHAPTER CARDS GRID ---- */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
  background: #F4F7F6;
  padding: 24px;
  border-radius: 12px;
}

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

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

.chapter-card-icon {
  width: 40px; height: 40px;
  color: var(--primary);
  flex-shrink: 0;
}

.chapter-card-title {
  font-size: 1rem;
  color: #333;
  font-weight: 500;
  line-height: 1.3;
  flex: 1;
  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%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- LISTS ---- */
ul.bullet-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

ul.bullet-list li {
  padding: 6px 0 6px 20px;
  position: relative;
  line-height: 1.6;
  color: var(--text-dark);
}

ul.bullet-list li::before {
  content: '•';
  color: var(--primary);
  position: absolute;
  left: 0;
  font-weight: 700;
}

ol.numbered-list {
  padding-left: 20px;
  margin: 0 0 1.5rem;
}

ol.numbered-list li {
  padding: 4px 0;
  line-height: 1.6;
  color: var(--text-dark);
}

/* ---- INFO BOXES ---- */
.info-box {
  background: #e8f0fe;
  border-left: 4px solid var(--primary);
  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;
}

.danger-box {
  background: #fde8e8;
  border-left: 4px solid #dc3545;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
