/* Market Insider Chart Styles */

/* Score Cards */
.score-cards-container {
    height: 280px;
    max-height: 280px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
    background-color: var(--light-gray);
    padding: 30px 0;
    border-radius: 2px;
}

.score-card {
    flex: 1;
    text-align: center;
    padding: 10px;
}

.score-icon-container {
    margin-bottom: 10px;
}

.score-icon {
    font-size: 36px;
    color: #5c5c5c;
}

.score-label {
    font-family: var(--font-primary), sans-serif;
    font-size: 17px;
    font-weight: 100;
    padding: 5px 0;
    color: #333;
}

.score-chart-container {
    position: relative;
    width: 112px;
    height: 112px;
    margin: 0 auto;
    transition: opacity 0.3s ease;
}

.score-chart-container.loading {
    opacity: 0.7;
    position: relative;
}

.score-chart-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

/* Market Trends Header */
.market-trends-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 15px;
}

.market-trends-title-flex {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
}

.market-trends-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Chart Containers */
.chart-title-container {
    display: flex;
    margin-top: 2rem;
    align-items: center;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

.chart-title-line {
    flex-grow: 1;
    height: 2px;
    background-color: #c5c5c5;
    margin-left: 9rem;
}

/* Chart Legend */
.chart-legend-container {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding-top: 5px;
    padding-bottom: 10px;
    margin-right: 20px;
}

.chart-legend {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.legend-item span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em !important;
    font-weight: 640;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    top: -2px;
}

/* Chart Specific */
.market-trends-chart-container {
    display: block;
    min-height: 280px;
    margin: 0 0 20px 0;
    width: 100%;
    position: relative;
}

.market-trends-chart-container canvas {
    width: 100% !important;
    height: 300px !important;
}

#marketTrendsChart {
    width: 100%;
    min-height: 240px;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
}

.chart-header {
    margin-top: 20px;
}

/* Trend Year Selector */
.trend-years-flex {
    display: flex;
    margin-left: 28px;
    align-self: flex-end;
}

.trend-year {
    cursor: pointer;
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0 1rem;
    position: relative;
    border-bottom: none;
    line-height: 1.3;
}

.trend-year.active {
    font-weight: bold;
}

.trend-year.active::after {
    content: '';
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: .03rem;
    height: 2px;
    background-color: var(--primary-color);
}

/* Score Cards */
.score-cards-container {
    height: 280px;
    max-height: 280px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
    background-color: var(--light-gray);
    padding: 30px 0;
    border-radius: 2px;
}

.score-card {
    flex: 1;
    text-align: center;
    padding: 10px;
}

.score-icon-container {
    margin-bottom: 10px;
}

.score-icon {
    font-size: 36px;
    color: #5c5c5c;
}

.score-label {
    font-family: var(--font-primary), sans-serif;
    font-size: 17px;
    font-weight: 100;
    padding: 5px 0;
    color: #333;
}

.score-chart-container {
    position: relative;
    width: 112px;
    height: 112px;
    margin: 0 auto;
    transition: opacity 0.3s ease;
}

.score-chart-container.loading {
    opacity: 0.7;
    position: relative;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
