/* ============================================================
   ScoreCam Documentation Site — style.css
   ============================================================ */

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

:root {
  --primary:      #1e3a5f;
  --primary-mid:  #2d5a8e;
  --accent:       #3a7bc8;
  --accent-hover: #2562a8;
  --sidebar-bg:   #eef2f7;
  --content-bg:   #ffffff;
  --page-bg:      #f5f7fa;
  --border:       #d0dae6;
  --text:         #2c3e50;
  --text-light:   #586878;
  --text-muted:   #8a9baa;
  --pro-color:    #b56b00;
  --pro-bg:       #fff4e0;
  --pro-border:   #e8a030;
  --sub-color:    #6b35b5;
  --sub-bg:       #f3eeff;
  --sub-border:   #9b6de0;
  --header-height: 62px;
  --sidebar-width: 242px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--page-bg);
}

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

/* ─── Site Header ─── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--primary);
  z-index: 100;
  display: flex; align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  gap: 16px;
}

.site-logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-size: 30px; font-weight: 800;
  letter-spacing: -.5px; text-decoration: none; flex-shrink: 0;
}
.site-logo .logo-icon {
  width: 38px; height: 38px;
  border-radius: 9px; object-fit: cover; flex-shrink: 0;
}

.site-header nav { margin-left: auto; display: flex; gap: 2px; }
.site-header nav a {
  color: rgba(255,255,255,.75);
  padding: 6px 11px; border-radius: 6px;
  font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s;
}
.site-header nav a:hover, .site-header nav a.active {
  background: rgba(255,255,255,.14); color: #fff; text-decoration: none;
}

/* ─── Layout ─── */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width); flex-shrink: 0;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  position: sticky; top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 18px 0 32px;
}

.sb-group { margin-bottom: 6px; }
.sb-group-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: .9px; text-transform: uppercase;
  color: var(--text-muted); padding: 10px 18px 4px;
}
.sidebar ul { list-style: none; }
.sidebar ul li a {
  display: block; padding: 5px 18px 5px 22px;
  font-size: 13px; color: var(--text-light);
  border-left: 3px solid transparent;
  transition: background .1s, color .1s, border-color .1s;
}
.sidebar ul li a:hover { background: rgba(58,123,200,.08); color: var(--accent); text-decoration: none; }
.sidebar ul li a.active {
  color: var(--accent); border-left-color: var(--accent);
  background: rgba(58,123,200,.1); font-weight: 600;
}

/* ─── Main content ─── */
.main-content {
  flex: 1; min-width: 0;
  padding: 0 48px 72px;
  background: var(--content-bg);
}

