/* Stock Chart Component Styles */
.stock-chart-container {
    max-width: 100%;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.price-section {
    margin-bottom: 24px;
    text-align: left;
}

.current-prices-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.price-block {
    display: flex;
    align-items: center;
    gap: 10px;
}
.price-label {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.price-value {
    font-size: 30px;
    font-weight: 600;
    color: #223F82;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.price-value.cdi-red {
    color: #c5221f;
}
.price-divider {
    width: 1px;
    height: 24px;
    background-color: #e2e8f0;
}
.price-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    flex-wrap: wrap;
}
@media (max-width: 768px) {
    .current-prices-row {
        gap: 12px;
    }
    .price-value {
        font-size: 24px;
    }
    .price-block {
        gap: 6px;
    }
}

.change-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.change-badge.positive {
    background-color: #e6f4ea;
    color: #137333;
}

.change-badge.negative {
    background-color: #fce8e6;
    color: #c5221f;
}

.change-value {
    font-weight: 600;
    white-space: nowrap;
}

.change-value.positive {
    color: #137333;
}

.change-value.negative {
    color: #c5221f;
}

.period-label {
    color: #52525b;
    font-size: 14px;
    font-weight: 500;
    white-space: normal;
}

.price-meta {
    color: #52525b;
    font-size: 12px;
    margin-top: 6px;
}

.disclaimer-link {
    cursor: pointer;
    text-decoration: underline;
}

.disclaimer-link:hover {
    color: #223F82;
}

.period-tabs {
    display: flex;
    gap: 4px;
    margin: 20px 0 16px;
    border-bottom: 1px solid #4b5563;
    padding-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
}

.period-tabs::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.period-tab {
    background: none;
    border: none;
    color: #52525b;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    transition: color 0.2s;
    white-space: nowrap;
    outline: none;
}

.period-tab:hover {
    color: #1a202c;
}

.period-tab:focus {
    outline: none;
}

.period-tab.active {
    color: #223F82;
}

.period-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #223F82;
    border-radius: 3px 3px 0 0;
}

.chart-container {
    position: relative;
    height: 320px;
    margin-bottom: 20px;
    width: 100%;
}

.chart-canvas {
    width: 100%;
    height: 100%;
    touch-action: pan-y;
}

.chart-tooltip {
    position: absolute;
    background: #202124;
    border: 1px solid #3c4043;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.chart-tooltip.visible {
    opacity: 1;
}

.tooltip-price {
    font-weight: 500;
    color: #e8eaed;
}

.tooltip-time {
    color: #9aa0a6;
    font-size: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 32px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: #718096;
    font-size: 14px;
}

.stat-value {
    color: #1a202c;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

.chart-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #4a5568;
    flex-wrap: wrap;
    gap: 16px;
}

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

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

.legend-color {
    width: 14px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.legend-color.fund-color {
    background-color: #223F82;
}

.legend-color.cdi-color {
    background-color: #c5221f;
}

.preclose-meta {
    font-weight: 500;
    color: #4a5568;
}

.preclose-val {
    color: #1a202c;
    font-weight: 600;
    margin-left: 4px;
}

.chart-tooltip#tooltipFundo {
    border: 1px solid rgba(34, 63, 130, 0.8);
}

.chart-tooltip#tooltipCdi {
    border: 1px solid rgba(197, 34, 31, 0.8);
}

.tooltip-cdi .tooltip-price {
    color: #fca5a5;
}