/* css/analytics.css */

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

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f9f9f9;
  color: #1c1c1c;
  line-height: 1.6;
}

/* Page shell */
.analytics-shell {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 12px;
}

/* Page title area */
.analytics-page-header {
  margin-bottom: 20px;
}

.analytics-page-title {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.analytics-page-subtitle {
  font-size: 14px;
  color: #6b7280;
}

/* Card-like container (visual cousin of bill .card) */
.analytics-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  padding: 22px 24px;
  margin-bottom: 20px;
}

/* Layout: grid for multi-card sections */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 800px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* Section headings (parallel to .card-title-label) */
.analytics-section-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.analytics-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 10px;
}

/* Small meta text row */
.analytics-meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 10px;
}

/* Paragraphs / lead text */
.analytics-text {
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
}

/* Simple key-value list */
.analytics-kv-list {
  list-style: none;
  padding-left: 0;
  font-size: 14px;
  color: #111827;
}

.analytics-kv-list li {
  margin-bottom: 6px;
}

/* Chart wrapper */
.analytics-chart-box {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  padding: 10px;
  text-align: center;
}

.analytics-chart-box img {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}



/* Filters row */
.analytics-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.analytics-filters label {
  font-size: 13px;
  color: #374151;
}

.analytics-filters select {
  padding: 5px 8px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
}

/* Link cards from analytics index */
.analytics-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

@media (max-width: 800px) {
  .analytics-link-grid {
    grid-template-columns: 1fr;
  }
}

.analytics-link-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 18px 20px;
  border: 1px solid #e5e7eb;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.analytics-link-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.09);
  border-color: #d1d5db;
}

.analytics-link-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #111827;
}

.analytics-link-desc {
  font-size: 14px;
  color: #4b5563;
}

/* Simple stat badges */
.analytics-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.analytics-stat {
  padding: 6px 10px;
  border-radius: 9999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 12px;
  color: #1d4ed8;
  white-space: nowrap;
}

/* Tables for vote / ranked lists */
.analytics-table-wrapper {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  background: #ffffff;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analytics-table thead {
  background: #f3f4f6;
}

.analytics-table th,
.analytics-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.analytics-table th {
  font-weight: 600;
  color: #374151;
}

.analytics-table tr:last-child td {
  border-bottom: none;
}

.analytics-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Small pill links to details (bills, legislators, committees) */
.analytics-pill-link {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  text-decoration: none;
}

.analytics-pill-link:hover {
  background: #e5e7eb;
}

/* Mobile spacing */
@media (max-width: 600px) {
  .analytics-shell {
    margin: 20px auto;
  }

  .analytics-card {
    padding: 18px;
  }

  .analytics-page-title {
    font-size: 22px;
  }
}
/* Make CHART CARDS span full width of the grid on desktop */
@media (min-width: 900px) {
  .analytics-card:has(.analytics-chart-box) {
    grid-column: 1 / -1;
  }
}
.chart-wrapper {
    position: relative;
    display: inline-block;
}

.chart-download {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.85);
    border: 1px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    z-index: 3;
}

.chart-download:hover {
    background: #ffffff;
    border-color: #9ca3af;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.chart-download i {
    font-size: 15px;
    color: #374151;
    pointer-events: none;
}
/* Mobile: tighten the download icon into the top-right corner */
@media (max-width: 600px) {
    .chart-download {
        top: 4px;
        right: 4px;
        width: 28px;
        height: 28px;
    }

    .chart-download i {
        font-size: 13px;
    }
}

/* Group menu */
.analytics-group-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.analytics-group-tab {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 9999px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    cursor: pointer;
    color: #374151;
    user-select: none;
    transition: background 0.12s, border-color 0.12s;
}

.analytics-group-tab:hover {
    background: #e5e7eb;
}

.analytics-group-tab.active {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

/* Group content areas */
.analytics-group {
    display: none;
}

.analytics-group.active {
    display: block;
}


