/* BeCozU Manual — reskinned to match screen1 (step-guide) / screen2 (bento hub).
   Only chrome/decoration is styled here — manual body content (text, images,
   data-i18n hooks) is untouched; step numbering and corner accents below are
   generated purely with CSS counters/pseudo-elements, not real text. */

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

/* ---------- Shell: sidebar + mobile pills + content ---------- */

.manual-shell {
  max-width: 80rem;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (min-width: 1024px) {
  .manual-shell {
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
  }
}

/* Desktop glass-panel sidebar (screen1 pattern) */
.manual-sidebar {
  display: none;
}
@media (min-width: 1024px) {
  .manual-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 88px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 24px;
    box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 20px rgba(26, 27, 58, 0.08);
  }
}

.manual-sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.manual-sidebar-title .material-symbols-outlined {
  color: #3a3dcf;
  font-size: 22px;
}
.manual-sidebar-title h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1A1B3A;
}

.manual-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.manual-sidebar-list li { margin: 0; }
.manual-sidebar-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid transparent;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  color: #4A4D70;
  transition: all 0.2s ease;
}
.manual-sidebar-list a .material-symbols-outlined {
  font-size: 22px;
  color: #767586;
  transition: color 0.2s ease;
}
.manual-sidebar-list a:hover {
  background: #ffffff;
  color: #1A1B3A;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 16px rgba(26, 27, 58, 0.08);
}
.manual-sidebar-list a:hover .material-symbols-outlined { color: #3a3dcf; }
.manual-sidebar-list a.active {
  background: #ffffff;
  border-left-color: #3a3dcf;
  color: #1A1B3A;
  font-weight: 700;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 16px rgba(26, 27, 58, 0.08);
}
.manual-sidebar-list a.active .material-symbols-outlined { color: #3a3dcf; }

/* Mobile horizontal pill nav (screen1 pattern — replaces old drawer) */
.manual-pills {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}
@media (min-width: 1024px) {
  .manual-pills { display: none; }
}
.manual-pills.no-scrollbar::-webkit-scrollbar { display: none; }
.manual-pills.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.manual-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: #ffffff;
  color: #4A4D70;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 14px rgba(26, 27, 58, 0.06);
  transition: all 0.2s ease;
}
.manual-pill .material-symbols-outlined { font-size: 19px; }
.manual-pill.active {
  background: #1A1B3A;
  color: #ffffff;
}

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

/* ---------- Toolbar (title + language) ---------- */

.manual-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}
.manual-toolbar h1 {
  margin: 0;
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1A1B3A;
}
@media (min-width: 768px) {
  .manual-toolbar h1 { font-size: 40px; line-height: 52px; }
}

