/* =========================================
   style.css - Setup Guide BOCS
   Hướng dẫn cài đặt dự án BOCS
   ========================================= */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}

body {
  font-family: var(--font-main);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

/* === 2. CSS Variables (Design Tokens) === */
:root {
  /* Colors */
  --bg-page:        #f0f2f5;
  --bg-sidebar:     #0f1729;
  --bg-sidebar-hover: rgba(255,255,255,0.06);
  --bg-code:        #1e1e2e;
  --bg-card:        #ffffff;
  --text-primary:   #1a202c;
  --text-secondary: #4a5568;
  --text-sidebar:   #94a3b8;
  --text-white:     #ffffff;
  --accent:         #3b82f6;
  --accent-hover:   #2563eb;
  --accent-glow:    rgba(59,130,246,0.25);
  --teal:           #06b6d4;

  /* Alert colors */
  --note-bg:        #eff6ff;
  --note-border:    #3b82f6;
  --note-text:      #1e40af;
  --warning-bg:     #fffbeb;
  --warning-border: #f59e0b;
  --warning-text:   #92400e;
  --success-bg:     #ecfdf5;
  --success-border: #10b981;
  --success-text:   #065f46;
  --danger-bg:      #fef2f2;
  --danger-border:  #ef4444;
  --danger-text:    #991b1b;

  /* Spacing */
  --sidebar-width:  280px;
  --content-max-w:  880px;
  --radius:         10px;
  --radius-sm:      6px;

  /* Typography */
  --font-main:      'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-code:      'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg:      0 10px 30px rgba(0,0,0,0.1);
}

/* === 3. Typography === */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.4rem; color: var(--text-secondary); }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* === 4. Layout (Sidebar + Main) === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.sidebar-title {
  color: var(--text-white);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-subtitle {
  color: var(--text-sidebar);
  font-size: 0.72rem;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* === 5. Navigation === */
.nav-list {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text-sidebar);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
}

.nav-item a:hover {
  color: var(--text-white);
  background: var(--bg-sidebar-hover);
}

.nav-item a.active {
  color: var(--text-white);
  background: rgba(59,130,246,0.15);
}

.nav-item a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(59,130,246,0.2);
  color: var(--accent);
  font-weight: 600;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-sidebar);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background 0.2s;
}
.hamburger:hover { background: #1a2540; }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}
.overlay.show { display: block; }

/* === 6. Main Content === */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 48px 48px 80px;
  max-width: calc(var(--content-max-w) + var(--sidebar-width) + 96px);
}

.section {
  margin-bottom: 3.5rem;
  animation: fadeInUp 0.5s ease both;
}

.section-header {
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 12px;
  vertical-align: middle;
  box-shadow: 0 3px 10px var(--accent-glow);
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* === 7. Cards === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e8ecf1;
  transition: box-shadow 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* === 8. Step Items === */
.step {
  display: flex;
  gap: 18px;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 2px;
  box-shadow: 0 3px 10px var(--accent-glow);
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  color: var(--text-primary);
  font-weight: 650;
  margin-bottom: 0.5rem;
}

/* === 9. Code Blocks === */
.code-block {
  position: relative;
  background: var(--bg-code);
  border-radius: var(--radius-sm);
  margin: 12px 0 16px;
  overflow: hidden;
  border: 1px solid #2a2a3e;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-lang {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.copy-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.copy-btn.copied {
  background: rgba(16,185,129,0.2);
  color: #10b981;
  border-color: rgba(16,185,129,0.3);
}

.code-block pre {
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 0.87rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.code-block pre::-webkit-scrollbar { height: 6px; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.code-inline {
  background: #eef2f7;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-code);
  font-size: 0.85em;
  color: #c7254e;
  border: 1px solid #dce3eb;
}

/* === 10. Alert Boxes === */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 14px 0;
  border-left: 4px solid;
  font-size: 0.92rem;
  line-height: 1.6;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert.note {
  background: var(--note-bg);
  border-color: var(--note-border);
  color: var(--note-text);
}

.alert.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-text);
}

.alert.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.alert.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

/* === 11. Checklist Table === */
.checklist-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid #e2e8f0;
}

.checklist-table thead th {
  background: #f8fafc;
  padding: 12px 18px;
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-weight: 650;
  border-bottom: 2px solid #e2e8f0;
}

