/* Chart Styles */
/* All styles related to billboard.js charts, chart selectors, and chart components */

/* Chart canvas styles - replaced with billboard.js */

.chart-header {
    text-align: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    margin: 0 0 15px 0;
    color: #37352f;
    font-size: 1.1rem;
    font-weight: 600;
}




/* Chart Type Selector */
.chart-type-selector {
    margin-bottom: 0;
    padding: 0;
    flex: 0 0 auto;
}

.chart-type-buttons {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.chart-type-btn {
    background: #ffffff;
    border: 1px solid #e3e2e0;
    border-radius: 6px;
    padding: 2px;
    font-size: 0.75rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 22px;
    min-height: 22px;
}

.chart-type-btn:hover {
    background: #f0f0f0;
    border-color: #d1d1d1;
    color: #37352f;
}

.chart-type-btn.active {
    background: #37352f;
    color: #ffffff;
    border-color: #37352f;
}

.chart-type-btn .material-icons {
    font-size: 18px;
}

/* Tooltip on hover */
.chart-type-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #37352f;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.chart-type-btn:hover::after {
    opacity: 1;
}

/* Chart Container */
.chart-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.billboard-chart#timerBillboardChartView {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-wrapper .billboard-chart {
    width: 300px;
    height: 300px;
    max-width: 100%;
    text-align: center;
}

.timer-billboard-chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensure chart container can handle different chart types */
.billboard-chart svg {
    max-width: 100%;
    height: auto;
}

/* Ensure proper sizing for radar and gauge charts */
.billboard-chart .bb-chart-radar svg,
.billboard-chart .bb-chart-gauge svg {
    max-width: 100%;
    height: auto;
}

/* Radar Category Items - Precisely matched to Billboard.js legend */
.category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0px;
    line-height: 1;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

/* Shared styles for both visible and hidden category items */
.category-item,
.category-item-hidden {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* Matches Billboard's tile-to-text spacing */
    padding: 2px 6px;
    font-size: 12px;
    /* Matches bb-legend-item */
    font-family: sans-serif;
    /* Matches Billboard default */
    cursor: pointer;
    transition: opacity 0.2s ease;
    user-select: none;
}

/* Opacity for visible items */
.category-item {
    opacity: 1;
}

/* Opacity for hidden items - matches bb-legend-item-hidden */
.category-item-hidden {
    opacity: 0.15;
}

.category-item:hover {
    opacity: 0.8;
}

.category-item-hidden:hover {
    opacity: 0.25;
}

.category-item-color-indicator {
    display: inline-block;
    width: 10px;
    /* Matches bb-legend-item-tile */
    height: 10px;
    /* Matches bb-legend-item-tile */
    border-radius: 0;
    /* Square, not rounded - matches Billboard */
    flex-shrink: 0;
    shape-rendering: crispEdges;
    /* Matches Billboard for sharp edges */
    vertical-align: middle;
}

.category-item-duration {
    color: #555;
    /* Matches Billboard text color */
    font-size: 11px;
}

/* Billboard.js Radar Chart Overrides */
.bb-chart-radars .bb-axis text {
    font-size: 0.9em !important;
    /* Reduced from default 1.15em for better visual balance */
}


/* Billboard.js Tooltip Customization */
.bb-tooltip {
    background: rgba(0, 0, 0, 0.9) !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.bb-tooltip th {
    background: rgba(0, 0, 0, 0.9) !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 12px !important;
}

.bb-tooltip td {
    background: rgba(0, 0, 0, 0.9) !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 12px !important;
}

/* Empty Chart State */
.empty-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
    color: #999;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
    width: 300px;
    max-width: 100%;
}

/* Chart Stats */
.chart-post-legend-footer {
    margin-top: 0;
}

.chart-stats {
    display: grid;
    padding: 4px;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
    position: relative;
    cursor: default;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-item.clickable {
    cursor: pointer;
}

.stat-item.clickable:hover {
    transform: translateY(-2px);
}

.stat-item.clickable:active {
    transform: translateY(0);
}

.stat-value {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 400;
    display: block;
    margin: 1px;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    margin: 1px;
    color: #1f2937;
}

.stat-sub-value {
    font-size: 0.7rem;
    color: #ababab;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px;
}

.stat-icon {
    font-size: 14px;
    vertical-align: middle;
    font-weight: 500;
}

.stat-sub-value-icon {
    font-size: 18px !important;
    vertical-align: middle;
    font-weight: 500;
}

.stat-toggle-icon {
    font-size: 14px;
    vertical-align: middle;
}

.chart-stats-data-range {
    font-size: 0.8rem;
    justify-content: space-between;
    text-align: center;
}