/**
 * Report Page Styles
 * Goodness of Fit Report - Storybook Layout
 * Unit System: rem for typography/spacing/breakpoints, vh/vw for viewport sizing
 */

/* Remove body padding for report page */
body:has(.report-page) {
  padding: 0 !important;
  margin: 0 !important;
}

/* Report Page Container - vh for viewport height */
.report-page {
  min-height: 100vh;
  background: var(--color-secondary-yellow);
  margin: 0;
  padding: 0;
  width: 100%;
}

/* Report Header - extends upward to cover all white space */
.report-header {
  background: linear-gradient(to bottom right, var(--color-primary-blue), var(--color-secondary-blue));
  color: white;
  padding: 0 0 2rem 0;
  margin: -10rem 0 0 0;
  width: 100%;
}

.report-header-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 12rem 1.5rem 0 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.report-header-left {
  flex: 1;
  min-width: 18.75rem;
}

.report-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5rem 0;
  font-family: 'Fraunces', serif;
}

.report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.report-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  border-radius: 62.5rem;
  font-size: 0.75rem;
  border: none;
  font-family: 'Nunito', sans-serif;
  box-shadow: 
    0.25rem 0.25rem 0.75rem rgba(0, 0, 0, 0.25),
    -0.125rem -0.125rem 0.5rem rgba(255, 255, 255, 0.3),
    inset 0.0625rem 0.0625rem 0.1875rem rgba(255, 255, 255, 0.5),
    inset -0.0625rem -0.0625rem 0.125rem rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.report-tag:hover {
  box-shadow: 
    0.3125rem 0.3125rem 0.9375rem rgba(0, 0, 0, 0.3),
    -0.1875rem -0.1875rem 0.625rem rgba(255, 255, 255, 0.4),
    inset 0.0625rem 0.0625rem 0.1875rem rgba(255, 255, 255, 0.6),
    inset -0.0625rem -0.0625rem 0.125rem rgba(0, 0, 0, 0.05);
  transform: translateY(-0.0625rem);
}

.report-header-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.report-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 62.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Nunito', sans-serif;
  border: none;
  box-shadow: 
    0.25rem 0.25rem 0.75rem rgba(0, 0, 0, 0.25),
    -0.125rem -0.125rem 0.5rem rgba(255, 255, 255, 0.3),
    inset 0.0625rem 0.0625rem 0.1875rem rgba(255, 255, 255, 0.5),
    inset -0.0625rem -0.0625rem 0.125rem rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.report-badge:hover {
  box-shadow: 
    0.3125rem 0.3125rem 0.9375rem rgba(0, 0, 0, 0.3),
    -0.1875rem -0.1875rem 0.625rem rgba(255, 255, 255, 0.4),
    inset 0.0625rem 0.0625rem 0.1875rem rgba(255, 255, 255, 0.6),
    inset -0.0625rem -0.0625rem 0.125rem rgba(0, 0, 0, 0.05);
  transform: translateY(-0.0625rem);
}

/* Report Section */
.report-section {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.report-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary-blue);
  margin: 0 0 1rem 0;
  font-family: 'Fraunces', serif;
}

.report-interaction-section {
  padding-bottom: 4rem;
}

/* Report Card */
.report-card {
  border-radius: 1rem;
  border: none;
  box-shadow: 
    0.75rem 0.75rem 1.875rem rgba(0, 0, 0, 0.15),
    -0.375rem -0.375rem 1.25rem rgba(253, 211, 92, 0.4),
    inset 0.125rem 0.125rem 0.375rem rgba(255, 255, 255, 0.5),
    inset -0.125rem -0.125rem 0.25rem rgba(0, 0, 0, 0.03);
  overflow: hidden;
  background: white;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.report-card:hover {
  box-shadow: 
    0.9375rem 0.9375rem 2.1875rem rgba(0, 0, 0, 0.18),
    -0.5rem -0.5rem 1.5625rem rgba(253, 211, 92, 0.5),
    inset 0.125rem 0.125rem 0.375rem rgba(255, 255, 255, 0.6),
    inset -0.125rem -0.125rem 0.25rem rgba(0, 0, 0, 0.03);
  transform: translateY(-0.125rem);
}

.report-card-header {
  padding: 1.25rem 1.5rem 0 1.5rem;
}

.report-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary-blue);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Fraunces', serif;
}

.report-hotspots {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 400;
  font-family: 'Nunito', sans-serif;
}

.report-card-content {
  padding: 1.5rem;
}

