/* AI Radar AWS - Main Stylesheet */
/* AWS-inspired color scheme: orange accents on dark/light backgrounds */

:root {
  --aws-orange: #ff9900;
  --aws-orange-dark: #ec7211;
  --aws-dark: #232f3e;
  --aws-dark-secondary: #37475a;
  --aws-light: #f5f7fa;
  --aws-white: #ffffff;
  --aws-text: #16191f;
  --aws-text-secondary: #545b64;
  --aws-border: #d5dbdb;
  --aws-success: #1d8102;
  --aws-warning: #ff9900;
  --aws-error: #d13212;
  --star-1: #9e9e9e;
  --star-2: #2476F9;
  --star-3: #24F93D;
  --star-4: #f9a825;
  --star-5: #f924e1;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--aws-light);
  color: var(--aws-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.site-header {
  background: var(--aws-dark);
  color: var(--aws-white);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--aws-white);
}

.logo-icon-img {
  height: 36px;
  width: auto;
  border-radius: 4px;
}

.site-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.site-logo h1 span {
  color: var(--aws-orange);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.tagline {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  letter-spacing: 0.3px;
  margin-top: -2px;
}

.about-tagline {
  font-size: 0.9rem;
  color: var(--aws-text-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.header-nav a {
  color: var(--aws-white);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
  transition: var(--transition);
}

.header-nav a:hover {
  opacity: 1;
  color: var(--aws-orange);
}

/* Main Content */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Filters Section */
.filters-section {
  background: var(--aws-white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.filters-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--aws-dark);
}

.filters-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sort-select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--aws-border);
  border-radius: 4px;
  font-size: 0.8rem;
  background: var(--aws-white);
  color: var(--aws-text);
  cursor: pointer;
}

.filter-reset {
  padding: 0.35rem 0.75rem;
  background: var(--aws-dark-secondary);
  color: var(--aws-white);
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-reset:hover {
  background: var(--aws-dark);
}

.filter-dimension {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--aws-light);
}

.filter-dimension:first-of-type {
  border-top: none;
}

.dimension-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--aws-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 65px;
  padding-top: 0.3rem;
}

.dimension-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.filter-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--aws-border);
  background: var(--aws-white);
  color: var(--aws-text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--aws-orange);
  color: var(--aws-orange-dark);
}

.filter-chip.active {
  background: var(--aws-orange);
  color: var(--aws-white);
  border-color: var(--aws-orange);
}

.filter-chip .chip-count {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 0.2rem;
}

.filter-dimension-collapsed {
  border-top: 1px solid var(--aws-light);
  padding: 0.5rem 0;
}

.show-more-btn {
  font-size: 0.8rem;
  color: var(--aws-orange-dark);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  font-weight: 500;
}

.show-more-btn:hover {
  color: var(--aws-orange);
}

.more-filters-content {
  width: 100%;
}

.filter-dimension-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.active-filters {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--aws-light);
  margin-top: 0.25rem;
}

