/* ============================================
   RingShot Manual — Documentation Styles
   Extends the core design system from ../style.css
   ============================================ */

@import url('../style.css');

/* ---------- Hide inherited main-site nav ---------- */
.nav {
  display: none !important;
}

/* ---------- Body override for manual pages ---------- */
body {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* ---------- Layout Shell ---------- */
.manual-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: 0;
}

/* ---------- Sidebar ---------- */
.manual-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform 0.3s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: var(--dark-600) transparent;
}

.manual-sidebar::-webkit-scrollbar {
  width: 4px;
}

.manual-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.manual-sidebar::-webkit-scrollbar-thumb {
  background: var(--dark-600);
  border-radius: 2px;
}

.manual-sidebar__header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.manual-sidebar__title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.manual-sidebar__title svg {
  width: 16px;
  height: 16px;
}

.manual-sidebar__version {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Nav groups */
.manual-nav {
  padding: 12px 0 24px;
}

.manual-nav__group {
  margin-bottom: 4px;
}

.manual-nav__group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: default;
  user-select: none;
}

.manual-nav__group-title svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.manual-nav__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.manual-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 28px;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  position: relative;
}

.manual-nav__link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.manual-nav__link--active {
  color: var(--accent) !important;
  background: rgba(0, 229, 255, 0.04);
  border-left-color: var(--accent);
  font-weight: 500;
}

.manual-nav__link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.manual-nav__link--active svg {
  opacity: 1;
  color: var(--accent);
}

/* ---------- Main Content ---------- */
.manual-content {
  flex: 1;
  margin-left: 280px;
  padding: 40px 48px 80px;
  max-width: 920px;
  min-width: 0;
}

/* Breadcrumb */
.manual-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.manual-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.manual-breadcrumb a:hover {
  color: var(--accent);
}

.manual-breadcrumb__sep {
  opacity: 0.4;
}

/* Page header */
.manual-page-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.manual-page-header__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.manual-page-header__label svg {
  width: 14px;
  height: 14px;
}

.manual-page-header h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.manual-page-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
}

/* ---------- Content Typography ---------- */
.manual-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.manual-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 32px 0 14px;
  color: var(--text-primary);
}

.manual-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text-secondary);
}

.manual-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.manual-content ul,
.manual-content ol {
  margin: 12px 0 20px 24px;
  color: var(--text-secondary);
}

.manual-content li {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 6px;
}

.manual-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.manual-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  padding: 2px 8px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.1);
  border-radius: 4px;
  color: var(--accent);
}

/* ---------- Callout Boxes ---------- */
.callout {
  padding: 20px 24px;
  border-radius: var(--border-radius-sm);
  margin: 24px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid;
}

.callout__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.callout__content {
  flex: 1;
}

.callout__content p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.callout__title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

/* Info */
.callout--info {
  background: rgba(0, 229, 255, 0.04);
  border-color: rgba(0, 229, 255, 0.12);
}

.callout--info .callout__icon,
.callout--info .callout__title {
  color: var(--accent);
}

/* Warning */
.callout--warning {
  background: rgba(251, 146, 60, 0.04);
  border-color: rgba(251, 146, 60, 0.15);
}

.callout--warning .callout__icon,
.callout--warning .callout__title {
  color: #fb923c;
}

/* Danger */
.callout--danger {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.15);
}

.callout--danger .callout__icon,
.callout--danger .callout__title {
  color: #ef4444;
}

/* Tip */
.callout--tip {
  background: rgba(34, 197, 94, 0.04);
  border-color: rgba(34, 197, 94, 0.15);
}

.callout--tip .callout__icon,
.callout--tip .callout__title {
  color: #22c55e;
}

/* ---------- Step Indicators ---------- */
.steps {
  counter-reset: step-counter;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.step {
  counter-increment: step-counter;
  position: relative;
  padding: 24px 24px 24px 72px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm);
  margin-bottom: 12px;
  transition: border-color 0.2s ease;
}

.step:hover {
  border-color: rgba(0, 229, 255, 0.1);
}

.step::before {
  content: counter(step-counter);
  position: absolute;
  left: 20px;
  top: 24px;
  width: 36px;
  height: 36px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.step__title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 1rem;
}

.step__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

/* ---------- Code Blocks ---------- */
.code-block {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-sm);
  padding: 20px 24px;
  margin: 20px 0;
  overflow-x: auto;
  position: relative;
}

.code-block__label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.code-block pre {
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ---------- Tables ---------- */
.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}

.manual-table th {
  text-align: left;
  padding: 14px 18px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.manual-table td {
  padding: 14px 18px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.manual-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.manual-table td:first-child {
  font-weight: 500;
  color: var(--text-primary);
}

/* ---------- Feature Cards (for overview page) ---------- */
.manual-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.manual-card {
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius);
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
  display: block;
}

.manual-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.15);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25), 0 0 24px var(--accent-glow);
}

.manual-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 18px;
  color: var(--accent);
}

.manual-card__icon svg {
  width: 22px;
  height: 22px;
}

.manual-card__title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.manual-card__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Annotated Image ---------- */
.annotated-image {
  position: relative;
  margin: 32px 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.annotated-image img {
  width: 100%;
  display: block;
}

.annotated-image__marker {
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--dark-950);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: help;
  box-shadow: 0 2px 12px rgba(0, 229, 255, 0.4);
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: transform 0.2s ease;
}

.annotated-image__marker:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

/* ---------- Accordion (Troubleshooting) ---------- */
.accordion {
  margin: 24px 0;
}

