/* ==========================================================================
   Manuals Library Styles
   ========================================================================== */

   .manuals-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    justify-content: center;
    align-items: center;
  }
  
  .manuals-controls input,
  .manuals-controls select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    background-color: var(--clr-bg);
    color: var(--clr-text);
    flex: 1 1 200px;
    max-width: 22rem;
    transition: border 0.2s ease;
  }
  
  .manuals-controls input:focus,
  .manuals-controls select:focus {
    border-color: var(--clr-primary);
    outline: none;
  }
  
  #manualSearch {
    margin-bottom: 0.1rem;
  }
  
/* manuals.css – modernized manual cards */

/* Scrollable vertical list layout for manuals */
.manuals-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 1.5rem;
  padding: 1rem 0;
  list-style: none;
  margin: 2rem 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.manuals-grid li {
  min-width: 300px;
  flex: 0 0 auto;
  background-color: var(--clr-surface, #fff);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.manuals-grid li:hover {
  box-shadow: var(--shadow-lg), 0 10px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

/* Optional: better scrollbar styling */
.manuals-grid::-webkit-scrollbar {
  height: 8px;
}
.manuals-grid::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: 4px;
}



.manuals-grid li:hover {
  box-shadow: var(--shadow-lg), 0 10px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.manual-card__icon {
  font-size: 2rem;
  color: var(--clr-primary);
  margin-bottom: 0.5rem;
}

.manual-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--clr-text);
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.manual-card__title:hover {
  color: var(--clr-primary);
  text-decoration: underline;
}

.manual-card__meta {
  font-size: 0.9rem;
  color: var(--clr-muted, #6b7280);
  margin-bottom: 0.75rem;
}

.manual-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.manual-tag {
  background-color: var(--clr-primary-light, #e0f2fe);
  color: var(--clr-primary-dark, #0369a1);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.manual-card__actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
}

.manual-card__btn {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  color: var(--clr-primary);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}

.manual-card__btn:hover {
  background: var(--clr-primary-light);
}

  
  .manuals-request {
    border-top: 1px solid var(--clr-border);
    padding-top: 2rem;
    text-align: center;
  }
  
  .manuals-request h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--clr-primary);
  }
  
  .manuals-request p {
    margin-bottom: 1rem;
    color: var(--clr-text);
  }
  
  .manuals-request form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
  }
  
  .manuals-request input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    flex: 1 1 200px;
    max-width: 20rem;
    transition: border 0.2s ease;
  }
  
  .manuals-request input:focus {
    border-color: var(--clr-primary);
    outline: none;
  }
  
  /* ========== Manual Toolbar: Aligned, Clean, Responsive ========== */
.manuals-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--clr-surface, #fff);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
  margin-bottom: 2rem;
  align-items: center;
  justify-content: center;
}

.manuals-toolbar label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: var(--clr-text);
  background-color: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 0.4rem 0.75rem;
  flex: 1 1 250px;
  max-width: 320px;
}

.manuals-toolbar i {
  font-size: 1rem;
  color: var(--clr-muted);
}

.manuals-toolbar input[type="search"],
.manuals-toolbar select {
  flex: 1;
  border: none;
  font-size: 0.95rem;
  padding: 0.5rem;
  background: transparent;
  color: var(--clr-text);
}

.manuals-toolbar input:focus,
.manuals-toolbar select:focus {
  outline: none;
}

.manuals-toolbar input::placeholder {
  color: var(--clr-muted);
}

.manuals-toolbar select {
  appearance: none;
  -webkit-appearance: none;
}


  /* ============================
   📘 PDF Viewer Fix – Professional + Scrollable
=============================== */

#pdf-viewer-wrapper {
  max-height: none;
  height: auto;
  min-height: 600px;
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  overflow: hidden; /* container shouldn't scroll, just the content */
  position: relative;
}

#pdfContainer {
  height: 80vh;
  max-height: 1000px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--radius);
  padding-right: 1rem;
}

/* Ensure PDF pages are full width but scrollable vertically */
#pdfContainer canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
  margin-bottom: 1rem;
}

/* Scrollbar styling */
#pdfContainer::-webkit-scrollbar {
  width: 10px;
}
#pdfContainer::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: 6px;
}

/* Loading Spinner */
#pdf-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* Modal Overlay Background */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* CHANGED from center to flex-start */
  padding: 2rem 1rem 1rem;  /* optional: space around modal */
  overflow-y: auto;
}


/* Modal Viewer Container */
.manual-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  height: 95vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0,0,0,0.2);
  position: relative;
}

/* Inner scrolling for viewer */
#pdf-viewer-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--clr-bg);
  border-top: 1px solid var(--clr-border);
}

/* PDF Canvas */
#pdfContainer canvas {
  width: 100% !important;
  height: auto !important;
  margin-bottom: 1rem;
}

/* Toolbar stays at top */
#pdfToolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: 0.75rem 1rem;
}

/* Spinner */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#acceptorManual .section__title {
  margin-top: 0;
  padding-top: 0;
  font-size: 1.5rem;
  text-align: center;
}

.pdf-page {
  margin-bottom: 1.5rem;
}

.textLayer mark {
  background: yellow;
  color: black;
  font-weight: bold;
}


.match-tag {
  transition: opacity 0.2s ease-in-out;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
#pdfSearchNav button {
  font-weight: bold;
  font-size: 1rem;
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
#pdfSearchNav button:hover {
  color: var(--clr-accent);
}


/* ========== Embedded Manual Container Improvements ========== */
#manualHub {
  background-color: var(--clr-bg, #f9fafb);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-top: 3rem;
}

#manualHub .section__title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

#manualHub .section__subtitle {
  text-align: center;
  color: var(--clr-muted);
  margin-bottom: 2rem;
}

/* Improved Manual Viewer Navigation Buttons */
.manual-card__actions button,
.manual-card__actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.manual-card__actions button:hover,
.manual-card__actions a:hover {
  transform: translateY(-1px);
}

/* Keyboard Focus Accessibility */
.manual-card__btn:focus {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

/* Ensure modal transition feels part of UI */
.modal-overlay {
  animation: fadeIn 0.25s ease-out;
}
.manual-modal {
  animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}


.manual-card__img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  display: block;
}

/* ==========================================================================
   Manuals: Highlight the container bounds
   ========================================================================== */
   .manuals-wrapper {
    border: 2px dashed var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    /* if you want a splash of your primary color instead: */
    margin-bottom: 2rem; /* give a little breathing room below */
  }
  