.heatmap-container {
    margin: 30px 0;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.heatmap {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.month-labels {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 40px;
    padding-top: 0;
    justify-content: flex-start;
}

.heatmap-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: fit-content;
    align-items: center;
    justify-content: flex-start;
}

.heatmap-cell {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background-color: #f6f8fa;
    border: 1px solid #f6f8fa;
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    position: relative;
}

.heatmap-cell.level-1 {
    background-color: #d0ebff;
    border-color: #d0ebff;
}

.heatmap-cell.level-2 {
    background-color: #74c0fc;
    border-color: #74c0fc;
}

.heatmap-cell.level-3 {
    background-color: #1971c2;
    border-color: #1971c2;
}

.heatmap-cell.level-4 {
    background-color: #0c4a6e;
    border-color: #0c4a6e;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #586069;
    justify-content: center;
}

.heatmap-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.heatmap-legend-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid #e1e4e8;
}

.heatmap-title {
    font-size: 16px;
    font-weight: 600;
    color: #24292e;
    margin-bottom: 16px;
    text-align: center;
}

.year-label {
    font-size: 11px;
    color: #586069;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
    height: 16px;
    line-height: 16px;
}

.year-count {
    font-size: 10px;
    color: #586069;
    text-align: center;
    margin-top: 2px;
    font-weight: 400;
    height: 14px;
    line-height: 14px;
}

.book-link:hover {
    background: linear-gradient(to bottom, transparent 50%, #8bbae5 50%) !important;
}

.book-tooltip {
    position: fixed;
    background: #24292e;
    color: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.tooltip-header {
    font-weight: 600;
    margin-bottom: 8px;
    color: #f6f8fa;
    border-bottom: 1px solid #586069;
    padding-bottom: 4px;
}

.tooltip-content {
    max-height: 200px;
    overflow-y: auto;
}

.tooltip-book {
    margin: 2px 0;
    line-height: 1.4;
    color: #e1e4e8;
}

@media (max-width: 768px) {
    .heatmap-container {
        padding: 16px;
        margin: 20px 0;
    }

    .heatmap-cell {
        width: 14px;
        height: 14px;
    }

    .month-labels div {
        height: 14px !important;
        line-height: 14px !important;
        font-size: 9px !important;
    }

    .heatmap-legend {
        flex-direction: row;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
}