.checklist-table tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  vertical-align: top;
}

.checklist-table tbody tr:last-child td {
  border-bottom: none;
}

.checklist-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.checklist-table tbody tr:hover {
  background: #eff6ff;
}

.check-icon {
  color: var(--success-border);
  font-weight: 700;
  margin-right: 6px;
}

/* === 12. Endpoint Table === */
.endpoint-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid #e2e8f0;
}

.endpoint-table th {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  padding: 12px 18px;
  text-align: left;
  font-size: 0.82rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 650;
}

.endpoint-table td {
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.endpoint-table tr:last-child td {
  border-bottom: none;
}

.endpoint-table .url-cell {
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

/* === 13. Troubleshooting Accordion === */
.accordion-item {
  background: var(--bg-card);
  border: 1px solid #e8ecf1;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.accordion-item:hover {
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: background 0.2s;
}

.accordion-header:hover {
  background: #f8fafc;
}

.accordion-arrow {
  margin-left: auto;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
  color: var(--text-secondary);
}

.accordion-item.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s;
  padding: 0 20px;
}

.accordion-item.open .accordion-body {
  max-height: 500px;
  padding: 0 20px 20px;
}

.error-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #fef2f2;
  color: #dc2626;
  font-family: var(--font-code);
}

/* === 14. Quick Reference Table === */
.ref-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid #e2e8f0;
}

.ref-table th {
  background: #f8fafc;
  padding: 12px 18px;
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-weight: 650;
  border-bottom: 2px solid #e2e8f0;
}

.ref-table td {
  padding: 11px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.ref-table tr:last-child td { border-bottom: none; }

.ref-table tbody tr:hover { background: #f8fafc; }

.ref-table .cmd-cell {
  font-family: var(--font-code);
  font-size: 0.83rem;
  color: #7c3aed;
  font-weight: 500;
}

/* === 15. Links list === */
.link-list {
  list-style: none;
  margin: 12px 0;
}

.link-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.link-list li:last-child { border-bottom: none; }

/* === 16. Responsive (Mobile) === */
@media (max-width: 900px) {
  .main-content {
    padding: 32px 24px 60px;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 72px 18px 60px;
  }

  .section-header h2 {
    font-size: 1.3rem;
  }

  .step {
    flex-direction: column;
    gap: 10px;
  }

  .card {
    padding: 20px;
  }

  .checklist-table, .endpoint-table, .ref-table {
    display: block;
    overflow-x: auto;
  }
}

/* === 17. Animations & Transitions === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section:nth-child(1) { animation-delay: 0s; }
.section:nth-child(2) { animation-delay: 0.06s; }
.section:nth-child(3) { animation-delay: 0.12s; }
.section:nth-child(4) { animation-delay: 0.18s; }
.section:nth-child(5) { animation-delay: 0.24s; }
.section:nth-child(6) { animation-delay: 0.3s; }
.section:nth-child(7) { animation-delay: 0.36s; }

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  z-index: 999;
  transition: width 0.15s;
  border-radius: 0 2px 2px 0;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: all 0.25s;
  z-index: 50;
}

.back-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.back-to-top.show {
  display: flex;
}

/* Footer */
.footer {
  margin-left: var(--sidebar-width);
  text-align: center;
  padding: 30px 20px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
  .footer { margin-left: 0; }
}

/* === 18. Tabbed Navigation for Hardware Setup === */
.tabs-container {
  margin-top: 1.5rem;
}

.tab-headers {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--accent);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn .badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.tab-btn.active .badge {
  background: var(--accent);
  color: #fff;
}

.tab-btn .badge.legacy {
  background: #f1f5f9;
  color: #64748b;
}

.tab-btn .badge.prod {
  background: #ecfdf5;
  color: #10b981;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Architecture Comparison list / layout */
.architecture-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .architecture-comparison {
    grid-template-columns: 1fr;
  }
}

.arch-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.arch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.arch-card.legacy {
  border-left: 4px solid #94a3b8;
}

.arch-card.advanced {
  border-left: 4px solid var(--accent);
  background: linear-gradient(180deg, #f8fafc 0%, rgba(59, 130, 246, 0.02) 100%);
}

.arch-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