/* Profiles Card */
.report-profiles-card {
  background: white;
}

.report-profiles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 48rem) {
  .report-profiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.report-profile-section {
  font-family: 'Nunito', sans-serif;
}

.report-profile-title {
  font-weight: 600;
  color: var(--color-primary-blue);
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
}

.report-profile-text {
  margin: 0;
  color: #1e293b;
  line-height: 1.6;
  font-size: 0.9375rem;
}

/* Trait Grid */
.trait-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 48rem) {
  .trait-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .trait-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Trait Card */
.trait-card {
  padding: 1rem;
  border-radius: 0.75rem;
  background: white;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: 'Nunito', sans-serif;
  box-shadow: 
    0.5rem 0.5rem 1.25rem rgba(0, 0, 0, 0.12),
    -0.25rem -0.25rem 0.9375rem rgba(253, 211, 92, 0.35),
    inset 0.0625rem 0.0625rem 0.1875rem rgba(255, 255, 255, 0.4),
    inset -0.0625rem -0.0625rem 0.125rem rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.trait-card:hover {
  box-shadow: 
    0.625rem 0.625rem 1.5625rem rgba(0, 0, 0, 0.15),
    -0.3125rem -0.3125rem 1.125rem rgba(253, 211, 92, 0.4),
    inset 0.0625rem 0.0625rem 0.1875rem rgba(255, 255, 255, 0.5),
    inset -0.0625rem -0.0625rem 0.125rem rgba(0, 0, 0, 0.02);
  transform: translateY(-0.125rem);
}

.trait-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.trait-name {
  font-weight: 500;
  color: #0f172a;
  font-size: 0.9375rem;
}

.trait-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #475569;
}

.trait-story {
  color: #1e293b;
  margin-top: 0.25rem;
}

.trait-story-item {
  font-size: 0.875rem;
  margin: 0.25rem 0;
  line-height: 1.5;
}

.trait-story-item strong {
  color: var(--color-primary-blue);
  font-weight: 600;
}

/* Report Summary Section */
.report-summary-section {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.report-summary-card {
  background: white;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 48rem) {
  .report-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}

.report-summary-column {
  font-family: 'Nunito', sans-serif;
}

.report-summary-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary-blue);
  margin: 0 0 1rem 0;
  font-family: 'Fraunces', serif;
}

.report-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.report-summary-list li {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #1e293b;
  padding-left: 1.25rem;
  position: relative;
}

.report-summary-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-primary-blue);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.6;
}

/* Report Footer */
.report-footer {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem 1.5rem;
}

.report-footer-content {
  font-size: 0.875rem;
  color: #475569;
  font-family: 'Nunito', sans-serif;
}

.report-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.info-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.report-palette {
  margin-top: 0.5rem;
}

/* Palette Legend */
.palette-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.palette-color {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.palette-name {
  color: #64748b;
}

.palette-hex {
  font-size: 0.75rem;
  opacity: 0.7;
  font-family: monospace;
}

/* Modal Styles - vh/vw for viewport-based sizing */
.report-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
}

.report-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(0.25rem);
}

.report-modal-content {
  position: relative;
  width: 90vw;
  max-width: 80rem;
  height: 90vh;
  margin: 5vh auto;
  background: var(--color-neutral-peach);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1.5625rem 3.125rem -0.75rem rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.report-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.report-modal-close:hover {
  background: white;
}

.report-modal-close svg {
  color: #334155;
}

.report-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* When report is in modal, adjust layout */
.report-modal .report-page {
  min-height: auto;
}

/* Responsive adjustments - rem-based breakpoints */
@media (max-width: 48rem) {
  .report-header {
    margin: 0;
    padding-top: 1rem;
  }

  .report-header-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 0 1.5rem;
  }

  .report-header-right {
    width: 100%;
  }

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

  .report-modal-content {
    width: 95vw;
    height: 95vh;
    margin: 2.5vh auto;
  }
  
  .report-modal-body {
    padding-top: 0;
  }
  
  /* Ensure modal report header starts at the top */
  .report-modal .report-header {
    margin-top: 0;
  }
}

/* Print Styles */
@media print {
  .report-modal {
    display: none;
  }

  .report-modal-close {
    display: none;
  }

  .report-page {
    background: white;
  }

  .report-header {
    background: var(--color-primary-blue);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-section {
    page-break-inside: avoid;
  }

  .trait-card {
    page-break-inside: avoid;
  }
}

