/* ============================================================
   DS CAM V5.4 Handbuch – Designsystem
   manual.css · v1.0 · März 2026
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Brand */
  --ds-blue:        #0057A8;
  --ds-blue-dark:   #003f7e;
  --ds-blue-light:  #E8F1FB;
  --ds-blue-mid:    #C5D9F0;

  /* Text */
  --text-primary:   #1A1A2E;
  --text-secondary: #555770;
  --text-muted:     #8E90A6;

  /* Surfaces */
  --bg-body:        #FFFFFF;
  --bg-aside:       #F4F6FA;
  --bg-code:        #F0F2F8;
  --border:         #DDE3EE;
  --border-light:   #ECEEF4;

  /* Semantic */
  --color-success:    #1E7D46;
  --color-success-bg: #EAF7EF;
  --color-warning:    #B45309;
  --color-warning-bg: #FEF3C7;
  --color-danger:     #DC2626;
  --color-danger-bg:  #FEF2F2;
  --color-info:       #0057A8;
  --color-info-bg:    #E8F1FB;

  /* Annotation (for screenshots) */
  --ann-red:        #e63946;
  --ann-red-bg:     rgba(230, 57, 70, 0.12);

  /* Typography */
  --font-sans:  'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:  'Cascadia Code', 'Consolas', 'Courier New', monospace;
  --font-size-base: 15px;
  --line-height:    1.7;

  /* Layout */
  --sidebar-width:  280px;
  --content-max:    860px;
  --header-height:  60px;

  /* Spacing scale */
  --sp-xs:  0.25rem;
  --sp-sm:  0.5rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2rem;
  --sp-2xl: 3rem;

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration: 0.25s;
}


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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  line-height: var(--line-height);
  color: var(--text-primary);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ds-blue); text-decoration: none; }
a:hover { text-decoration: underline; }


/* ── Page Layout (Sidebar + Content) ───────────────────────── */
.manual-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .manual-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .sidebar.open { display: block; position: fixed; z-index: 100; inset: 0; }
}


/* ── Header ────────────────────────────────────────────────── */
.manual-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--sp-lg);
  background: var(--ds-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.manual-header .logo {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.manual-header .logo img {
  height: 32px;
  width: auto;
}

.manual-header .logo span {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.manual-header .header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}


/* ── Language Switcher ─────────────────────────────────────── */
.lang-switch {
  display: inline-flex;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
}

.lang-switch button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.lang-switch button:hover {
  color: white;
}

.lang-switch button.active {
  background: rgba(255,255,255,0.25);
  color: white;
}


/* ── Language Visibility ───────────────────────────────────── */
[data-lang="de"] .lang-en { display: none !important; }
[data-lang="en"] .lang-de { display: none !important; }


/* ── Sidebar / Navigation ──────────────────────────────────── */
.sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: var(--bg-aside);
  border-right: 1px solid var(--border);
  padding: var(--sp-lg) 0;
  font-size: 0.88rem;
}

.sidebar-nav {}

.sidebar-nav .nav-group {
  margin-bottom: var(--sp-sm);
}

.sidebar-nav .nav-group-title {
  display: block;
  padding: var(--sp-xs) var(--sp-lg);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 0.4rem var(--sp-lg);
  color: var(--text-secondary);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--duration) var(--ease-out);
}

.sidebar-nav a:hover {
  color: var(--ds-blue);
  background: var(--ds-blue-light);
  text-decoration: none;
}

.sidebar-nav a.active {
  color: var(--ds-blue);
  font-weight: 600;
  border-left-color: var(--ds-blue);
  background: var(--ds-blue-light);
}

.sidebar-nav .chapter-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 5px;
  background: var(--ds-blue-mid);
  color: var(--ds-blue-dark);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-nav .nav-item {
  border-bottom: 1px solid var(--border-light);
}

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

.sidebar-nav .nav-item-header {
  display: flex;
  align-items: stretch;
}

.sidebar-nav .nav-link {
  flex: 1;
  min-width: 0;
}

.sidebar-nav .nav-toggle {
  width: 2.5rem;
  border: none;
  border-left: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.sidebar-nav .nav-toggle:hover {
  color: var(--ds-blue);
  background: var(--ds-blue-light);
  border-left-color: var(--border-light);
}

.sidebar-nav .nav-toggle-icon {
  display: inline-block;
  transition: transform var(--duration) var(--ease-out);
}

.sidebar-nav .nav-item.expanded .nav-toggle-icon {
  transform: rotate(180deg);
}

.sidebar-nav .nav-subitems {
  display: none;
  padding: 0.2rem 0 0.5rem;
  background: rgba(255,255,255,0.5);
}

.sidebar-nav .nav-item.expanded .nav-subitems {
  display: block;
}

.sidebar-nav .nav-subitem {
  display: block;
  padding: 0.28rem var(--sp-lg) 0.28rem 3.55rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.35;
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-subitem:hover {
  color: var(--ds-blue);
  background: var(--ds-blue-light);
  text-decoration: none;
}

.sidebar-nav .nav-item.current > .nav-item-header .nav-link,
.sidebar-nav .nav-link.active {
  color: var(--ds-blue);
  font-weight: 600;
  border-left-color: var(--ds-blue);
  background: var(--ds-blue-light);
}

.sidebar-nav .nav-item.current > .nav-item-header .nav-link .chapter-num,
.sidebar-nav .nav-link.active .chapter-num {
  background: var(--ds-blue);
  color: white;
}

.sidebar-nav .nav-subitem.active {
  color: var(--ds-blue);
  font-weight: 600;
  border-left-color: var(--ds-blue);
  background: var(--ds-blue-light);
}


/* ── Main Content Area ─────────────────────────────────────── */
.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-2xl) var(--sp-xl);
}