/* ─── Page hero ─── */
.page-hero {
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: #fff; padding: 46px 48px 42px;
  margin: 0 -48px 44px;
}
.page-hero h1  { font-size: 26px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.page-hero p   { font-size: 15.5px; opacity: .85; max-width: 620px; line-height: 1.6; }
.page-hero .hero-meta {
  margin-top: 22px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
}
.page-hero .hero-meta .appstore-badge img { height: 42px; display: block; }
.page-hero .hero-meta .hero-text-link {
  color: rgba(255,255,255,.85); font-size: 14.5px; font-weight: 500;
  text-decoration: none; transition: color .15s;
}
.page-hero .hero-meta .hero-text-link:hover { color: #fff; text-decoration: none; }

/* ─── Doc sections ─── */
.doc-section {
  margin-bottom: 52px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.doc-section h2 {
  font-size: 19px; font-weight: 700; color: var(--primary);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.doc-section h3 { font-size: 15.5px; font-weight: 600; color: var(--text); margin: 22px 0 10px; }
.doc-section p  { margin-bottom: 12px; }
.doc-section ul, .doc-section ol { margin: 8px 0 14px 22px; }
.doc-section li { margin-bottom: 6px; color: var(--text); }

/* ─── Setting entry ─── */
.setting-entry {
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 10px; overflow: hidden;
}
.setting-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.setting-name  { font-weight: 600; font-size: 14px; color: var(--text); flex: 1; }
.setting-body  { padding: 10px 14px; font-size: 13.5px; color: var(--text-light); }
.setting-default {
  font-size: 12px; color: var(--text-muted); margin-top: 7px;
}
.setting-default strong { color: var(--text-light); }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase; flex-shrink: 0;
}
.badge.pro { background: var(--pro-bg); color: var(--pro-color); border: 1px solid var(--pro-border); }
.badge.sub { background: var(--sub-bg); color: var(--sub-color); border: 1px solid var(--sub-border); }

/* ─── Options list ─── */
.options-list { margin: 8px 0; }
.opt { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f2f4f7; font-size: 13.5px; }
.opt:last-child { border-bottom: none; }
.opt-val  { font-weight: 600; color: var(--primary); min-width: 140px; flex-shrink: 0; }
.opt-desc { color: var(--text-light); }

/* ─── Requirements table ─── */
.req-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 14px 0 20px; }
.req-table th { background: var(--bg-alt); text-align: left; padding: 8px 12px; font-weight: 600; border-bottom: 2px solid var(--border); }
.req-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.req-table tr:last-child td { border-bottom: none; }
.req-table td:first-child { font-weight: 500; color: var(--primary); white-space: nowrap; }

/* ─── Feature cards ─── */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px; margin: 20px 0;
}
.feature-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; background: #fff;
  transition: box-shadow .15s, transform .15s;
}
.feature-card:hover { box-shadow: 0 4px 18px rgba(30,58,95,.1); transform: translateY(-1px); }
.feature-card .fc-icon {
  font-size: 22px; margin-bottom: 12px;
  width: 42px; height: 42px; background: var(--sidebar-bg);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
}
.feature-card h3 { font-size: 14.5px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.feature-card p  { font-size: 13px; color: var(--text-light); line-height: 1.55; margin: 0; }

/* ─── Sport chips ─── */
.sport-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.sport-chip {
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 14px;
  font-size: 13px; font-weight: 500; color: var(--text-light);
}

/* ─── Steps ─── */
.steps { margin: 16px 0; }
.step  { display: flex; gap: 16px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid #eef2f7; }
.step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 3px;
}
.step-content h3 { font-size: 14.5px; font-weight: 600; margin: 0 0 5px; }
.step-content p  { font-size: 13.5px; color: var(--text-light); margin: 0; }

/* ─── Callouts ─── */
.callout {
  padding: 13px 16px; border-radius: 7px;
  margin: 14px 0; font-size: 13.5px; line-height: 1.55;
}
.callout.info { background: #e8f3fd; border-left: 4px solid var(--accent); color: #1a4a72; }
.callout.tip  { background: #e6f8ee; border-left: 4px solid #28a745; color: #185c33; }
.callout.note { background: #fff8e6; border-left: 4px solid var(--pro-border); color: #7a4400; }

/* ─── Board / Scoreboard cards ─── */
.board-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 12px; margin: 16px 0;
}
.board-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; background: #fafbfc; }
.board-card .board-name  { font-weight: 700; font-size: 14px; color: var(--primary); margin-bottom: 2px; }
.board-card .board-sport { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.board-card .board-desc  { font-size: 13px; color: var(--text-light); }

/* ─── Platform cards ─── */
.platform-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin: 16px 0;
}
.platform-card {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 16px; text-align: center; background: #fafbfc;
}
.platform-card .plat-name { font-weight: 700; font-size: 14.5px; color: var(--primary); margin-bottom: 4px; }
.platform-card .plat-type { font-size: 12px; color: var(--text-muted); }

/* ─── User cards ─── */
.user-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; margin: 18px 0;
}
.user-card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; background: #fafbfc; }
.user-card .user-type { font-weight: 700; font-size: 14px; color: var(--primary); margin-bottom: 6px; }
.user-card p { font-size: 13px; color: var(--text-light); margin: 0; }

/* ─── Pipeline diagram ─── */
.pipeline {
  display: flex; align-items: center; flex-wrap: wrap;
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 24px; gap: 4px; margin: 16px 0;
}
.pip-step {
  background: var(--primary); color: #fff;
  padding: 7px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600;
}
.pip-arrow { color: var(--text-muted); font-size: 20px; margin: 0 4px; }

/* ─── Hamburger ─── */
.hamburger {
  display: none;
  flex-direction: column; justify-content: space-between;
  width: 28px; height: 20px;
  background: none; border: none; cursor: pointer;
  padding: 0; margin-left: auto; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 100%; height: 2px;
  background: rgba(255,255,255,.85); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ─── Mobile nav overlay ─── */
.mobile-nav {
  display: none;
  position: fixed; top: var(--header-height); left: 0; right: 0;
  background: var(--primary); z-index: 99;
  flex-direction: column; padding: 8px 0;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  color: rgba(255,255,255,.82); padding: 13px 24px;
  font-size: 15px; font-weight: 500; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

/* ─── Screenshot gallery ─── */
.screenshot-gallery {
  display: flex; gap: 14px; overflow-x: auto;
  padding: 16px 0 20px; margin: 16px 0 32px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.screenshot-gallery img {
  height: clamp(200px, 45vw, 320px); width: auto;
  border-radius: 18px; flex-shrink: 0;
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
  scroll-snap-align: start;
}

/* ─── Footer ─── */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.65);
  text-align: center; padding: 22px 20px; font-size: 13px;
}
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: #fff; }

/* ─── Divider ─── */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ─── Expandable sidebar submenu ─── */
.sb-expandable { }
.sb-item-row {
  display: flex; align-items: stretch;
}
.sb-item-row > a { flex: 1; }
.sb-toggle {
  background: none; border: none; cursor: pointer;
  padding: 0 14px 0 4px; color: var(--text-muted);
  font-size: 13px; line-height: 1; flex-shrink: 0;
  transition: color .15s; display: flex; align-items: center;
}
.sb-toggle:hover { color: var(--accent); }
.sb-arrow {
  display: inline-block; transition: transform .2s; font-style: normal;
}
.sb-expandable.open .sb-arrow { transform: rotate(90deg); }
.sb-sub-group { display: none; list-style: none; }
.sb-sub-group.open { display: block; }
.sb-sub-group li a {
  padding-left: 34px !important; font-size: 12.5px !important;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { padding: 0 22px 60px; }
  .page-hero { padding: 32px 22px 28px; margin: 0 -22px 32px; }
  .site-header nav { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 600px) {
  .feature-grid, .board-grid, .platform-grid, .user-grid { grid-template-columns: 1fr; }
  .opt { flex-direction: column; gap: 2px; }
  .opt-val { min-width: 0; }
}
