/**
 * full_report_index.css
 *
 * Styles for FullReportIndex — dual-surface reports index.
 *
 * Surfaces:
 *   1. .full-report__index-sidebar  — sticky sidebar inside full_report.html
 *   2. .reports-index               — flat list inside the CADENCE Reports panel
 *
 * WP06 | Mission: graph-navigation-and-consumption-refinements-01KRNT9R
 * Wiring (<link> tag) is WP07's responsibility.
 */

/* =========================================================================
   1. SIDEBAR — full_report.html
   ========================================================================= */

.full-report__index-sidebar {
  position: sticky;
  top: 0;
  right: 0;
  width: 260px;
  min-width: 200px;
  max-height: 100vh;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  background: #f8f9fa;
  border-left: 1px solid #dee2e6;
  font-size: 0.875rem;
  line-height: 1.4;
  box-sizing: border-box;
}

.full-report__index-sidebar h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Entry (one draft key) */
.full-report__index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.full-report__index-entry {
  margin-bottom: 1rem;
}

.full-report__index-entry-head {
  margin-bottom: 0.25rem;
}

.full-report__index-period {
  font-weight: 600;
  color: #343a40;
  font-size: 0.8rem;
}

/* Versions sub-list */
.full-report__index-versions {
  list-style: none;
  margin: 0;
  padding-left: 0.5rem;
}

.full-report__index-version {
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.12s ease;
}

.full-report__index-version:hover {
  background-color: #e9ecef;
}

/* Currently-loaded version highlight */
.full-report__index-version.is-current {
  background-color: #e7f3ff;
  border-left: 3px solid #0d6efd;
  padding-left: 0.375rem;
}

.full-report__index-version-link {
  display: block;
  color: #0d6efd;
  text-decoration: none;
  font-size: 0.8rem;
  word-break: break-word;
  overflow-wrap: break-word;
  margin-bottom: 0.125rem;
}

.full-report__index-version-link:hover {
  text-decoration: underline;
}

.full-report__index-version.is-current .full-report__index-version-link {
  color: #084298;
  font-weight: 500;
}

.full-report__index-meta {
  display: block;
  color: #6c757d;
  font-size: 0.75rem;
  margin-bottom: 0.125rem;
}

.full-report__index-download {
  font-size: 0.75rem;
  padding: 0.1rem 0.375rem;
  border: 1px solid #ced4da;
  border-radius: 3px;
  background: #fff;
  color: #495057;
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}

.full-report__index-download:hover {
  background-color: #e2e6ea;
  border-color: #adb5bd;
}

.full-report__index-download:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty state — sidebar */
.full-report__index-sidebar .full-report__index-empty-state {
  color: #6c757d;
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.5rem 0;
}

/* PDF embed injected by the inline load handler */
.full-report__index-embed {
  display: block;
  width: 100%;
  height: 80vh;
  border: none;
  margin-top: 0.5rem;
}

/* =========================================================================
   2. REPORTS PANEL FLAT LIST — .reports-index
   ========================================================================= */

.reports-index {
  width: 100%;
}

.reports-index__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reports-index__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.1s ease;
}

.reports-index__row:last-child {
  border-bottom: none;
}

.reports-index__row:hover {
  background-color: #f8f9fa;
}

.reports-index__name {
  flex: 1 1 auto;
  color: #0d6efd;
  text-decoration: none;
  font-size: 0.875rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.reports-index__name:hover {
  text-decoration: underline;
}

.reports-index__meta {
  flex: 0 0 auto;
  color: #6c757d;
  font-size: 0.8rem;
  white-space: nowrap;
}

.reports-index__row button[data-action="download-version"] {
  flex: 0 0 auto;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 3px;
  background: #fff;
  color: #495057;
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease;
  white-space: nowrap;
}

.reports-index__row button[data-action="download-version"]:hover {
  background-color: #e2e6ea;
  border-color: #adb5bd;
}

.reports-index__row button[data-action="download-version"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty state — reports panel */
.reports-index .full-report__index-empty-state {
  color: #6c757d;
  font-size: 0.875rem;
  font-style: italic;
  padding: 1rem 0.75rem;
}

/* =========================================================================
   3. PRINT / EXPORT — hide the sidebar
   ========================================================================= */

@media print {
  .full-report__index-sidebar {
    display: none !important;
  }
}

body.exporting .full-report__index-sidebar {
  display: none !important;
}
