/* ECharts Integration Styles for TAMS */
/* Chart container wrapper */
.chart-container-wrapper {
    background-color: #ffffff;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.chart-container-wrapper:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Chart header */
.chart-header {
    background: linear-gradient(135deg, #255799 0%, #1b3d6d 100%);
    color: white;
    padding: 12px 15px;
    font-family: "Roboto", sans-serif;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-header i {
    margin-right: 8px;
    color: #fecc07;
}

/* Chart toggle button */
.chart-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 4px;
}

.chart-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.chart-toggle:active {
    transform: scale(0.95);
}

/* Chart content area */
.chart-content {
    height: 705px;    
    background-color: #ffffff;
    position: relative;
}

/* Chart container */
#chartContainer {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

/* Loading indicator */
.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    font-family: "Roboto", sans-serif;
}

.chart-loading i {
    font-size: 24px;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

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

/* Enhanced table cells for chart integration */
table.fhwaSummary td[data-chart-enabled="true"],
table.ildSummary td[data-chart-enabled="true"] {
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

table.fhwaSummary td[data-chart-enabled="true"]:hover,
table.ildSummary td[data-chart-enabled="true"]:hover {
    background-color: rgba(37, 87, 153, 0.1) !important;
}

table.fhwaSummary td[data-chart-enabled="true"]:hover::after,
table.ildSummary td[data-chart-enabled="true"]:hover::after {
    content: "📊";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 768px) {
    .chart-content {
        height: 300px;
        padding: 5px;
    }

    .chart-header {
        padding: 10px 12px;
        font-size: 13px;
    }

    .chart-container-wrapper {
        margin: 5px 0;
    }
}

/* Animation for showing/hiding chart */
.chart-container-wrapper.show {
    animation: slideDown 0.3s ease-out;
}

.chart-container-wrapper.hide {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Chart error state */
.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-family: "Roboto", sans-serif;
    text-align: center;
}

.chart-error i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

.chart-error h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #999;
}

.chart-error p {
    margin: 0;
    font-size: 14px;
    color: #bbb;
}

/* Chart no-data state */
.chart-no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-family: "Roboto", sans-serif;
    text-align: center;
}

.chart-no-data i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}

.chart-no-data h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #999;
}

.chart-no-data p {
    margin: 0;
    font-size: 14px;
    color: #bbb;
}
