body{
    margin:0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f9f4;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.dashboard-container{
    width:90%;
    margin:auto;
    background-color: #f4f9f4;
    transition: padding 0s;
}

header{
    text-align:center;
    padding:30px;
}

header h1{
    color:#2e7d32;
    font-size:32px;
}

header p{
    color:#555;
}

/* Metric grid */
.metrics-grid{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap:20px;
    margin-bottom:30px;
}

/* Confusion matrix grid */
.confusion-section{
    display:grid;
    grid-template-columns: repeat(3,1fr);
    gap:20px;
    margin-bottom:40px;
}

/* ROC chart area */
.large-charts{
    margin-bottom:40px;
}

/* Cards with enhanced floating shadow effect */
.card{
    background:white;
    padding:20px;
    border-radius:12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-large{
    background:white;
    padding:20px;
    border-radius:12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.02);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card h3{
    text-align:center;
    color:#2e7d32;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.card-large h3{
    text-align:center;
    color:#2e7d32;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

/* Floating effect on hover */
.card:hover, .card-large:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px -12px rgba(0,0,0,0.2), 0 8px 12px -6px rgba(0,0,0,0.1);
}

/* Canvas styles */
canvas {
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    image-rendering: crisp-edges;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

#accuracyChart, #precisionChart, #recallChart, #f1Chart, #mccChart {
    max-height: 200px;
    width: 100% !important;
}

#rocChart {
    max-height: 350px;
    width: 100% !important;
}

/* Confusion matrix container */
.confusion-matrix {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    overflow-x: auto;
    padding: 10px 0;
    min-height: 350px;
}

.confusion-matrix canvas {
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.12);
    transition: box-shadow 0.3s ease;
}

.confusion-matrix canvas:hover {
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.2);
    transform: translateY(-2px);
}

/* Ranking container */
.ranking-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 200px;
}

/* Ranking list */
.ranking-list {
    margin-bottom: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ranking-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background-color: #ffffff;
}

.rank-badge {
    font-size: 18px;
    font-weight: bold;
    min-width: 50px;
}

.model-info {
    display: flex;
    justify-content: space-between;
    flex: 1;
    align-items: center;
}

.model-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.model-score {
    font-weight: 700;
    color: #2E7D32;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
}

/* Rank colors with enhanced shadows */
.rank-1 {
    background: linear-gradient(135deg, #fff9e6, #fff5d9);
    border-left: 4px solid #FFD700;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.15);
}

.rank-2 {
    background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
    border-left: 4px solid #C0C0C0;
}

.rank-3 {
    background: linear-gradient(135deg, #fff4e0, #ffedcc);
    border-left: 4px solid #CD7F32;
}

/* Mini metrics table */
.mini-metrics {
    width: 100%;
    font-size: 11px;
    border-collapse: collapse;
    margin-top: 10px;
}

.mini-metrics th {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    color: white;
    padding: 8px 4px;
    font-weight: 600;
    text-align: center;
}

.mini-metrics td {
    padding: 8px 4px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.mini-metrics td:first-child {
    font-weight: 600;
    color: #2E7D32;
    text-align: left;
    padding-left: 8px;
}

.mini-metrics tr:hover td {
    background-color: #f5f5f5;
}

.mini-metrics tr:last-child td {
    border-bottom: none;
}

/* Export Buttons */
.export-section {
    margin: 30px 0 0 0;
    display: flex;
    justify-content: center;
}

.export-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.export-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.export-btn span {
    font-size: 20px;
}

.pdf-btn {
    background: linear-gradient(135deg, #8B4513, #5D3A1A);
}

.pdf-btn:hover {
    background: linear-gradient(135deg, #9B5523, #6D4A2A);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(93, 58, 26, 0.3);
}

.png-btn {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
}

.png-btn:hover {
    background: linear-gradient(135deg, #3E8D42, #2B6E30);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.3);
}

.export-btn:active {
    transform: translateY(0);
}

/* Loading state for export */
.export-btn.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.export-btn.loading span {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Footer styles */
.dashboard-footer {
    background: linear-gradient(135deg, #5D3A1A, #4A2E14);
    color: white;
    text-align: center;
    padding: 20px 15px;
    margin-top: 40px;
    border-radius: 12px 12px 0 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}

.dashboard-footer p {
    margin: 0;
    line-height: 1.6;
}

/* Loading message */
.loading-message {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .dashboard-container {
        width: 95%;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .confusion-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .dashboard-footer {
        font-size: 12px;
        padding: 15px 10px;
    }
    
    .ranking-item {
        padding: 8px 10px;
    }
    
    .rank-badge {
        font-size: 16px;
        min-width: 45px;
    }
}

@media screen and (max-width: 480px) {
    header h1 {
        font-size: 24px;
    }
    
    header p {
        font-size: 14px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .confusion-section {
        grid-template-columns: 1fr;
    }
    
    #rocChart {
        max-height: 250px;
    }
    
    .confusion-matrix {
        min-height: 250px;
    }
    
    .export-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .dashboard-footer {
        font-size: 10px;
        padding: 12px 8px;
    }
    
    .ranking-item {
        padding: 6px 8px;
    }
    
    .rank-badge {
        font-size: 14px;
        min-width: 40px;
    }
    
    .model-score {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* Styles for better export quality */
.dashboard-container {
    background-color: #f4f9f4;
    position: relative;
}

/* Ensure all text is crisp during export */
* {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* High DPI screen optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    canvas {
        image-rendering: crisp-edges;
    }
    
    .export-btn {
        font-weight: 500;
    }
}

/* Smooth transitions for all interactive elements */
.export-btn, .card, .card-large, .ranking-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced focus states for accessibility */
.export-btn:focus {
    outline: 2px solid #2E7D32;
    outline-offset: 2px;
}

/* Improve table readability on small screens */
@media screen and (max-width: 640px) {
    .mini-metrics {
        font-size: 10px;
    }
    
    .mini-metrics th,
    .mini-metrics td {
        padding: 4px 2px;
    }
}

/* Print optimization for PDF export - preserves shadows */
@media print {
    @page {
        margin: 0;
        size: auto;
    }
    
    body {
        margin: 0;
        padding: 0;
        background: white;
    }
    
    .export-section,
    .export-btn {
        display: none !important;
    }
    
    .dashboard-container {
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    /* Keep shadows visible in print/export - ENHANCED */
    .card, .card-large {
        box-shadow: 0 8px 20px rgba(0,0,0,0.12) !important;
        border: none;
        background: white;
        break-inside: avoid;
        page-break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    canvas {
        page-break-inside: avoid;
        break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .confusion-section,
    .metrics-grid {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    /* Keep ranking shadows in print */
    .ranking-item {
        box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    /* Keep gradient backgrounds in print */
    .rank-1, .rank-2, .rank-3 {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}