/* ── Typography ────────────────────────────────────────────── */
.content h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--sp-sm);
  line-height: 1.25;
}

.content .chapter-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2xl);
}

.content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ds-blue);
  margin-top: var(--sp-2xl);
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-sm);
  border-bottom: 2px solid var(--ds-blue-mid);
}

.content h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--sp-xl);
  margin-bottom: var(--sp-sm);
}

.content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: var(--sp-lg);
  margin-bottom: var(--sp-xs);
}

.content p {
  margin-bottom: var(--sp-md);
}

.content ul, .content ol {
  margin: var(--sp-sm) 0 var(--sp-md) var(--sp-lg);
}

.content li {
  margin-bottom: var(--sp-xs);
}

.content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}


/* ── Callout Boxes ─────────────────────────────────────────── */
.callout {
  display: flex;
  gap: var(--sp-md);
  border-radius: 8px;
  padding: var(--sp-md) var(--sp-lg);
  margin: var(--sp-lg) 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.callout-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.callout.info    { background: var(--color-info-bg);    border-left: 4px solid var(--color-info); }
.callout.success { background: var(--color-success-bg); border-left: 4px solid var(--color-success); }
.callout.warning { background: var(--color-warning-bg); border-left: 4px solid var(--color-warning); }
.callout.danger  { background: var(--color-danger-bg);  border-left: 4px solid var(--color-danger); }

.callout strong {
  display: block;
  margin-bottom: 0.2rem;
}


/* ── Step-by-Step Instructions ─────────────────────────────── */
.steps {
  counter-reset: step;
  list-style: none;
  margin: var(--sp-lg) 0;
  padding: 0;
}

.steps > li {
  counter-increment: step;
  display: flex;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  align-items: flex-start;
}

.steps > li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  background: var(--ds-blue);
  color: white;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.steps > li .step-body {
  flex: 1;
}

.steps > li .step-body strong {
  display: block;
  margin-bottom: 0.15rem;
}

.steps > li .step-body p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}


/* ── Data Tables ───────────────────────────────────────────── */
.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-lg) 0;
  font-size: 0.88rem;
}

.manual-table th {
  background: var(--ds-blue);
  color: white;
  padding: 0.6rem 0.85rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
}

.manual-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.manual-table tr:nth-child(even) td {
  background: var(--bg-aside);
}

.manual-table tr:hover td {
  background: var(--ds-blue-light);
}


/* ── Keyboard Shortcut Badge ───────────────────────────────── */
kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78em;
  background: var(--bg-aside);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.45em;
  box-shadow: 0 1px 0 var(--border);
  white-space: nowrap;
}


/* ── Screenshot Placeholder ────────────────────────────────── */
.screenshot-placeholder {
  position: relative;
  background: var(--bg-aside);
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: var(--sp-xl) var(--sp-lg);
  margin: var(--sp-lg) 0;
  text-align: center;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
}

.screenshot-placeholder .ph-icon {
  font-size: 2.2rem;
  opacity: 0.4;
}

.screenshot-placeholder .ph-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.screenshot-placeholder .ph-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 400px;
}

/* Real screenshot (replaces placeholder in Phase 3) */
.screenshot {
  position: relative;
  margin: var(--sp-lg) 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.screenshot img {
  width: 100%;
  display: block;
  height: auto;
}

.screenshot figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg-aside);
  border-top: 1px solid var(--border-light);
}

.screenshot.screenshot-header-strip {
  max-width: 100%;
}

.screenshot.screenshot-nav-strip {
  max-width: 11rem;
  margin-left: auto;
  margin-right: auto;
}

.screenshot.screenshot-sidebar {
  max-width: 11rem;
  margin-left: auto;
  margin-right: auto;
}

.screenshot.screenshot-shaft-types {
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
}

.media-split {
  display: grid;
  gap: var(--sp-lg);
  align-items: start;
  margin: var(--sp-lg) 0;
}

.media-split > .manual-table,
.media-split > .screenshot {
  margin: 0;
}

@media (min-width: 900px) {
  .media-split.media-split-nav {
    grid-template-columns: minmax(0, 1fr) 11rem;
  }

  .media-split.media-split-nav > .screenshot.screenshot-nav-strip {
    align-self: start;
  }

  .media-split.media-split-nav > .screenshot.screenshot-nav-strip img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: top center;
  }
}

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

  .screenshot.screenshot-nav-strip {
    max-width: 8rem;
  }
}

