/* Heatmap & Detailed Analytics Styles */

.analytics-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Heatmap Matrix - Fluid Responsive */
.heatmap-container {
    overflow-x: auto;
    /* Allow scroll if screen is extremely narrow (<250px), otherwise fits */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
    padding: 2px;
    width: 100%;
    box-sizing: border-box;
}

.heatmap-grid {
    display: grid;
    /* 96 columns. Fixed minimum width of 800px ensures cells are ~8px wide and readable. */
    /* This forces horizontal scroll on mobile but guarantees visibility. */
    grid-template-columns: 50px repeat(96, 1fr);
    min-width: 800px;
    /* Force grid to be wide enough to be legible */
    gap: 1px;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px;
    border-radius: 4px;
    width: 100%;
    /* Will expand beyond 800px if container allows */
}

/* Row Labels */
.heatmap-row-label {
    font-size: 9px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    padding-right: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.heatmap-cell {
    /* Fluid width based on grid */
    height: 12px;
    /* Fixed height for rows is fine */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    /* Hide text unless zoomed/hovered */
    font-weight: 600;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.03);
    cursor: crosshair;
    transition: transform 0.1s;
}

/* Show text/details on hover or scale up */
.heatmap-cell:hover {
    transform: scale(3);
    z-index: 50;
    border: 1px solid #fff;
    font-size: 8px;
    /* Show value */
    border-radius: 2px;
}

/* ... existing colors ... */

/* Axis Labels - align with fluid grid */
.heatmap-x-labels {
    display: flex;
    justify-content: space-between;
    width: calc(100% - 50px);
    /* Fill remaining space after label offset (50px) */
    margin-left: 50px;
    margin-top: 5px;
    color: #94a3b8;
    font-size: 10px;
    padding-right: 5px;
    /* Visual balance */
    box-sizing: border-box;
}

/* Tooltip for Heatmap */
.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 10;
    border: 1px solid white;
}