/* ═══════════════════════════════════════════════════════════════════════
   Test Reports Section + Modal Viewer
   View-only test reports with baked-in watermark
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ── */
.tests-reports-section {
  padding: 80px 0 !important;
  background: #fff;
}

.tests-reports-intro {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}

.tests-reports-intro p {
  color: #556;
  font-size: 16px;
  line-height: 1.6;
  margin-top: 12px;
}

.tests-reports-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 14px;
  background: rgba(26, 122, 122, .08);
  border: 1px solid rgba(26, 122, 122, .18);
  border-radius: 20px;
  color: #0d5252;
  font-size: 13px;
  font-weight: 500;
}

.tests-reports-notice::before {
  content: "🔒";
  font-size: 14px;
}

/* ── Grid & cards ── */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.report-card {
  background: #fff;
  border: 1px solid #e5e9ec;
  border-radius: 14px;
  padding: 22px 20px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-align: start;
  font: inherit;
  color: inherit;
  width: 100%;
}

.report-card:hover,
.report-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -14px rgba(13, 82, 82, .28);
  border-color: rgba(26, 122, 122, .5);
  outline: none;
}

.report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-card-lab {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #1a7a7a;
  text-transform: uppercase;
  background: rgba(26, 122, 122, .08);
  padding: 4px 10px;
  border-radius: 10px;
}

.report-card-pages {
  font-size: 12px;
  color: #778;
  font-weight: 500;
}

.report-card-title {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  color: #0d5252;
  margin: 0;
}

.report-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.report-card-tag {
  font-size: 11px;
  font-weight: 500;
  color: #556;
  background: #f2f5f7;
  padding: 3px 10px;
  border-radius: 8px;
}

.report-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #F07030;
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.report-card-cta::after {
  content: "→";
  transition: transform .18s ease;
}

[dir="rtl"] .report-card-cta::after {
  content: "←";
}

.report-card:hover .report-card-cta::after {
  transform: translateX(3px);
}

[dir="rtl"] .report-card:hover .report-card-cta::after {
  transform: translateX(-3px);
}

/* ── Category group header ── */
.reports-group + .reports-group {
  margin-top: 48px;
}

.reports-group-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: .04em;
  color: #0d5252;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(26, 122, 122, .15);
}

/* ═══════════════════════════════════════════════════════════════════════
   MODAL VIEWER
   ═══════════════════════════════════════════════════════════════════════ */

.report-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 24, 24, .88);
  z-index: 9999;
  display: none;
  flex-direction: column;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.report-modal.is-open {
  display: flex;
}

.report-modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(13, 82, 82, .95);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.report-modal-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-modal-badge {
  display: none;
  padding: 4px 10px;
  background: rgba(255, 255, 255, .12);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (min-width: 640px) {
  .report-modal-badge { display: inline-block; }
}

.report-modal-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: background .15s ease;
}

.report-modal-close:hover,
.report-modal-close:focus-visible {
  background: rgba(240, 112, 48, .8);
  outline: none;
}

/* ── Viewer body (scrollable page list) ── */
.report-modal-viewer {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 16px 48px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.report-modal-pages {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Individual page wrapper — the wrapper holds the img + a transparent
   overlay that intercepts right-click and drag events so the image
   can't be easily saved via the browser context menu. */
.report-page {
  position: relative;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  overflow: hidden;
  aspect-ratio: 210 / 297; /* A4 placeholder while image loads */
}

.report-page img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

/* Transparent overlay on top of the image — intercepts right-click and
   long-press so the browser context menu targets the div (which has no
   image URL) instead of the img. Also blocks drag-and-save. */
.report-page-guard {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: default;
}

.report-page-number {
  position: absolute;
  bottom: 10px;
  right: 12px;
  z-index: 3;
  padding: 3px 10px;
  background: rgba(13, 82, 82, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  pointer-events: none;
}

[dir="rtl"] .report-page-number {
  right: auto;
  left: 12px;
}

/* Loading placeholder */
.report-page-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #778;
  font-size: 13px;
}

/* ── Footer with protection notice ── */
.report-modal-foot {
  flex: 0 0 auto;
  padding: 10px 20px;
  background: rgba(0, 0, 0, .55);
  color: rgba(255, 255, 255, .75);
  font-size: 12px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.report-modal-foot strong {
  color: #fff;
}

/* ── When modal is open, prevent body scroll ── */
body.modal-open {
  overflow: hidden;
}

/* ── Prevent selection inside the modal entirely ── */
.report-modal * {
  -webkit-user-select: none;
  user-select: none;
}
.report-modal-close,
.report-modal-title,
.report-modal-badge,
.report-modal-foot {
  -webkit-user-select: text;
  user-select: text;
}

/* ── Print protection: hide modal completely if user tries to print ── */
@media print {
  .report-modal { display: none !important; }
  .tests-reports-section { display: none !important; }
}

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
  .reports-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .report-card { padding: 18px 16px 16px; }
  .report-modal-head { padding: 10px 12px; gap: 10px; }
  .report-modal-title { font-size: 14px; }
  .report-modal-close { width: 36px; height: 36px; font-size: 20px; }
  .report-modal-viewer { padding: 14px 8px 24px; }
  .report-modal-pages { gap: 12px; }
}
