/* ============================================================
   Solution Mall — Underground Parking Surveillance Design Guide
   Shared Stylesheet
   ============================================================ */

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

:root {
  --blue: #0D6EFD;
  --blue-dark: #0A58CA;
  --green: #198754;
  --white: #FFFFFF;
  --bg: #F4F7F6;
  --text: #212529;
  --text-muted: #6C757D;
  --border: #DEE2E6;
  --sidebar-w: 280px;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

.sidebar-logo {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  display: block;
  margin-bottom: 6px;
}

.sidebar-logo a {
  font-size: 0.78rem;
  color: var(--blue);
  text-decoration: none;
}

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

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

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

.nav-item {
  display: flex;
  align-items: center;
  height: 80px; /* 5rem */
  padding: 0 20px;
  text-decoration: none;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  gap: 12px;
}

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

.nav-item svg { flex-shrink: 0; color: var(--blue); }
.nav-item span { font-size: 0.875rem; line-height: 1.3; }

/* ---- Main Content ---- */
#main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--white);
}

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

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

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

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

.hero p {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
  max-width: 680px;
  margin-bottom: 28px;
}

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

.btn-primary {
  background: white;
  color: var(--blue);
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.7);
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* ---- Chapter Card Grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

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

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

.card-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
}

.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;
}

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

/* ---- Chapter Page ---- */
.page-header { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 2.5rem; font-weight: 700; color: var(--blue); margin-bottom: 6px; }
.page-header .subtitle { font-size: 0.875rem; color: var(--text-muted); }

.section { margin-bottom: 48px; }
.section h2 { font-size: 1.5rem; color: var(--blue); font-weight: 700; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #E7F1FF; }
.section h3 { font-size: 1.15rem; color: #0A58CA; font-weight: 600; margin: 24px 0 10px; }

.section p { margin-bottom: 14px; line-height: 1.7; }

/* ---- Figure / Image ---- */
.figure-block {
  background: #F0F4FF;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.figure-block img {
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

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

/* ---- Tables ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--blue);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tr:nth-child(even) td { background: #F8F9FA; }
.data-table tr:hover td { background: #EBF3FF; }

/* ---- Lists ---- */
.bullet-list { list-style: none; padding: 0; margin: 12px 0; }
.bullet-list li { padding: 5px 0 5px 20px; position: relative; line-height: 1.6; }
.bullet-list li::before { content: '•'; color: var(--blue); position: absolute; left: 0; font-weight: bold; }

.numbered-list { list-style: none; padding: 0; margin: 12px 0; counter-reset: item; }
.numbered-list li { padding: 5px 0 5px 28px; position: relative; line-height: 1.6; counter-increment: item; }
.numbered-list li::before { content: counter(item) '.'; color: var(--blue); position: absolute; left: 0; font-weight: bold; }

/* ---- Info / Warning boxes ---- */
.info-box {
  background: #EBF3FF;
  border-left: 4px solid var(--blue);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
}

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

/* ---- System Overview Section ---- */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.overview-card {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.overview-card h4 {
  color: var(--blue);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Footer ---- */
footer {
  background: #0D1B2A;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  margin-top: 60px;
}

footer a { color: rgba(255,255,255,0.8); text-decoration: none; }

/* ---- Scene Grid (Chapter 3 & 11 scenario images) ---- */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 24px 0;
}
.scene-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}
.scene-card:hover {
  box-shadow: 0 6px 20px rgba(13,110,253,0.12);
  transform: translateY(-2px);
}
.scene-card img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
}
.scene-info {
  padding: 16px 20px;
}
.scene-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0D6EFD;
  margin: 0 0 8px 0;
}
.scene-info p {
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.6;
  margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; }
  .content-wrapper { padding: 24px 20px 60px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .scene-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
}
