/* ============================================================
   ECU Scanner Honda Scoopy 2023 - Documentation Site
   Complete CSS Stylesheet
   ============================================================ */

/* ---- CSS Custom Properties (Light Theme / Default) ---- */
:root, body.light {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1B2A4A;
  --bg-code: #F4F6F7;
  --text-primary: #1A1A2E;
  --text-secondary: #666666;
  --text-sidebar: #CBD5E1;
  --accent: #E74C3C;
  --accent-blue: #2C5F8A;
  --accent-green: #27AE60;
  --accent-orange: #E67E22;
  --accent-purple: #8E44AD;
  --border: #E0E0E0;
  --shadow: rgba(0,0,0,0.1);
}

/* ---- Dark Theme ---- */
body.dark {
  --bg-primary: #0D1117;
  --bg-secondary: #161B22;
  --bg-card: #1C2333;
  --bg-sidebar: #0D1117;
  --bg-code: #1E1E2E;
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --text-sidebar: #8B949E;
  --accent: #E74C3C;
  --accent-blue: #58A6FF;
  --accent-green: #3FB950;
  --accent-orange: #F0883E;
  --accent-purple: #BC8CFF;
  --border: #30363D;
  --shadow: rgba(0,0,0,0.3);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Progress Bar (top) ---- */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
  z-index: 10000;
  transition: width 0.1s linear;
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-secondary);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #0a0e27 0%, #1a0a3e 50%, #0a0e27 100%);
  overflow: hidden;
  padding: 2rem;
}

/* Animated gradient overlay */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(88, 166, 255, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(188, 140, 255, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(231, 76, 60, 0.05) 0%, transparent 50%);
  animation: heroGradientShift 15s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes heroGradientShift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-10%, -10%); }
}

/* Floating Particles (CSS only) */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(88, 166, 255, 0.5);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}

.particle:nth-child(1) { left: 10%; width: 3px; height: 3px; animation-duration: 18s; animation-delay: 0s; background: rgba(88,166,255,0.4); }
.particle:nth-child(2) { left: 20%; width: 5px; height: 5px; animation-duration: 22s; animation-delay: 2s; background: rgba(188,140,255,0.4); }
.particle:nth-child(3) { left: 30%; width: 2px; height: 2px; animation-duration: 16s; animation-delay: 4s; background: rgba(63,185,80,0.4); }
.particle:nth-child(4) { left: 40%; width: 6px; height: 6px; animation-duration: 25s; animation-delay: 1s; background: rgba(88,166,255,0.3); }
.particle:nth-child(5) { left: 50%; width: 3px; height: 3px; animation-duration: 20s; animation-delay: 3s; background: rgba(231,76,60,0.3); }
.particle:nth-child(6) { left: 60%; width: 4px; height: 4px; animation-duration: 19s; animation-delay: 5s; background: rgba(188,140,255,0.5); }
.particle:nth-child(7) { left: 70%; width: 2px; height: 2px; animation-duration: 23s; animation-delay: 0.5s; background: rgba(63,185,80,0.3); }
.particle:nth-child(8) { left: 80%; width: 5px; height: 5px; animation-duration: 17s; animation-delay: 2.5s; background: rgba(88,166,255,0.4); }
.particle:nth-child(9) { left: 90%; width: 3px; height: 3px; animation-duration: 21s; animation-delay: 4.5s; background: rgba(240,136,62,0.4); }
.particle:nth-child(10) { left: 15%; width: 4px; height: 4px; animation-duration: 24s; animation-delay: 1.5s; background: rgba(188,140,255,0.3); }
.particle:nth-child(11) { left: 35%; width: 3px; height: 3px; animation-duration: 19s; animation-delay: 3.5s; background: rgba(88,166,255,0.5); }
.particle:nth-child(12) { left: 55%; width: 5px; height: 5px; animation-duration: 26s; animation-delay: 0.8s; background: rgba(63,185,80,0.4); }
.particle:nth-child(13) { left: 75%; width: 2px; height: 2px; animation-duration: 15s; animation-delay: 2.2s; background: rgba(231,76,60,0.3); }
.particle:nth-child(14) { left: 85%; width: 4px; height: 4px; animation-duration: 20s; animation-delay: 4.8s; background: rgba(188,140,255,0.4); }
.particle:nth-child(15) { left: 45%; width: 3px; height: 3px; animation-duration: 22s; animation-delay: 1.2s; background: rgba(88,166,255,0.3); }

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 50px;
  color: #58A6FF;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  background: rgba(88, 166, 255, 0.05);
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #FFFFFF 0%, #58A6FF 50%, #BC8CFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 650px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2.2rem;
  background: linear-gradient(135deg, var(--accent) 0%, #c0392b 100%);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 1.05rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  margin-bottom: 3rem;
}