.lang-wrapper { display: flex; align-items: center; gap: 10px; }
.lang-label { font-size: 14px; font-weight: 600; color: #4A4D70; }

/* Custom language dropdown (built at runtime by manual.js) */
.custom-select-container { position: relative; display: inline-block; width: 140px; user-select: none; }
.custom-select-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 14px; font-size: 15px; font-weight: 600; font-family: inherit;
  color: #1A1B3A; border: 1px solid #e1e3e4; border-radius: 9999px; background: #ffffff;
  cursor: pointer; outline: none; transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(26, 27, 58, 0.05); box-sizing: border-box;
}
.custom-select-trigger:hover { border-color: #3a3dcf; box-shadow: 0 0 0 3px rgba(58, 61, 207, 0.1); }
.custom-select-text { flex: 1; text-align: left; margin-right: 8px; }
.custom-select-flag {
  width: 22px; height: 15px; object-fit: cover; border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.08); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  margin-right: 8px; display: block;
}
.custom-select-arrow { font-size: 0.8rem; color: #4A4D70; transition: transform 0.2s ease; }
.custom-select-container.open .custom-select-arrow { transform: rotate(180deg); }
.custom-select-options {
  position: absolute; top: 105%; left: 0; right: 0; background: #ffffff;
  border: 1px solid #e1e3e4; border-radius: 16px;
  box-shadow: -4px -4px 12px rgba(255, 255, 255, 0.9), 10px 10px 24px rgba(26, 27, 58, 0.12);
  z-index: 80; display: none; overflow: hidden; margin-top: 4px;
}
.custom-select-container.open .custom-select-options { display: block; animation: fadeInUp 0.15s ease-out forwards; }
.custom-select-option {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  cursor: pointer; font-size: 14px; font-weight: 500; color: #1A1B3A; transition: background-color 0.15s ease;
}
.custom-select-option:hover, .custom-select-option.selected { background: #e1e0ff; color: #3a3dcf; }
.custom-select-option.selected { font-weight: 700; }

/* ---------- Body content ---------- */

.manual-container {
  min-width: 0;
  animation: fadeInUp 0.5s ease-out forwards;
  font-size: 18px;
  line-height: 1.6;
  color: #1A1B3A;
  /* No counter-reset here: leaving "stepnum" unset lets the first .step-card's
     counter-increment create it fresh at 0. If a reset were placed here, a
     later sibling .section-title's own counter-reset would be ignored by
     Chrome (an ancestor-level reset "claims" the name for the whole
     subtree), breaking the per-section restart below. */
}

/* Step cards — numbered circle (flex item via ::before) + corner accent (::after),
   mirroring screen1's article pattern without touching the image/description markup. */
.step-card {
  counter-increment: stepnum;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 20px rgba(26, 27, 58, 0.08);
  margin-bottom: 28px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: -6px -6px 15px rgba(255, 255, 255, 0.9), 12px 12px 25px rgba(26, 27, 58, 0.12);
}
@media (min-width: 768px) {
  .step-card { flex-direction: row; align-items: flex-start; gap: 32px; }
}

.step-card::before {
  content: counter(stepnum);
  order: -1;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  background: #1A1B3A;
  color: #ffffff;
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(26, 27, 58, 0.25);
}
.step-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 96px;
  height: 96px;
  background: #F3E5F5;
  border-bottom-left-radius: 9999px;
  transform: translate(28px, -28px);
  transition: transform 0.3s ease;
  z-index: 0;
  pointer-events: none;
}
.step-card:hover::after { transform: translate(18px, -18px) scale(1.08); }

.step-img-wrapper, .step-desc { position: relative; z-index: 1; }

/* App screenshots sit centered inside a soft grey panel so they read as a
   framed figure instead of stretching edge-to-edge (esp. on mobile). */
.step-img-wrapper {
  margin: 0;
  background: #eef0f2;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) {
  .step-img-wrapper { flex: 0 0 42%; max-width: 42%; align-self: stretch; }
}

.step-img {
  max-width: 100%;
  max-height: 420px;
  width: auto;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 10px 24px rgba(26, 27, 58, 0.12);
}
@media (max-width: 767.98px) {
  .step-img { max-height: 340px; }
}

.step-desc {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.7;
  color: #1A1B3A;
  word-break: break-word;
  overflow-wrap: break-word;
}
@media (min-width: 768px) {
  .step-desc { flex: 1; font-size: 20px; align-self: center; }
}

/* Inline "important" callout inside a step description (was a raw red span). */
.step-note {
  display: block;
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #ffdad6;
  color: #93000a;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
}
.step-note::before { content: "\26a0\fe0f\00a0"; }

/* Section divider between grouped steps (e.g. pairing -> firmware update).
   Resets the step counter so the next group starts back at 1. */
.section-divider {
  border: none;
  border-top: 1px solid #e1e3e4;
  margin: 8px 0 32px;
}
.section-title {
  counter-reset: stepnum;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1A1B3A;
  margin: 16px 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #3a3dcf;
}

.warning-box {
  position: relative;
  background: #ffdad6;
  border-left: 6px solid #ba1a1a;
  color: #93000a;
  padding: 20px 24px;
  border-radius: 16px;
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 32px;
}

/* ---------- Prev / Next navigation ---------- */

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 48px 0 16px;
}
.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 24px;
  min-height: 56px;
  background: #1A1B3A;
  color: #ffffff;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  border-radius: 9999px;
  text-align: center;
  border: 2px solid transparent;
  box-sizing: border-box;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 20px rgba(26, 27, 58, 0.08);
  transition: all 0.3s ease;
}
.nav-btn:hover {
  transform: translateY(-2px);
  background: #2b2cc2;
  box-shadow: -6px -6px 15px rgba(255, 255, 255, 0.9), 12px 12px 25px rgba(26, 27, 58, 0.12);
}
.nav-buttons .nav-btn:first-child:not(.disabled) {
  background: #ffffff;
  color: #1A1B3A;
  border-color: #e1e3e4;
  box-shadow: 0 1px 2px rgba(26, 27, 58, 0.05);
}
.nav-buttons .nav-btn:first-child:not(.disabled):hover {
  background: #e1e0ff;
  border-color: #3a3dcf;
  color: #2b2cc2;
}
.nav-btn.disabled {
  background: #e1e3e4;
  color: #9a9caa;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Troubleshooting Q&A blocks ---------- */

.trouble-section {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 20px rgba(26, 27, 58, 0.08);
  padding: 32px;
  padding-left: 36px;
  margin-bottom: 28px;
  transition: transform 0.3s ease;
}
.trouble-section::before {
  content: "";
  position: absolute;
  top: 32px;
  bottom: 32px;
  left: 0;
  width: 4px;
  border-radius: 9999px;
  background: #3a3dcf;
}
.trouble-section:hover { transform: translateY(-2px); }
.trouble-title {
  font-size: 22px;
  font-weight: 700;
  color: #1A1B3A;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e1e3e4;
}
.trouble-steps {
  list-style: decimal outside;
  font-size: 18px;
  line-height: 1.8;
  color: #1A1B3A;
  padding-left: 24px;
  margin: 0;
}
.trouble-steps li { display: list-item; margin-bottom: 16px; padding-left: 8px; }
.trouble-steps li::marker { font-weight: 700; color: #3a3dcf; }
.trouble-images {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.trouble-images img {
  max-width: 45%;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(26, 27, 58, 0.05);
}

/* ---------- OS tabs (phone pairing: Android / iOS) ---------- */

.os-tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 28px;
  max-width: 480px;
}
.os-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #4A4D70;
  background: #ffffff;
  border: 2px solid #e1e3e4;
  border-radius: 9999px;
  cursor: pointer;
  outline: none;
  text-align: center;
  word-break: keep-all;
  box-shadow: 0 1px 2px rgba(26, 27, 58, 0.05);
  transition: all 0.2s ease;
}
.os-tab-btn:hover { color: #3a3dcf; border-color: #3a3dcf; }
.os-tab-btn.active {
  color: #ffffff;
  background: #1A1B3A;
  border-color: #1A1B3A;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 20px rgba(26, 27, 58, 0.08);
}
.os-content { display: none; animation: fadeInUp 0.4s ease-out forwards; }
.os-content.active { display: block; }

/* ---------- Manual index hub (screen2 bento pattern) ---------- */

.manual-index-hero {
  text-align: center;
  max-width: 56rem;
  margin: 0 auto 48px;
}
.manual-index-hero h1 {
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1A1B3A;
  margin: 0 0 16px;
}
@media (min-width: 768px) {
  .manual-index-hero h1 { font-size: 40px; line-height: 52px; }
}
.welcome-text {
  font-size: 20px;
  line-height: 32px;
  color: #4A4D70;
  margin: 0;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
@media (min-width: 1024px) {
  .index-grid { grid-template-columns: repeat(4, 1fr); }
}

.index-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 32px 24px;
  border-radius: 16px;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 15px rgba(26, 27, 58, 0.08);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.index-card:hover {
  transform: translateY(-6px);
  box-shadow: -6px -6px 15px rgba(255, 255, 255, 0.9), 12px 12px 25px rgba(26, 27, 58, 0.12);
}
.index-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: transform 0.25s ease;
}
.index-card:hover .index-card-icon { transform: scale(1.08); }
.index-card-icon .material-symbols-outlined {
  font-size: 30px;
  color: #1A1B3A;
  font-variation-settings: 'FILL' 1;
}
.index-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: #1A1B3A;
}
.index-card-desc {
  font-size: 15px;
  color: #4A4D70;
  line-height: 1.5;
}

.accent-teal { background: #E0F2F1; }
.accent-lavender { background: #F3E5F5; }
.accent-blue { background: #cde6f9; }
.accent-gray { background: #e1e3e4; }

/* "View all manuals" panel below the 4 featured cards (screen2 pattern) */
.manual-all-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  margin-top: 48px;
  box-shadow: -4px -4px 10px rgba(255, 255, 255, 0.8), 8px 8px 20px rgba(26, 27, 58, 0.08);
}
.manual-all-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.manual-all-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1A1B3A;
}

.manual-all-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
@media (min-width: 768px) {
  .manual-all-list { grid-template-columns: 1fr 1fr; column-gap: 32px; }
}
.manual-all-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}
.manual-all-row:hover { background: #f3f4f5; }
.manual-all-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.manual-all-row-icon .material-symbols-outlined { font-size: 20px; color: #1A1B3A; }
.manual-all-row-label { flex: 1; font-size: 16px; font-weight: 600; color: #1A1B3A; }
.manual-all-row .chev { color: #767586; transition: transform 0.2s ease; }
.manual-all-row:hover .chev { transform: translateX(4px); color: #3a3dcf; }

/* Small screens */
@media (max-width: 480px) {
  .manual-shell { padding: 20px 16px 48px; }
  .manual-toolbar h1 { font-size: 22px; line-height: 30px; }
  .step-card { padding: 20px; }
  .step-desc { font-size: 17px; }
  .trouble-section { padding: 24px 20px 24px 28px; }
  .trouble-images img { max-width: 100%; }
  .nav-buttons { flex-direction: column; }
  .lang-label { display: none; }
}
