/* 出勤ヒートマップ */
.heatmap-scroll {
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.heatmap-scroll::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.heatmap-container {
  display: inline-block;
  min-width: fit-content;
}

.heatmap-month-row {
  display: grid;
  column-gap: 2px;
  margin-bottom: 4px;
}

.heatmap-month-corner {
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: #F9FAFB;
}

.heatmap-month-label {
  font-size: 11px;
  color: #6B7280;
  overflow: hidden;
  white-space: nowrap;
}

.heatmap-grid {
  display: grid;
  gap: 2px;
}

.heatmap-day-label {
  font-size: 11px;
  color: #6B7280;
  height: 12px;
  line-height: 12px;
  text-align: right;
  padding-right: 4px;
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: #F9FAFB;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  cursor: default;
}

.heatmap-cell-empty {
  background-color: #E5E7EB;
}

.heatmap-cell-future {
  opacity: 0.4;
}

.heatmap-cell-light {
  background-color: #FBCFE8;
}

.heatmap-cell-medium {
  background-color: #F472B6;
}

.heatmap-cell-dark {
  background-color: #DB2777;
}

.heatmap-cell-noshow {
  background: repeating-linear-gradient(
    45deg,
    #D97706, #D97706 2px,
    #FDE68A 2px, #FDE68A 4px
  );
}

/* ツールチップ */
.heatmap-tooltip {
  position: absolute;
  background: #374151;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: pre-line;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* レスポンシブ対応 */
@media (prefers-reduced-motion: reduce) {
  .heatmap-tooltip {
    transition: none;
  }
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
  .heatmap-tooltip {
    background: #000000;
    border: 1px solid #ffffff;
  }

  .heatmap-cell-empty {
    background-color: #D1D5DB;
    border: 1px solid #9CA3AF;
  }

  .heatmap-cell-light {
    background-color: #F9A8D4;
    border: 1px solid #EC4899;
  }

  .heatmap-cell-medium {
    background-color: #EC4899;
    border: 1px solid #BE185D;
  }

  .heatmap-cell-dark {
    background-color: #BE185D;
    border: 1px solid #831843;
  }

  .heatmap-cell-noshow {
    background: repeating-linear-gradient(
      45deg,
      #B45309, #B45309 2px,
      #FDE68A 2px, #FDE68A 4px
    );
    border: 1px solid #92400E;
  }
}
