/* ===== USER MANUAL PAGE ===== */

/* Hero */
.manual-hero {
  position: relative; overflow: hidden;
  min-height: 300px; background: #051e0a;
}
.manual-hero__inner {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 40px;
  padding-top: 56px; padding-bottom: 56px;
}
.manual-hero__content { flex: 1; }
.manual-hero__content h1 {
  font-size: clamp(26px, 3.5vw, 42px); font-weight: 800;
  line-height: 1.2; margin-bottom: 14px; color: #fff;
}
.manual-hero__sub { color: rgba(255,255,255,0.75); font-size: 14px; max-width: 420px; }
.manual-hero__visual {
  flex: 0 0 auto; display: flex;
  align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
}
.manual-hero__pdf-icon {
  filter: drop-shadow(0 8px 24px rgba(46,204,85,0.4));
  animation: floatPdf 3s ease-in-out infinite alternate;
}
@keyframes floatPdf {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

/* Filter toggle — desktop hidden */
.filter-toggle-btn {
  display: none;
  align-items: center; gap: 10px;
  width: 100%; padding: 13px 16px;
  margin: 14px 0 0;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; color: #333;
  transition: border-color .15s;
}
.filter-toggle-btn:hover { border-color: var(--green-dark); color: var(--green-dark); }
.manual-search-bar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky; top: 57px; z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.manual-search__input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #f5f7fa; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 8px 14px;
  transition: border-color .15s;
}
.manual-search__input-wrap:focus-within { border-color: var(--green-dark); background: #fff; }
.manual-search__input-wrap input {
  flex: 1; border: none; background: transparent;
  font-size: 14px; color: #333; outline: none;
}
.manual-search__examples {
  margin-top: 8px; font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.manual-search__examples span {
  background: var(--green-light); color: var(--green-dark);
  border-radius: 20px; padding: 2px 10px;
  cursor: pointer; font-weight: 500;
  transition: background .15s;
}
.manual-search__examples span:hover { background: #c3e6cb; }

/* Layout */
.manual-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 48px;
  align-items: start;
}

/* Sidebar */
.manual-sidebar {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
  position: sticky; top: 130px;
}
.filter-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.filter-header strong { font-size: 14px; font-weight: 700; }
.filter-reset {
  font-size: 12px; color: var(--green-dark); font-weight: 600;
  background: none; border: none; cursor: pointer; padding: 0;
}
.filter-group { margin-bottom: 18px; }
.filter-label {
  font-size: 12px; font-weight: 700; color: #333;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 8px;
}
.filter-check, .filter-radio {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #444; margin-bottom: 6px; cursor: pointer;
}
.filter-check span { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.filter-check input, .filter-radio input { accent-color: var(--green-dark); }

/* Main */
.manual-main { min-width: 0; }

.manual-section { margin-bottom: 28px; }
.manual-section--card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
}
.manual-section__hd {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.manual-section__hd h2 { font-size: 16px; font-weight: 700; }
.manual-viewall {
  font-size: 12px; font-weight: 600; color: var(--green-dark);
  display: flex; align-items: center; gap: 4px;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.cat-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 14px 8px; text-align: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer;
  transition: box-shadow .2s, border-color .2s, transform .15s;
}
.cat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--green-dark); transform: translateY(-2px); }
.cat-card__img {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.cat-card__img--green  { background: #e8f5ee; }
.cat-card__img--gray   { background: #f0f0f0; }
.cat-card__img--blue   { background: #e8f0fa; }
.cat-card__img--purple { background: #f3eeff; }
.cat-card__img--orange { background: #fff3e8; }
.cat-card__img--teal   { background: #e6faf8; }
.cat-card strong { font-size: 12px; font-weight: 700; color: #111; line-height: 1.3; }
.cat-card small  { font-size: 11px; color: var(--text-muted); }

/* Manuals grid */
.manuals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.manual-card {
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, border-color .2s;
}
.manual-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.09); border-color: var(--green-dark); }
.manual-card__img {
  background: var(--gray); display: flex;
  align-items: center; justify-content: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.manual-card__img img { width: 100%; max-width: 110px; height: 80px; object-fit: cover; border-radius: 6px; }
.manual-card__body { padding: 12px; flex: 1; }
.manual-card__body h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.manual-card__model { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.manual-card__meta { display: flex; gap: 5px; margin-bottom: 5px; }
.manual-card__info { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.manual-card__date { font-size: 11px; color: var(--text-muted); }
.manual-card__actions {
  padding: 10px 12px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.manual-card__view {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; color: var(--green-dark); font-weight: 600;
}
.btn--sm { padding: 7px 14px; font-size: 12px; justify-content: center; }

/* Tags */
.tag {
  display: inline-flex; align-items: center;
  border-radius: 20px; padding: 2px 8px;
  font-size: 10px; font-weight: 700;
}
.tag--green  { background: var(--green-light); color: var(--green-dark); }
.tag--latest { background: #e8f0fa; color: #1d72b8; }

/* Bottom row */
.manual-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Recent list */
.recent-list { display: flex; flex-direction: column; gap: 12px; }
.recent-item {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-item__img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.recent-item__info { flex: 1; min-width: 0; }
.recent-item__info strong { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item__info small { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.recent-item__meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.recent-item__dl {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1.5px solid var(--border); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.recent-item__dl:hover { background: var(--green-light); border-color: var(--green-dark); }

/* Help card */
.manual-help-card {
  display: flex; flex-direction: row;
  align-items: center; text-align: left; gap: 20px;
  background: linear-gradient(160deg, #f0faf4, #e8f5ee);
  border-color: #c3e6cb;
}
.manual-help-card .manual-help-text { flex: 1; }
.manual-help-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.manual-help-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.manual-help-icon { flex-shrink: 0; }
/* Popular downloads */
.popular-list { display: flex; flex-direction: column; gap: 0; }
.popular-list li a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; font-size: 13px; font-weight: 500; color: #333;
  border-bottom: 1px solid var(--border);
  transition: color .15s;
}
.popular-list li:last-child a { border-bottom: none; }
.popular-list li a:hover { color: var(--green-dark); }
.popular-list li a i:last-child { margin-left: auto; }

/* (responsive rules moved to end of file) */

@media (min-width: 769px) and (max-width: 1100px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .manuals-grid { grid-template-columns: repeat(3, 1fr); }
  .manual-bottom-row { grid-template-columns: 1fr; }
}

/* ===== SEARCH BUTTON VARIANTS ===== */
.search-btn-mobile { display: none; padding: 10px 14px; flex-shrink: 0; }
.search-btn-desktop { flex-shrink: 0; }

/* ===== CATEGORY SECTION HEADER ===== */
.cat-section-hd { margin-bottom: 12px; }

/* ===== HORIZONTAL MANUAL CARD (mobile) ===== */
.manual-card--horiz {
  flex-direction: row;
  align-items: center;
  padding: 0;
  border-radius: 12px;
}
.manual-card__img--sm {
  width: 80px; height: 80px; flex-shrink: 0;
  padding: 8px; border-bottom: none;
  border-right: 1px solid var(--border);
}
.manual-card__img--sm img {
  width: 100%; height: 100%;
  max-width: none; object-fit: cover; border-radius: 6px;
}
.manual-card--horiz .manual-card__body {
  flex: 1; padding: 10px 12px; min-width: 0;
}
.manual-card--horiz .manual-card__body h4 { font-size: 13px; }
.manual-card__actions--horiz {
  flex-direction: column; gap: 6px;
  padding: 10px 12px; border-top: none;
  border-left: 1px solid var(--border);
  min-width: 86px; flex-shrink: 0;
}
.manual-card__actions--horiz .btn--sm {
  width: 100%; justify-content: center;
  padding: 7px 10px; font-size: 12px;
}

/* ===== VIEW ALL BUTTON ===== */
.manuals-viewall-btn {
  width: 100%; padding: 13px;
  margin-top: 12px;
  background: #fff; border: 1.5px solid var(--green-dark);
  border-radius: 10px; color: var(--green-dark);
  font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.manuals-viewall-btn:hover { background: var(--green-light); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Layout */
  .manual-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0;
  }
  .manual-sidebar {
    position: static;
    border-radius: 0;
    border-left: none; border-right: none; border-top: none;
    display: none;
    margin-bottom: 0;
    border-bottom: 2px solid var(--border);
  }
  .manual-sidebar.sidebar--open { display: block; }
  .manual-main { padding-top: 16px; }

  /* Filter toggle button — show on mobile */
  .filter-toggle-btn { display: flex; }

  /* Search bar */
  .manual-search-bar { position: static; padding: 14px 0; }
  .manual-search__input-wrap { padding: 8px 10px; gap: 8px; }
  .search-btn-desktop { display: none; }
  .search-btn-mobile { display: flex; border-radius: 8px; }
  .manual-search__examples { gap: 6px; margin-top: 10px; }
  .manual-search__examples span { font-size: 11px; padding: 3px 10px; }

  /* Category grid: 3×2 */
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-card { padding: 10px 4px; gap: 6px; }
  .cat-card__img { width: 44px; height: 44px; border-radius: 10px; }
  .cat-card strong { font-size: 11px; }
  .cat-count { display: none; } /* hide count text on mobile */

  /* Cat section header — hide on mobile */
  .cat-section-hd { display: none; }

  /* Manuals: horizontal list */
  .manuals-grid { grid-template-columns: 1fr; gap: 10px; }
  .manual-card { flex-direction: row; border-radius: 12px; }

  /* Bottom row */
  .manual-bottom-row { grid-template-columns: 1fr; }
  .manual-help-card { flex-direction: column; text-align: center; }
  .manual-help-card .manual-help-text { text-align: center; }

  /* Sections */
  .manual-section { margin-bottom: 20px; }
  .manual-section--card { padding: 14px; }
}

@media (max-width: 480px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .cat-card__img { width: 38px; height: 38px; }
  .cat-card strong { font-size: 10px; }
  .manual-card__img--sm { width: 70px; height: 70px; }
}

/* ===== FLIPBOOK MODAL ===== */

.fb-modal {
  background: #1a1a2e;
  border-radius: 14px;
  width: calc(100vw - 32px);
  max-width: 1000px;
  height: 92vh;           /* fixed height so stage fills it */
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.65);
  overflow: hidden;
}

/* Header — fixed height */
.fb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #111122;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  height: 52px;
  gap: 10px;
}
.fb-header__left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.fb-title {
  font-size: 13px; font-weight: 700; color: #eee;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-header__right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fb-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; background: #1e9e3e; color: #fff;
  border: none; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .15s; white-space: nowrap;
}
.fb-btn:hover { background: #2ecc55; }
.fb-btn--icon {
  background: rgba(255,255,255,0.08);
  padding: 6px 10px; font-size: 14px; color: #ccc;
}
.fb-btn--icon:hover { background: rgba(255,255,255,0.15); color: #fff; }
.fb-btn--close { background: rgba(220,38,38,0.15); color: #f87171; font-size: 16px; }
.fb-btn--close:hover { background: #dc2626; color: #fff; }

/* Stage — takes all remaining height, scrollable when zoomed in */
.fb-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #16213e;
  padding: 16px 52px;
  overflow: auto;
}

/* Nav arrows */
.fb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10; background: rgba(255,255,255,0.12); color: #fff;
  border: none; border-radius: 50%; width: 40px; height: 40px;
  font-size: 24px; cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.fb-nav:hover:not(:disabled) { background: #1e9e3e; }
.fb-nav:disabled { opacity: 0.2; cursor: not-allowed; }
.fb-nav--left  { left: 8px; }
.fb-nav--right { right: 8px; }

/* Book wrap */
.fb-book-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  box-shadow: -6px 0 20px rgba(0,0,0,0.5), 6px 0 20px rgba(0,0,0,0.4), 0 8px 28px rgba(0,0,0,0.5);
  border-radius: 2px 5px 5px 2px;
}
.fb-spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: linear-gradient(to right, #0a0a14, #2a2a3e, #1a1a2e);
  z-index: 2; border-radius: 2px 0 0 2px; pointer-events: none;
}

/* Canvas — no CSS size constraints; JS renders at correct size, stage scrolls */
.fb-canvas {
  display: block;
  background: #fff;
  border-radius: 0 4px 4px 0;
  position: relative; z-index: 1;
  cursor: grab;
}
.fb-canvas:active { cursor: grabbing; }

/* Loading overlay */
.fb-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(22,33,62,0.88); color: #aaa; font-size: 13px; z-index: 5;
  border-radius: 0 4px 4px 0;
}
.fb-spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,0.1); border-top-color: #1e9e3e;
  border-radius: 50%; animation: fbSpin 0.7s linear infinite;
}
@keyframes fbSpin { to { transform: rotate(360deg); } }

/* No file state */
.fb-nofile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #aaa; background: #fff; border-radius: 4px;
  padding: 48px 32px; text-align: center; min-width: 220px;
}
.fb-nofile p     { font-size: 14px; font-weight: 600; color: #888; margin: 0; }
.fb-nofile small { font-size: 12px; color: #aaa; }

/* Controls bar — fixed height, single row */
.fb-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: #111122;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0; height: 48px; gap: 8px;
  overflow: hidden;
}
.fb-controls__left  { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.fb-controls__right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.fb-controls__center {
  display: flex; align-items: center; gap: 8px;
  flex: 1; justify-content: center;
}
.fb-ctrl-btn {
  background: rgba(255,255,255,0.08); color: #ccc; border: none;
  border-radius: 6px; padding: 5px 11px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .15s; white-space: nowrap;
}
.fb-ctrl-btn:hover { background: #1e9e3e; color: #fff; }
.fb-page-info {
  display: flex; align-items: center; gap: 5px; font-size: 12px; color: #aaa;
  white-space: nowrap;
}
.fb-page-input {
  width: 40px; text-align: center;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px; color: #fff; font-size: 13px; font-weight: 700;
  padding: 3px 4px; font-family: inherit; outline: none;
}
.fb-page-input:focus { border-color: #1e9e3e; }
.fb-page-input::-webkit-inner-spin-button,
.fb-page-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.fb-page-input { -moz-appearance: textfield; }

/* Page flip compat stubs */
.fb-flip-out-left,.fb-flip-out-right,.fb-flip-in-right,.fb-flip-in-left {}

/* ── Responsive ── */
@media (max-width: 768px) {
  .fb-modal { width: 100vw; border-radius: 0; height: 100dvh; max-width: 100%; }
  .fb-stage { padding: 10px 44px; overflow: auto; }
  .fb-controls { padding: 6px 10px; height: auto; flex-wrap: nowrap; }
  .fb-controls__right { display: none; }
  .fb-controls__left { gap: 3px; }
  .fb-ctrl-btn { padding: 5px 8px; font-size: 11px; }
  .fb-title { font-size: 11px; }
  .fb-btn { padding: 5px 10px; font-size: 12px; }
  .fb-header { height: 48px; padding: 8px 12px; }
  .fb-nav { width: 34px; height: 34px; font-size: 20px; }
  .fb-nav--left  { left: 4px; }
  .fb-nav--right { right: 4px; }
}