.active-filters-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.active-filter-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  background: var(--aws-orange);
  color: var(--aws-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.active-filter-chip:hover {
  background: var(--aws-orange-dark);
}

.active-filter-chip .remove-x {
  font-weight: bold;
  font-size: 0.85rem;
  line-height: 1;
}

/* Timeline Section */
.timeline-section {
  background: var(--aws-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.timeline-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--aws-dark);
}

.timeline-chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

/* Announcement Cards */
.announcements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.announcement-card {
  background: var(--aws-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-left: 4px solid var(--aws-border);
  display: flex;
  flex-direction: column;
}

.announcement-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.announcement-card[data-importance="5"] {
  border-left-color: var(--star-5);
}

.announcement-card[data-importance="4"] {
  border-left-color: var(--star-4);
}

.announcement-card[data-importance="3"] {
  border-left-color: var(--star-3);
}

.announcement-card[data-importance="2"] {
  border-left-color: var(--star-2);
}

.announcement-card[data-importance="1"] {
  border-left-color: var(--star-1);
}

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

.card-stars {
  font-size: 1rem;
}

.importance-5 { color: var(--star-5); }
.importance-4 { color: var(--star-4); }
.importance-3 { color: var(--star-3); }
.importance-2 { color: var(--star-2); }
.importance-1 { color: var(--star-1); }

.card-date {
  font-size: 0.8rem;
  color: var(--aws-text-secondary);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-title a {
  color: var(--aws-text);
  text-decoration: none;
  transition: var(--transition);
}

.card-title a:hover {
  color: var(--aws-orange-dark);
}

.card-summary {
  font-size: 0.875rem;
  color: var(--aws-text-secondary);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-link {
  font-size: 0.85rem;
  color: var(--aws-orange-dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.card-link:hover {
  color: var(--aws-orange);
}

/* Card Footer (link + geo badge) */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
}

/* Geo Relevance Badge */
.geo-badges {
  display: flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.geo-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.geo-local, .geo-region {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.geo-global {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

/* Tag Chips */
.card-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.5rem 0; }
.tag { font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 12px; font-weight: 500; cursor: pointer; transition: var(--transition); }
.tag:hover { opacity: 0.8; }
.tag-service { background: #e3f2fd; color: #1565c0; }
.tag-type { background: #f3e5f5; color: #7b1fa2; }
.tag-concept { background: #e8f5e9; color: #2e7d32; }
.tag-usecase { background: #fff3e0; color: #e65100; }
.tag-provider { background: #fce4ec; color: #c62828; }

/* Tag Filter - kept for card tag chips */

/* Report Tags Section */
.report-tags-section .report-tags-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.report-tag-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.tag-group-label { font-size: 0.75rem; font-weight: 600; color: var(--aws-text-secondary); text-transform: uppercase; letter-spacing: 0.5px; min-width: 70px; }

/* Report Page */
.report-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.report-header {
  background: var(--aws-white);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--aws-orange);
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.report-meta .stars {
  font-size: 1.2rem;
}

.report-meta .date {
  font-size: 0.9rem;
  color: var(--aws-text-secondary);
}


.report-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.6rem;
  color: var(--aws-dark);
}

.report-subtitle {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--aws-text-secondary);
  margin-bottom: 1rem;
  max-width: 60ch;
}

.report-source-link {
  font-size: 0.85rem;
  color: var(--aws-orange-dark);
  text-decoration: none;
}

.report-source-link:hover {
  text-decoration: underline;
}

.report-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-pdf {
  padding: 0.5rem 1rem;
  background: var(--aws-orange);
  color: var(--aws-white);
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pdf:hover {
  background: var(--aws-orange-dark);
}

.report-section {
  background: var(--aws-white);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.report-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--aws-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--aws-light);
}

.report-section p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--aws-text);
}

.report-section code, .card-summary code {
  background: var(--aws-light);
  border: 1px solid var(--aws-border);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--aws-dark);
}

.mermaid-section .mermaid {
  background: var(--aws-light);
  padding: 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
}

.blogpost-links {
  list-style: none;
  padding: 0;
}

.blogpost-links li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--aws-light);
}

.blogpost-links li:last-child {
  border-bottom: none;
}

.blogpost-links a {
  color: var(--aws-orange-dark);
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-all;
}

.blogpost-links a:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--aws-orange-dark);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.back-link:hover {
  color: var(--aws-orange);
}

/* Footer */
.site-footer {
  background: var(--aws-dark);
  color: var(--aws-white);
  text-align: center;
  padding: 1.5rem;
  margin-top: 3rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* No results */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--aws-text-secondary);
  font-size: 1rem;
  display: none;
}

/* Report section lists (I1) */
.report-section ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.report-section ul li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--aws-text);
}

.report-section ul li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--aws-orange);
  font-size: 0.85rem;
  top: 0.5rem;
}

.report-section ul li + li {
  border-top: 1px solid var(--aws-light);
}

/* About Modal (I2) */
.about-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.about-modal-overlay.active {
  display: flex;
}

