.reading-session-heatmap-container {
  width: 100%;
}

.chart-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 1rem;

  .chart-title {
    h3 {
      color: var(--text-color, #ffffff);
      font-size: 1.25rem;
      font-weight: 500;
      margin: 0 0 0.5rem 0;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .chart-description {
      color: var(--text-secondary-color);
      font-size: 0.9rem;
      margin: 0;
      line-height: 1.4;
    }
  }

  .year-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: center;

    .year-nav-btn {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 6px;
      padding: 0.6rem 0.6rem;
      color: #ffffff;
      cursor: pointer;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;

      &:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
      }

      &:active {
        transform: translateY(0);
      }

      i {
        font-size: 0.875rem;
      }
    }

    .current-year {
      font-size: 1.125rem;
      font-weight: 600;
      color: #ffffff;
      min-width: 4.5rem;
      text-align: center;
    }
  }

  .header-spacer {
    // Empty spacer for grid layout balance
  }
}

.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 200px;
  height: 200px;

  canvas {
    width: 100% !important;
    height: auto !important;
  }
}

.heatmap-title-icon {
  font-size: 1.5rem;
  color: rgba(59, 130, 246, 1);
  vertical-align: middle;
  margin-right: 0.25em;
}

.chart-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;

  &.right {
    justify-content: flex-end;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  color: var(--text-color, #ffffff);
  font-weight: 500;
  white-space: nowrap;

  .pill-value {
    font-weight: 700;
  }

  &.current .pill-value { color: #ff9800; }
  &.longest .pill-value { color: #4caf50; }
  &.total .pill-value { color: #2196f3; }
  &.consistency .pill-value { color: #9c27b0; }

  &.milestone.unlocked {
    border-color: rgba(76, 175, 80, 0.3);
    background: rgba(76, 175, 80, 0.1);
  }

  &.milestone.locked {
    opacity: 0.4;
  }
}

@media (max-width: 768px) {
  .chart-header {
    grid-template-columns: 1fr;
    gap: 0.75rem;

    .chart-title {
      h3 {
        font-size: 1.1rem;
      }

      .chart-description {
        font-size: 0.85rem;
      }
    }

    .year-selector {
      justify-self: stretch;
      justify-content: center;
    }

    .header-spacer {
      display: none;
    }
  }

  .chart-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .chart-header {
    .chart-title {
      h3 {
        font-size: 1rem;
      }

      .chart-description {
        font-size: 0.8rem;
      }
    }
  }

  .year-selector {
    .current-year {
      font-size: 1rem;
      min-width: 4rem;
    }

    .year-nav-btn {
      padding: 0.6rem 0.6rem;
    }
  }
}