.hero-cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 30px rgba(231, 76, 60, 0.35);
  color: #FFFFFF;
  text-decoration: none;
}

/* Hero Cards */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  max-width: 900px;
  width: 100%;
  position: relative;
  z-index: 1;
  margin-bottom: 3rem;
}

.hero-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.hero-card:hover {
  transform: translateY(-5px);
  border-color: rgba(88, 166, 255, 0.4);
}

.hero-card .card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.hero-card h3 {
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.hero-card p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

/* System overview diagram placeholder */
.hero .system-overview-placeholder {
  position: relative;
  z-index: 1;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   STICKY HEADER
   ============================================================ */
.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  transform: translateY(-100%);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

body.light .sticky-header {
  background: rgba(255, 255, 255, 0.9);
}

.sticky-header.visible {
  transform: translateY(0);
}

.header-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo .logo-accent {
  color: var(--accent);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.header-nav a,
.header-nav button {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.header-nav a:hover,
.header-nav button:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  text-decoration: none;
}

.header-nav a.active {
  color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.search-btn kbd {
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  font-size: 0.75rem;
  font-family: inherit;
}

.lang-toggle {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.lang-toggle:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 900;
  padding: 1rem 0;
  transform: translateY(-100vh);
  transition: transform 0.3s ease;
}

.sidebar.visible {
  transform: translateY(0);
}

.sidebar-section {
  margin-bottom: 0.5rem;
}

.sidebar-section-title {
  padding: 0.5rem 1.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sidebar);
  opacity: 0.5;
}

.sidebar-link {
  display: block;
  padding: 0.45rem 1.2rem;
  font-size: 0.88rem;
  color: var(--text-sidebar);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.sidebar-link.active {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.08);
}

.sidebar-link.sub {
  padding-left: 2.2rem;
  font-size: 0.82rem;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.8rem 1.2rem;
}

.sidebar-tools-title {
  padding: 0.5rem 1.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-orange);
  opacity: 0.8;
}

.sidebar-link .tool-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  border-radius: 4px;
  background: rgba(240, 136, 62, 0.15);
  color: var(--accent-orange);
  margin-left: 0.5rem;
  font-weight: 600;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: 260px;
  padding: 2rem 2.5rem 4rem;
  max-width: calc(260px + 900px + 5rem);
  min-height: 100vh;
}

.main-content > section {
  margin-bottom: 4rem;
}

/* Section headers */
.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

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

h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}

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

/* Content typography */
.content-text {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

ul, ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.4rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}