.about-modal {
  background: var(--aws-white);
  border-radius: var(--radius);
  max-width: 640px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.about-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--aws-text-secondary);
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
}

.about-modal-close:hover {
  background: var(--aws-light);
  color: var(--aws-text);
}

.about-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.about-logo {
  height: 80px;
  width: auto;
  border-radius: 8px;
}

.about-modal h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--aws-dark);
  margin-bottom: 0;
}

.about-modal h2 span {
  color: var(--aws-orange);
}

.about-modal h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--aws-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.about-modal p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--aws-text);
  margin-bottom: 1rem;
}

.about-modal ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.about-modal ol li {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--aws-text);
  padding: 0.2rem 0;
}

.about-modal ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.about-modal ul li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--aws-text);
  padding: 0.15rem 0;
}

.about-tabs {
  display: flex;
  border-bottom: 2px solid var(--aws-border);
  margin-bottom: 1.25rem;
  gap: 0;
}

.about-tab {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--aws-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.about-tab:hover { color: var(--aws-orange-dark); }
.about-tab.active { color: var(--aws-orange); border-bottom-color: var(--aws-orange); }

.about-tab-content { display: none; }
.about-tab-content.active { display: block; }

.scoring-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.scoring-table th, .scoring-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--aws-border);
}

.scoring-table th { background: var(--aws-light); font-weight: 600; color: var(--aws-dark); }
.scoring-table .pts-pos { color: #2e7d32; font-weight: 600; }
.scoring-table .pts-neg { color: #d13212; font-weight: 600; }

.geo-legend {
  display: flex;
  gap: 1.5rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.geo-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.star-scale {
  display: flex;
  gap: 0.4rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.star-scale-item {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  background: var(--aws-light);
}

.about-modal .highlight-box {
  background: var(--aws-light);
  border-left: 3px solid var(--aws-orange);
  padding: 0.75rem 1rem;
  border-radius: 0 4px 4px 0;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: var(--aws-text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .announcements-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-nav a {
    margin-left: 1rem;
    font-size: 0.8rem;
  }

  .main-content {
    padding: 1rem;
  }

  .filters-section {
    padding: 1rem;
  }

  .filter-dimension {
    flex-direction: column;
    gap: 0.25rem;
  }

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

  .timeline-chart-container {
    height: 200px;
  }

  .report-container {
    padding: 1rem;
  }

  .report-header {
    padding: 1.5rem;
  }

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

  .report-section {
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .site-logo h1 {
    font-size: 1.1rem;
  }

  .report-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

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

/* =========================================================================
   Print / PDF export (browser-native "Save as PDF")
   Produces a real, text-based (selectable, copyable) vector PDF with
   correct fonts, aligned clickable links, and clean page breaks.
   ========================================================================= */
@page {
  size: A4;
  margin: 15mm;
}

@media print {
  /* Reset backgrounds/colors so the printed page is clean and legible */
  html, body {
    background: #ffffff !important;
    color: #1a1a1a !important;
  }

  /* Ensure background colors/inline highlights that matter are preserved */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide all non-report chrome */
  .site-header,
  .site-footer,
  .header-nav,
  .back-link,
  .report-actions,
  .about-modal-overlay,
  .report-source-link {
    display: none !important;
  }

  /* Let the report use the full printable width */
  .report-container,
  .report-content,
  #report-content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  /* Avoid slicing content across page boundaries */
  .report-section,
  .mermaid-section,
  .report-tag-group,
  .blogpost-links li,
  li {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Keep headings attached to the content that follows them */
  h1, h2, h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .report-title {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Make the Mermaid visual summary fill its section and stay crisp (vector) */
  .mermaid-section .mermaid {
    background: #f7f8fa !important;
    overflow: visible !important;
    text-align: center;
  }

  .mermaid-section .mermaid svg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Keep links visible and readable in print (they remain clickable) */
  a {
    color: #b45f06 !important;
    text-decoration: none;
  }
}