/* Inline icon (small UI element screenshots, e.g. lock/eye icons) */
.inline-icon {
  height: 18px;
  width: auto;
  vertical-align: middle;
  margin: 0 0.15rem;
  border-radius: 3px;
}


/* ── Annotation Overlays (for screenshots) ─────────────────── */
.ann-num {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--ann-red);
  color: white;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.4);
  animation: ann-pulse 2s ease-in-out infinite;
  z-index: 10;
}

.ann-arrow {
  position: absolute;
  width: 50px;
  height: 2px;
  background: var(--ann-red);
  transform-origin: left center;
  z-index: 10;
}

.ann-arrow::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--ann-red);
}

.ann-box {
  position: absolute;
  border: 2.5px solid var(--ann-red);
  border-radius: 4px;
  background: var(--ann-red-bg);
  z-index: 10;
  animation: ann-highlight 1.5s ease-in-out 1;
}

.ann-label {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ann-red);
  background: white;
  border: 1px solid var(--ann-red);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}


/* ── Annotation Animations ─────────────────────────────────── */
@keyframes ann-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes ann-highlight {
  0% { opacity: 0; transform: scale(0.95); }
  30% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes ann-slide-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ann-draw {
  from { width: 0; }
  to   { width: var(--arrow-length, 50px); }
}


/* ── Interactive Walkthrough ───────────────────────────────── */
.walkthrough {
  margin: var(--sp-xl) 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: white;
}

.walkthrough-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--bg-aside);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.walkthrough-header .wt-title {
  font-weight: 700;
  color: var(--text-primary);
}

.walkthrough-steps-indicator {
  display: flex;
  gap: 6px;
}

.walkthrough-steps-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all var(--duration) var(--ease-out);
}

.walkthrough-steps-indicator .dot.active {
  background: var(--ds-blue);
  transform: scale(1.25);
}

.walkthrough-steps-indicator .dot.done {
  background: var(--color-success);
}

.walkthrough-viewport {
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.walkthrough-step {
  display: none;
  width: 100%;
  padding: var(--sp-lg);
}

.walkthrough-step.active {
  display: block;
  animation: wt-fade-in 0.3s var(--ease-out);
}

@keyframes wt-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.walkthrough-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) var(--sp-lg);
  border-top: 1px solid var(--border);
  background: var(--bg-aside);
}

.walkthrough-footer .step-info {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.walkthrough-footer .wt-nav {
  display: flex;
  gap: var(--sp-sm);
}

.wt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.wt-btn:hover {
  background: var(--ds-blue-light);
  border-color: var(--ds-blue-mid);
}

.wt-btn.primary {
  background: var(--ds-blue);
  color: white;
  border-color: var(--ds-blue);
}

.wt-btn.primary:hover {
  background: var(--ds-blue-dark);
}

.wt-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-lg);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--ds-blue);
}

.breadcrumb .sep {
  font-size: 0.65rem;
}


/* ── Chapter Navigation (Prev / Next) ──────────────────────── */
.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin-top: var(--sp-2xl);
  padding-top: var(--sp-xl);
  border-top: 2px solid var(--border);
}

.chapter-nav a {
  display: block;
  padding: var(--sp-md);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all var(--duration) var(--ease-out);
}

.chapter-nav a:hover {
  border-color: var(--ds-blue-mid);
  background: var(--ds-blue-light);
  text-decoration: none;
}

.chapter-nav a .nav-dir {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chapter-nav a .nav-title {
  font-weight: 600;
  color: var(--ds-blue);
  margin-top: 0.15rem;
}

.chapter-nav .next {
  text-align: right;
}


/* ── Search Bar (Header) ───────────────────────────────────── */
.search-box {
  position: relative;
}

.search-box input {
  width: 220px;
  padding: 0.35rem 0.75rem 0.35rem 2rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 0.82rem;
  outline: none;
  transition: all var(--duration) var(--ease-out);
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.5);
}

.search-box input:focus {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  width: 280px;
}

.search-box .search-icon {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.5;
}


/* ── Mobile Menu Toggle ────────────────────────────────────── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  padding: var(--sp-xs);
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }
}


/* ── Print Styles ──────────────────────────────────────────── */
@media print {
  .sidebar,
  .manual-header,
  .lang-switch,
  .search-box,
  .walkthrough-footer,
  .menu-toggle,
  .chapter-nav { display: none !important; }

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

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

  .screenshot-placeholder {
    border-style: solid;
    border-color: #ccc;
    background: #f9f9f9;
  }

  .ann-num { animation: none; }

  body { font-size: 11pt; }
  h1 { font-size: 20pt; }
  h2 { font-size: 16pt; }
  h3 { font-size: 13pt; }
}


/* ── Utility Classes ───────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-small  { font-size: 0.85rem; }
.text-center { text-align: center; }
.mt-0  { margin-top: 0; }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