thead {
  background: var(--bg-secondary);
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody td {
  padding: 0.65rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

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

tbody tr:nth-child(even) {
  background: var(--bg-secondary);
}

tbody tr:hover {
  background: rgba(88, 166, 255, 0.05);
}

td code, th code {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-code);
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  position: relative;
}

pre .code-lang {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.6;
  text-transform: uppercase;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Syntax highlighting classes */
.kw { color: #58A6FF; font-weight: 600; } /* keyword - blue */
.fn { color: #E2C541; }                    /* function - yellow */
.str { color: #3FB950; }                   /* string - green */
.cm { color: #6A737D; font-style: italic; } /* comment - gray */
.num { color: #F0883E; }                   /* number - orange */
.type { color: #BC8CFF; }                  /* type - purple */
.op { color: #E6EDF3; }                    /* operator */
.pp { color: #E74C3C; }                    /* preprocessor */

body.light .kw { color: #2C5F8A; }
body.light .fn { color: #B8860B; }
body.light .str { color: #27AE60; }
body.light .cm { color: #999999; }
body.light .num { color: #E67E22; }
body.light .type { color: #8E44AD; }
body.light .op { color: #1A1A2E; }
body.light .pp { color: #E74C3C; }

inline code, p code, li code {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-code);
  font-size: 0.85em;
  border: 1px solid var(--border);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--accent-blue);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--shadow);
}

.card.accent-green { border-left-color: var(--accent-green); }
.card.accent-orange { border-left-color: var(--accent-orange); }
.card.accent-purple { border-left-color: var(--accent-purple); }
.card.accent-red { border-left-color: var(--accent); }

.card h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.card p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* Info box / callout */
.info-box {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.info-box.warning {
  background: rgba(240, 136, 62, 0.08);
  border-color: rgba(240, 136, 62, 0.2);
}

.info-box.success {
  background: rgba(63, 185, 80, 0.08);
  border-color: rgba(63, 185, 80, 0.2);
}

.info-box .info-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.info-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ============================================================
   ACCORDION
   ============================================================ */
.accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background: var(--bg-card);
}

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

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

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-item.open .accordion-body {
  max-height: 2000px;
}

.accordion-content {
  padding: 1rem 1.2rem;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  margin: 1.5rem 0;
}

.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.75rem 1.2rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

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

.tab-panel {
  display: none;
  padding: 1.5rem 0;
}

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

/* ============================================================
   SCHEMATIC / DIAGRAM CONTAINERS
   ============================================================ */
.schematic-container {
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 200px;
  margin: 1.5rem 0;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  position: relative;
}

.schematic-container:hover {
  box-shadow: 0 4px 20px var(--shadow);
}

.schematic-placeholder {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.schematic-placeholder .placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
  display: block;
}

.schematic-placeholder p {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ============================================================
   SIMULATOR CONTAINER
   ============================================================ */
.simulator-wrapper {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-code);
  overflow: hidden;
  margin: 1.5rem 0;
}

.simulator-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.simulator-toolbar .toolbar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.simulator-toolbar .toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

.simulator-toolbar .toolbar-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.simulator-toolbar .toolbar-btn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.simulator-toolbar .toolbar-btn.run {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(63, 185, 80, 0.1);
}

#simulator-container {
  min-height: 300px;
  padding: 1rem;
}

/* ============================================================
   3D BOARD CONTAINER
   ============================================================ */
.board3d-wrapper {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5rem 0;
  background: var(--bg-secondary);
  perspective: 1000px;
}

.board3d-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.board3d-toolbar .toolbar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

#board3d-container {
  min-height: 350px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   CHECKSUM CALCULATOR
   ============================================================ */
.checksum-calculator {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.checksum-calculator h4 {
  margin-top: 0;
}

.calc-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.calc-form .form-group {
  flex: 1;
  min-width: 200px;
}

.calc-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.calc-form input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.calc-form input:focus {
  border-color: var(--accent-blue);
}

.calc-form input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.btn-calc {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn-calc:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.calc-result {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  color: var(--accent-green);
  border: 1px solid var(--border);
}

/* ============================================================
   TIMELINE (Horizontal)
   ============================================================ */
.timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  overflow-x: auto;
  padding: 2rem 0 1rem;
  margin: 1.5rem 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 0;
}

.timeline-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  flex: 1;
  text-align: center;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent-blue);
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.timeline-item:nth-child(2) .timeline-dot { background: var(--accent-purple); box-shadow: 0 0 0 2px var(--accent-purple); }
.timeline-item:nth-child(3) .timeline-dot { background: var(--accent-green); box-shadow: 0 0 0 2px var(--accent-green); }
.timeline-item:nth-child(4) .timeline-dot { background: var(--accent-orange); box-shadow: 0 0 0 2px var(--accent-orange); }
.timeline-item:nth-child(5) .timeline-dot { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.timeline-item:nth-child(6) .timeline-dot { background: var(--accent-blue); box-shadow: 0 0 0 2px var(--accent-blue); }
.timeline-item:nth-child(7) .timeline-dot { background: var(--accent-purple); box-shadow: 0 0 0 2px var(--accent-purple); }
.timeline-item:nth-child(8) .timeline-dot { background: var(--accent-green); box-shadow: 0 0 0 2px var(--accent-green); }

.timeline-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 90px;
  line-height: 1.3;
}

.timeline-phase {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-top: 0.2rem;
}

/* ============================================================
   SEARCH MODAL
   ============================================================ */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-overlay.active {
  display: flex;
}

.search-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}

.search-modal-header .search-icon {
  color: var(--text-secondary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-modal-header input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.search-modal-header input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.search-modal-header .search-close {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
}

.search-results {
  max-height: 350px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.search-result-item:hover,
.search-result-item.focused {
  background: var(--bg-secondary);
}

.search-result-item .result-icon {
  color: var(--text-secondary);
  font-size: 1rem;
}

.search-result-item .result-text {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.search-result-item .result-section {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.search-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.search-modal-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.search-modal-footer kbd {
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-family: inherit;
  font-size: 0.7rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-left: 260px;
  padding: 2rem 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-right {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.footer-right a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-right a:hover {
  color: var(--accent-blue);
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.75rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 30px var(--shadow);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid var(--accent-green);
}

.toast.error {
  border-left: 4px solid var(--accent);
}

/* ============================================================
   FADE-IN ANIMATION
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #FFFFFF;
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.3);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Checkbox styling */
.checklist {
  list-style: none;
  margin-left: 0;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-green);
  cursor: pointer;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet: 1024px */
@media (max-width: 1024px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-cards {
    grid-template-columns: repeat(2, 1fr);
    max-width: 500px;
  }

  .sidebar {
    width: 220px;
  }

  .main-content {
    margin-left: 220px;
    padding: 1.5rem 1.5rem 3rem;
  }

  .site-footer {
    margin-left: 220px;
    padding: 1.5rem;
  }
}

/* Mobile: 768px */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero .subtitle {
    font-size: 0.95rem;
  }

  .hero-cards {
    grid-template-columns: 1fr 1fr;
    max-width: 400px;
    gap: 0.75rem;
  }

  .hero-card {
    padding: 1rem 0.75rem;
  }

  /* Sidebar: slide in from left as overlay */
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 950;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }

  .sidebar.visible {
    transform: translateX(0) translateY(0);
  }

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

  .main-content {
    margin-left: 0;
    padding: 1.5rem 1rem 3rem;
  }

  .site-footer {
    margin-left: 0;
    padding: 1.5rem 1rem;
    flex-direction: column;
    text-align: center;
  }

  /* Show hamburger */
  .hamburger {
    display: flex;
  }

  .header-nav {
    display: none;
  }

  .search-btn span {
    display: none;
  }

  .search-btn kbd {
    display: none;
  }

  /* Tables: scroll */
  table {
    font-size: 0.8rem;
  }

  /* Timeline scroll */
  .timeline {
    padding-bottom: 1.5rem;
  }

  .timeline-item {
    min-width: 80px;
  }

  /* Checksum calc */
  .calc-form {
    flex-direction: column;
  }

  .calc-form .form-group {
    min-width: auto;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .hero,
  .sticky-header,
  .sidebar,
  .search-overlay,
  #progress-bar,
  .toast,
  .hamburger,
  .header-actions,
  .simulator-toolbar,
  .board3d-toolbar {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 0;
  }

  .site-footer {
    margin-left: 0;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  table, pre, .card, .accordion, .schematic-container {
    break-inside: avoid;
  }

  pre {
    background: #f5f5f5;
    border: 1px solid #ccc;
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

/* Mobile overlay backdrop */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 940;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================================
   COMPANY BRANDING — PT WIDIGITAL TRI BUANA
   ============================================================ */

/* Hero company branding */
.hero-company {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.hero-logo {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-cta-outline {
  background: transparent !important;
  border: 2px solid rgba(255,255,255,0.5) !important;
  color: white !important;
}
.hero-cta-outline:hover {
  border-color: var(--accent-green) !important;
  color: var(--accent-green) !important;
  background: rgba(39,174,96,0.1) !important;
}
.text-accent { color: var(--accent); }

/* Header logo image */
.header-logo-img {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 4px;
}

/* Company Section */
.company-section {
  background: var(--bg-secondary);
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}
.company-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}
.company-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.company-logo {
  width: 70px;
  height: auto;
  border-radius: 8px;
}
.company-header h2 {
  color: var(--text-primary);
  font-size: 1.8rem;
  margin: 0;
}
.company-tagline {
  color: var(--accent);
  font-size: 1rem;
  font-style: italic;
  margin: 4px 0 0 0;
}
.company-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* Stats Cards */
.company-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}
.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-blue);
  display: inline;
}
.stat-plus {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Service Tags */
.company-services {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.service-tag {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
}
.service-iot { background: linear-gradient(135deg, #27AE60, #1E8449); }
.service-web { background: linear-gradient(135deg, #2C5F8A, #1A3A5C); }
.service-mobile { background: linear-gradient(135deg, #8E44AD, #6C3483); }
.service-ai { background: linear-gradient(135deg, #E67E22, #CA6F1E); }

/* Clients */
.company-clients {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.client-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.client-dot {
  color: var(--text-secondary);
}

/* Contact Items */
.company-contact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.contact-item a {
  color: var(--accent-blue);
  text-decoration: none;
}
.contact-item a:hover {
  text-decoration: underline;
}
.contact-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Sidebar Company Badge */
.sidebar-company {
  padding: 16px;
}
.sidebar-divider {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}
.sidebar-badge {
  text-align: center;
}
.sidebar-badge-logo {
  width: 40px;
  height: auto;
  margin-bottom: 6px;
  border-radius: 6px;
  opacity: 0.8;
}
.sidebar-badge-text {
  display: block;
  color: var(--text-sidebar);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.sidebar-badge-link {
  color: var(--accent-blue) !important;
  font-size: 0.7rem;
  text-decoration: none;
}
.sidebar-badge-link:hover {
  text-decoration: underline !important;
}

/* Footer Revamp */
.site-footer {
  background: var(--bg-secondary) !important;
  border-top: 1px solid var(--border) !important;
  padding: 40px 24px 20px !important;
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.footer-logo {
  width: 48px;
  height: auto;
  border-radius: 8px;
}
.footer-brand-text {
  text-align: left;
}
.footer-brand-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.1rem;
}
.footer-brand-text span {
  color: var(--accent);
  font-size: 0.85rem;
  font-style: italic;
}
.footer-info {
  margin-bottom: 16px;
}
.footer-info p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 2px 0;
}
.footer-info a {
  color: var(--accent-blue);
  text-decoration: none;
}
.footer-info a:hover { text-decoration: underline; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}
.footer-links a:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}
.footer-copyright {
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Company section responsive */
@media (max-width: 768px) {
  .company-stats { grid-template-columns: repeat(2, 1fr); }
  .company-contact { grid-template-columns: 1fr; }
  .company-header { flex-direction: column; text-align: center; }
  .footer-brand { flex-direction: column; }
  .footer-brand-text { text-align: center; }
}
