/* Report page layout */
.report-page {
  background: var(--color-bg);
  min-height: 100vh;
}

.report-page .site-header {
  position: relative;
}

/* Report header bar */
.report-header {
  padding: 32px 0 24px;
}

.report-header__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.report-header__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  transition: color 0.2s;
}

.report-header__back:hover {
  color: var(--color-primary);
}

.report-header__back svg {
  width: 16px;
  height: 16px;
}

.report-header__url {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  word-break: break-all;
  margin-bottom: 8px;
}

.report-header__meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.report-header__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.report-header__meta svg {
  width: 14px;
  height: 14px;
}

.report-header__actions {
  flex-shrink: 0;
}

/* SEO Score hero */
.score-hero {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}

.score-ring {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.score-ring svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.score-ring__bg {
  fill: none;
  stroke: #E5E7EB;
  stroke-width: 8;
}

.score-ring__fill {
  fill: none;
  stroke: var(--color-success);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 22.62;
  transition: stroke-dashoffset 1s ease;
}

.score-ring__value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring__number {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.score-ring__max {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.score-hero__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.score-hero__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.score-hero__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.score-hero__subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.score-hero__bar {
  height: 8px;
  background: #E5E7EB;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 8px;
}

.score-hero__bar-fill {
  height: 100%;
  width: 94%;
  background: var(--color-success);
  border-radius: var(--radius-pill);
  transition: width 1s ease;
}

/* Metrics row */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.metrics-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.metrics-panel__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metrics-panel__title svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

/* PageSpeed gauges */
.pagespeed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.pagespeed-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pagespeed-gauge {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.pagespeed-gauge svg {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.pagespeed-gauge__fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.pagespeed-gauge__bg {
  fill: none;
  stroke: #E5E7EB;
  stroke-width: 4;
}

.pagespeed-gauge__fill--green { stroke: var(--color-success); }
.pagespeed-gauge__fill--orange { stroke: var(--color-warning); }
.pagespeed-gauge__fill--red { stroke: var(--color-error); }

.pagespeed-gauge__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  font-weight: 700;
}

.pagespeed-item__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.pagespeed-item__sublabel {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Authority metrics */
.authority-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.authority-card {
  text-align: center;
  padding: 16px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.authority-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.authority-card__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.authority-card__value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

.authority-card__desc {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* SEO checks grid */
.checks-section {
  margin-bottom: 24px;
}

.checks-section__title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.checks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.check-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.check-card--fail {
  border-color: #FECACA;
  background: #FFFBFB;
}

.check-card--pass {
  border-color: #BBF7D0;
  background: #FAFFFE;
}

.check-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.check-card--pass .check-card__icon {
  background: var(--color-success);
  color: #fff;
}

.check-card--fail .check-card__icon {
  background: var(--color-error);
  color: #fff;
}

.check-card__icon svg {
  width: 16px;
  height: 16px;
}

.check-card__body {
  flex: 1;
  min-width: 0;
}

.check-card__label {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.check-card__result {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  word-break: break-word;
}

.check-card--pass .check-card__result {
  color: var(--color-success);
}

.check-card--fail .check-card__result {
  color: var(--color-error);
}

.check-card__hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* H2 accordion */
.h2-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 48px;
  overflow: hidden;
}

.h2-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.h2-section__header:hover {
  background: var(--color-bg);
}

.h2-section__title {
  font-size: 1.0625rem;
  font-weight: 700;
}

.h2-section__chevron {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  transition: transform 0.3s;
}

.h2-section.is-open .h2-section__chevron {
  transform: rotate(180deg);
}

.h2-section__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.h2-section.is-open .h2-section__body {
  max-height: 800px;
}

.h2-list {
  border-top: 1px solid var(--color-border);
}

.h2-list__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
}

.h2-list__item:last-child {
  border-bottom: none;
}

.h2-list__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: 4px;
  flex-shrink: 0;
}

.h2-list__text {
  color: var(--color-text);
  line-height: 1.4;
}

/* Report footer CTA */
.report-cta {
  text-align: center;
  padding: 48px 0 64px;
}

.report-cta__text {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .score-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 32px 24px;
    gap: 24px;
  }

  .score-ring {
    margin: 0 auto;
  }

  .score-hero__title-row {
    justify-content: center;
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .authority-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .checks-grid {
    grid-template-columns: 1fr;
  }

  .pagespeed-grid {
    grid-template-columns: 1fr;
  }

  .report-header__inner {
    flex-direction: column;
  }

  .report-header__actions {
    width: 100%;
  }

  .report-header__actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .score-ring {
    width: 110px;
    height: 110px;
  }

  .score-ring svg {
    width: 110px;
    height: 110px;
  }

  .score-ring__number {
    font-size: 1.75rem;
  }

  .authority-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .h2-section__header,
  .h2-list__item {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Print / PDF */
.print-only {
  display: none;
}

.report-print-brand {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

@media print {
  @page {
    margin: 12mm;
    size: A4;
  }

  body.report-page {
    visibility: hidden;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #report-content {
    visibility: visible;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  #report-content * {
    visibility: visible;
  }

  .no-print,
  .site-header,
  .site-footer,
  .report-cta,
  .nav-toggle {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .report-header {
    padding-top: 0;
  }

  .report-header__url {
    font-size: 1.25rem;
  }

  .score-hero,
  .metrics-panel,
  .check-card,
  .h2-section {
    break-inside: avoid;
    box-shadow: none;
  }

  .score-hero,
  .metrics-panel,
  .check-card {
    border: 1px solid #E5E7EB;
  }

  .metrics-row {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .checks-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .check-card {
    padding: 16px;
  }

  .h2-section__body {
    max-height: none !important;
    overflow: visible !important;
  }

  .h2-section__chevron {
    display: none;
  }

  .pagespeed-gauge__fill,
  .score-ring__fill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .check-card--pass {
    border-color: #BBF7D0;
    background: #FAFFFE;
  }

  .check-card--fail {
    border-color: #FECACA;
    background: #FFFBFB;
  }
}