.accordion__item {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.accordion__item:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: color 0.15s ease;
}

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

.accordion__trigger-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.3s var(--ease-out);
  flex-shrink: 0;
}

.accordion__item.open .accordion__trigger-icon {
  transform: rotate(180deg);
}

.accordion__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out);
}

.accordion__item.open .accordion__body {
  max-height: 2000px;
}

.accordion__body-inner {
  padding: 0 24px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ---------- Prev/Next Navigation ---------- */
.manual-pager {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.manual-pager__link {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 200px;
  max-width: 48%;
}

.manual-pager__link:hover {
  border-color: rgba(0, 229, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.manual-pager__link--next {
  margin-left: auto;
  text-align: right;
}

.manual-pager__dir {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.manual-pager__title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Spec Badge ---------- */
.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- Mobile Sidebar Toggle ---------- */
.manual-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--gradient-brand);
  border: none;
  border-radius: 50%;
  color: var(--dark-950);
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3);
  align-items: center;
  justify-content: center;
}

.manual-sidebar-toggle svg {
  width: 22px;
  height: 22px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .manual-content {
    padding: 32px 32px 64px;
  }
}

@media (max-width: 768px) {
  .manual-sidebar {
    transform: translateX(-100%);
    width: 260px;
    z-index: 500;
  }

  .manual-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
  }

  .manual-sidebar-toggle {
    display: flex;
  }

  .manual-content {
    margin-left: 0;
    padding: 24px 20px 64px;
  }

  .manual-cards {
    grid-template-columns: 1fr;
  }

  .manual-pager {
    flex-direction: column;
  }

  .manual-pager__link {
    max-width: 100%;
  }

  .steps .step {
    padding-left: 24px;
    padding-top: 60px;
  }

  .step::before {
    top: 16px;
    left: 20px;
  }
}

/* ---------- Sidebar Overlay (Mobile) ---------- */
.manual-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 499;
}

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

/* ---------- Keyboard Visual ---------- */
.kv-wrap {
  margin: 2rem 0 3rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.kv-board {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  padding: 4.5rem 2rem 5rem;
  background: #0c0e13;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  min-width: 820px;
}

.kv-row {
  display: flex;
  gap: 3px;
}

/* Arrow key cluster */
.kv-arrows {
  position: absolute;
  bottom: 5rem;
  right: 5rem;
  display: grid;
  grid-template-columns: repeat(3, 2.4rem);
  grid-template-rows: 2.4rem;
  gap: 3px;
}

.kv-arrows .kv-k:nth-child(1) {
  grid-column: 1;
}

/* ← */
.kv-arrows .kv-k:nth-child(2) {
  grid-column: 2;
}

/* ↓ */
.kv-arrows .kv-k:nth-child(3) {
  grid-column: 3;
}

/* → */

/* Base key */
.kv-k {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.3rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.18);
  background: #16181f;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  user-select: none;
  flex-shrink: 0;
  position: relative;
}

/* Size variants */
.kv-k--tab {
  min-width: 3.6rem;
}

.kv-k--caps {
  min-width: 4.2rem;
}

.kv-k--lsh {
  min-width: 5.4rem;
}

.kv-k--rsh {
  min-width: 3.6rem;
}

.kv-k--bksp {
  min-width: 4.8rem;
}

.kv-k--enter {
  min-width: 3.8rem;
}

.kv-k--mod {
  min-width: 3rem;
}

.kv-k--space {
  min-width: 15rem;
}

/* Active / highlighted key */
.kv-k--active {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(180deg, #1a3a3a 0%, #0f2828 100%);
  border-color: rgba(45, 212, 191, 0.3);
  border-bottom-color: rgba(45, 212, 191, 0.15);
  box-shadow:
    0 0 12px rgba(45, 212, 191, 0.15),
    inset 0 1px 0 rgba(45, 212, 191, 0.1);
}

/* Annotation labels */
.kv-label {
  position: absolute;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
}

.kv-label::before {
  content: '';
  position: absolute;
  background: rgba(45, 212, 191, 0.35);
}

/* Label above key (for Q) */
.kv-label--top {
  bottom: calc(100% + 64px);
  left: 50%;
  transform: translateX(-50%);
}

.kv-label--top::before {
  top: 100%;
  left: 50%;
  width: 1px;
  height: 64px;
}

/* Label below key (for Space, shifted left) */
.kv-label--bottom {
  top: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
}

.kv-label--bottom::before {
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 24px;
}

/* ↓ label above the arrow keys */
.kv-label--arrow1 {
  bottom: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
}

.kv-label--arrow1::before {
  top: 100%;
  left: 50%;
  width: 1px;
  height: 24px;
}

.kv-label--arrow2 {
  top: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
}

.kv-label--arrow2::before {
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 24px;
}

.kv-label--arrow3 {
  top: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
}

.kv-label--arrow3::before {
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 24px;
}

/* Label to the right of key (for arrows) */
.kv-label--right {
  left: calc(100% + 24px);
  top: 50%;
  transform: translateY(-50%);
}

.kv-label--right::before {
  right: 100%;
  top: 50%;
  width: 24px;
  height: 1px;
}

/* Sub-label (secondary text) */
.kv-label__sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: rgba(45, 212, 191, 0.6);
  margin-top: 3px;
}



/* ---------- Print ---------- */
@media print {

  .manual-sidebar,
  .manual-sidebar-toggle,
  .manual-pager,
  .nav {
    display: none !important;
  }

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

  .manual-content h2 {
    break-after: avoid;
  }

  .step,
  .callout,
  .manual-card {
    break-inside: avoid;
  }
}