/* Reports and Charts Styling */

/* Report Container */
.report-container {
    padding: 1.5rem;
    background: transparent;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Report Section */
.report-section {
    margin-bottom: 2rem;
}

.report-section:last-child {
    margin-bottom: 0;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0066cc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-card.positive {
    border-left-color: #28a745;
}

.metric-card.negative {
    border-left-color: #dc3545;
}

.metric-card.neutral {
    border-left-color: #6c757d;
}

.metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    line-height: 1;
}

.metric-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-change.positive {
    color: #28a745;
}

.metric-change.negative {
    color: #dc3545;
}

.metric-icon {
    font-size: 2rem;
    color: #6c757d;
    opacity: 0.3;
}

/* Chart Container */
.chart-container {
    position: relative;
    background: #ffffff;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.chart-wrapper {
    position: relative;
    min-height: 300px;
}

.chart-wrapper canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Chart Loading State */
.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
}

.chart-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Report Text Content */
.report-content {
    line-height: 1.6;
    color: #212529;
}

.report-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #212529;
}

.report-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #495057;
}

.report-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.report-content li {
    margin-bottom: 0.5rem;
}

.report-content p {
    margin-bottom: 1rem;
}

/* Report Tab Styling */
.nav-tabs .nav-link.report-tab {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    position: relative;
}

.nav-tabs .nav-link.report-tab:hover {
    background-color: #e9ecef;
    color: #212529;
}

.nav-tabs .nav-link.report-tab.active {
    background-color: #ffffff;
    color: #0066cc;
    border-bottom-color: #ffffff;
    font-weight: 500;
}

.nav-tabs .nav-link.report-tab .close-tab {
    margin-left: 0.5rem;
    opacity: 0.5;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.nav-tabs .nav-link.report-tab .close-tab:hover {
    opacity: 1;
}

/* Report Insights Box */
.insights-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.insights-box h4 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.insights-box ul {
    margin: 0;
    padding-left: 1.25rem;
}

.insights-box li {
    margin-bottom: 0.5rem;
}

/* Report Error State */
.report-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.report-error h4 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        min-height: 250px;
    }

    .nav-tabs .nav-link.report-tab {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Print Styles */
@media print {
    .report-container {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    .chart-container {
        page-break-inside: avoid;
    }

    .nav-tabs {
        display: none;
    }
}

/* Animation for new reports */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-container.new-report {
    animation: fadeInUp 0.3s ease-out;
}

/* Chart Legend Customization */
.chart-container .chart-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.chart-container .legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.chart-container .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}