/* chart-styles.css - Updated styling for Chart.js implementation with improved tenor lines */

/* Chart container styling */
.chart-canvas-container {
    position: relative;
    width: 100%;
    height: calc(100% - 30px); /* Subtract title and legend height */
    margin-top: 10px;
    background-color: #101010;
}

/* Chart container styling */
.chart-container {
    display: none;
    height: 100%;
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent scrolling by default */
}

/* Active chart */
.chart-container.active {
    display: block;
}

/* Chart title and legend area */
.chart-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    height: 20px;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

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

.legend-label {
    color: #aaaaaa;
}

/* Loading spinner for charts */
.chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(16, 16, 16, 0.7);
    z-index: 10;
    font-size: 14px;
    color: #aaaaaa;
}

/* Add a subtle animation for loading spinner */
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.chart-loading::after {
    content: '...';
    animation: pulse 1.5s infinite;
    margin-left: 3px;
}

/* Error message styling */
.chart-error {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(16, 16, 16, 0.7);
    z-index: 10;
    color: #d8005c;
    font-size: 14px;
    text-align: center;
    padding: 0 20px;
}

/* Fix the scroll issue with chart tabs */
#charting .component-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Tab styling */
.tabs {
    display: flex;
    background-color: #1a1a1a;
    border-bottom: 1px solid #252525;
}

.tab {
    padding: 8px 15px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tab.active {
    background-color: #4054b2;
    color: #ffffff;
}

.tab:not(.active) {
    color: #dddddd;
}

.tab:hover:not(.active) {
    background-color: #252525;
}

/* Enhanced Tenor Lines */
/* Add styles for vertical tenor lines */
.chart-canvas-container .tenor-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.5px; /* Thicker line */
    background-color: rgba(255, 255, 255, 0.3); /* Brighter lines for better visibility */
    z-index: 1;
}

/* Tenor labels */
.chart-canvas-container .tenor-label {
    position: absolute;
    top: 5px; /* More space at the top */
    transform: translateX(-50%);
    padding: 2px 5px;
    background-color: rgba(16, 16, 16, 0.7);
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    color: #ffffff;
    z-index: 2;
    white-space: nowrap;
}

/* Override Chart.js tooltip styling */
.chartjs-tooltip {
    background-color: rgba(31, 31, 31, 0.95) !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-family: 'Roboto', sans-serif !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #333 !important;
    pointer-events: none !important;
}

/* Ensure canvas resizes properly */
canvas {
    width: 100% !important;
    height: 100% !important;
}