/* CSD Document Validation Reports Dashboard Styles - Light Theme */

.reports-dashboard {
    padding: 20px 0;
    /*background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);*/
    min-height: 100vh;
}

.dashboard-header {
    background: linear-gradient(135deg, #4e73df 0%, #6f86e1 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(78, 115, 223, 0.15);
    border: 1px solid rgba(255,255,255,0.1);
}

.dashboard-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.dashboard-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.kpi-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    border: 1px solid #e3e6f0;
}

.kpi-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(78, 115, 223, 0.1);
}

.border-left-primary {
    border-left: 5px solid #4e73df !important;
}

.border-left-success {
    border-left: 5px solid #1cc88a !important;
}

.border-left-warning {
    border-left: 5px solid #f6c23e !important;
}

.border-left-info {
    border-left: 5px solid #36b9cc !important;
}

.chart-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #e3e6f0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(78, 115, 223, 0.1);
}

.chart-container {
    position: relative;
    height: 400px;
    padding: 25px;
    background: #ffffff;
}

.nav-pills .nav-link {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    color: #5a5c69;
    margin: 0 8px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid #e3e6f0;
    padding: 12px 24px;
}

.nav-pills .nav-link:hover {
    background: linear-gradient(135deg, #4e73df 0%, #6f86e1 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(78, 115, 223, 0.3);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #4e73df 0%, #6f86e1 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(78, 115, 223, 0.3);
}

.text-gray-800 {
    color: #3a3b45 !important;
}

.text-gray-300 {
    color: #858796 !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.text-xs {
    font-size: 0.7rem;
}

.text-sm {
    font-size: 0.875rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.4em 0.8em;
    border-radius: 12px;
    font-weight: 600;
}

/* Enhanced badge colors */
.bg-success {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f6c23e 0%, #d4a90e 100%) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #e74a3b 0%, #c0392b 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #36b9cc 0%, #258391 100%) !important;
}

.bg-secondary {
    background: linear-gradient(135deg, #858796 0%, #60616f 100%) !important;
}

/* Loading states */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alert customization */
.alert-warning {
    background: linear-gradient(135deg, #fff9e6 0%, #ffeaa7 100%);
    border: 1px solid #f6c23e;
    border-radius: 12px;
    color: #856404;
}

/* Table enhancements */
.table-responsive {
    border-radius: 15px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.table {
    margin-bottom: 0;
    background: #ffffff;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fc 0%, #eaecf4 100%);
    border-bottom: 2px solid #e3e6f0;
    font-weight: 700;
    color: #5a5c69;
    padding: 1.2rem 1rem;
}

.table tbody tr {
    background: #ffffff;
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
}

.table tbody td {
    padding: 1rem;
    border-color: #eaecf4;
}

/* Chart specific styles */
.chart-card .card-header {
    background: linear-gradient(135deg, #0be568 0%, #5b5b5b 100% 100% );
    border-bottom: 1px solid #e3e6f0;
    padding: 1.2rem 1.5rem;
}

.chart-card .card-header h6 {
    margin: 0;
    font-weight: 700;
    color: #5a5c69;
    font-size: 1rem;
}

.chart-card .card-body {
    background: #ffffff;
    padding: 0;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.slide-up {
    animation: slideUp 0.7s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status badges with better contrast */
.status-badge {
    font-weight: 700;
    border-radius: 15px;
    padding: 0.35rem 0.9rem;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* Priority indicators */
.priority-high {
    color: #e74a3b;
    font-weight: bold;
}

.priority-medium {
    color: #f39c12;
    font-weight: 600;
}

.priority-low {
    color: #95a5a6;
}

/* Trend indicators */
.trend-up {
    color: #1cc88a;
    font-weight: 600;
}

.trend-down {
    color: #e74a3b;
    font-weight: 600;
}

.trend-neutral {
    color: #858796;
}

/* Dashboard navigation enhancements */
.dashboard-nav {
   /* background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #e3e6f0;*/
}

.dashboard-nav .nav-pills {
    justify-content: center;
}

/* Button group styling */
.btn-group .btn {
    border-radius: 8px !important;
    margin: 0 3px;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
}

.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.btn-outline-light {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
}

/* Enhanced KPI styling */
.kpi-card .card-body {
    padding: 1.8rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
}

.kpi-card .h5 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #5a5c69;
}

.kpi-card .text-primary {
    color: #4e73df !important;
}

.kpi-card .text-success {
    color: #1cc88a !important;
}

.kpi-card .text-warning {
    color: #f6c23e !important;
}

.kpi-card .text-info {
    color: #36b9cc !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .dashboard-title {
        font-size: 1.8rem;
    }
    
    .chart-container {
        height: 300px;
        padding: 15px;
    }
    
    .nav-pills .nav-link {
        margin: 2px;
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    .kpi-card {
        margin-bottom: 1.5rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin: 3px 0;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .dashboard-header {
        padding: 1.5rem;
        text-align: center;
    }
    
    .dashboard-title {
        font-size: 1.6rem;
    }
    
    .dashboard-subtitle {
        font-size: 1rem;
    }
    
    .chart-container {
        height: 280px;
        padding: 10px;
    }
    
    .nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .badge {
        font-size: 0.65rem;
    }
}

/* Print styles */
@media print {
    .dashboard-nav,
    .btn-group,
    .alert-dismissible .btn-close {
        display: none !important;
    }
    
    .dashboard-header {
        background: #4e73df !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .chart-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .kpi-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .chart-card,
    .kpi-card {
        border: 2px solid #000;
    }
    
    .nav-pills .nav-link {
        border: 2px solid #000;
    }
    
    .badge {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .kpi-card,
    .chart-card,
    .nav-link {
        transition: none;
    }
    
    .fade-in,
    .slide-up {
        animation: none;
    }
}

/* Enhanced visual elements */
.card {
    border: none;
    border-radius: 15px;
}

.btn {
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.alert {
    border-radius: 12px;
    border: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4e73df 0%, #6f86e1 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3c5aa6 0%, #5a6dc8 100%);
}

/* Failing Rules Chart Specific Styles */
.summary-metric {
    padding: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #858796;
    margin-top: 0.25rem;
}

.border-left-danger {
    border-left: 5px solid #e74a3b !important;
}

.rule-name {
    font-weight: 600;
    color: #3a3b45;
}

.progress {
    border-radius: 8px;
    background-color: #f8f9fc;
    overflow: hidden;
}

.progress-bar {
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.badge-outline-primary {
    color: #4e73df;
    border: 1px solid #4e73df;
    background-color: rgba(78, 115, 223, 0.1);
}

.badge-lg {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 15px;
}

/* Modal enhancements for rule details */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-radius: 15px 15px 0 0;
    border-bottom: 1px solid #e3e6f0;
}

.modal-footer {
    border-radius: 0 0 15px 15px;
    border-top: 1px solid #e3e6f0;
}

/* Trend chart specific styles */
#ruleTrendsChart {
    border-radius: 10px;
}

/* Loading animations for failing rules */
.failing-rules-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Auto-refresh indicator */
.auto-refresh-active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Error state styling */
.error-container {
    padding: 2rem;
    text-align: center;
    color: #858796;
}

.error-container .fas {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #e74a3b;
}

/* Success state when no failing rules */
.no-failures-container {
    padding: 3rem;
    text-align: center;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 15px;
    border: 1px solid #1cc88a;
}

.no-failures-container .fas {
    color: #1cc88a;
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Responsive table for failing rules */
@media (max-width: 768px) {
    .failing-rules-table {
        font-size: 0.8rem;
    }
    
    .failing-rules-table .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .metric-value {
        font-size: 1.2rem;
    }
    
    .metric-label {
        font-size: 0.65rem;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for chart interactions */
.chart-container:focus-within {
    outline: 2px solid #4e73df;
    outline-offset: 2px;
}
