/**
 * Chart styling for SoftCopy visualizations
 */

/* Charts container */
.charts-container {
    padding: 1rem 0;
}

.chart-section {
    margin-bottom: 3rem;
}

.chart-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.chart-section canvas {
    max-width: 100%;
    height: auto;
    max-height: 400px;
}

/* Tag cloud styling */
#tag-cloud {
    padding: 2rem;
    text-align: center;
    line-height: 2;
}

#tag-cloud.tag-cloud-rendered .tag {
    display: inline-block;
    margin: 0.25rem 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(54, 162, 235, 0.1);
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: default;
}

#tag-cloud.tag-cloud-rendered .tag:hover {
    background: rgba(54, 162, 235, 0.2);
    transform: scale(1.05);
}

/* Calendar heatmap styling */
.heatmap {
    margin: 2rem 0;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--md-default-fg-color--light);
}

.legend-scale {
    display: flex;
    gap: 2px;
}

.legend-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--md-default-fg-color--lightest);
}

.legend-cell[data-level="0"] {
    background: var(--md-default-fg-color--lightest);
}

.legend-cell[data-level="1"] {
    background: rgba(54, 162, 235, 0.3);
}

.legend-cell[data-level="2"] {
    background: rgba(54, 162, 235, 0.5);
}

.legend-cell[data-level="3"] {
    background: rgba(54, 162, 235, 0.7);
}

.legend-cell[data-level="4"] {
    background: rgba(54, 162, 235, 1);
}

.heatmap-grid {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding: 1rem 0;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.heatmap-day {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--md-default-fg-color--lightest);
    cursor: pointer;
    transition: all 0.2s ease;
}

.heatmap-day.empty {
    background: transparent;
    cursor: default;
}

.heatmap-day[data-level="0"] {
    background: var(--md-default-fg-color--lightest);
}

.heatmap-day[data-level="1"] {
    background: rgba(54, 162, 235, 0.3);
}

.heatmap-day[data-level="2"] {
    background: rgba(54, 162, 235, 0.5);
}

.heatmap-day[data-level="3"] {
    background: rgba(54, 162, 235, 0.7);
}

.heatmap-day[data-level="4"] {
    background: rgba(54, 162, 235, 1);
}

.heatmap-day:not(.empty):hover {
    transform: scale(1.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.heatmap-tooltip {
    position: fixed;
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    transform: translate(-50%, -100%);
    white-space: nowrap;
    z-index: 1000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chart-section canvas {
        max-height: 300px;
    }
    
    #tag-cloud {
        padding: 1rem;
    }
    
    .heatmap-day {
        width: 10px;
        height: 10px;
    }
    
    .legend-cell {
        width: 10px;
        height: 10px;
    }
}

/* Dark mode adjustments */
[data-md-color-scheme="slate"] .heatmap-day[data-level="0"],
[data-md-color-scheme="slate"] .legend-cell[data-level="0"] {
    background: rgba(255, 255, 255, 0.1);
}

[data-md-color-scheme="slate"] #tag-cloud.tag-cloud-rendered .tag {
    background: rgba(54, 162, 235, 0.2);
}

[data-md-color-scheme="slate"] #tag-cloud.tag-cloud-rendered .tag:hover {
    background: rgba(54, 162, 235, 0.3);
}
