/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: aliceblue;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
}

.container {
    background: aliceblue;
    margin: 0;
    padding: 0;
    width: 100%;
}

h1 {
    font-size: 2rem;
    color: #2d3748;
    text-align: center;
    padding: 0px;
    margin: 5px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 3px solid #667eea;
    padding-bottom: 2px;
}

h3 {
    font-size: 1.125rem;
    color: #4a5568;
    margin-bottom: 8px;
    font-weight: 600;
}

h4 {
    text-align: center;
}

.container {
    margin: 0px;
    padding: 0px;
}
/* Chart container */
.chart-container {
    position: relative;
    background: aliceblue;
    /* border-radius: 12px; */
    margin: 0;
    padding: 0;
    max-height: 400px;
    width: 100%;
    /*
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
    */
}

/* Legend container */
.legend-container {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.legend-label {
    font-size: 0.95rem;
    color: #2d3748;
    font-weight: 500;
}

/* Analysis container */
.analysis-container {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 12px;
    padding: 30px;
    border: 2px solid #667eea40;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.insight-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border-left: 4px solid #667eea;
    transition: transform 0.3s, box-shadow 0.3s;
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.insight-card:nth-child(2) {
    border-left-color: #f59e0b;
}

.insight-card:nth-child(3) {
    border-left-color: #ef4444;
}

.metric {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin: 10px 0 15px 0;
    letter-spacing: -0.5px;
}

.insight-card:nth-child(2) .metric {
    color: #f59e0b;
}

.insight-card:nth-child(3) .metric {
    color: #ef4444;
}

.description {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .chart-container {
        padding: 0px;
    }

    .legend-grid {
        grid-template-columns: 1fr;
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }

    .metric {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 8px;
    }

    h1 {
        font-size: 1.25rem;
    }

    .chart-container {
        padding: 15px;
    }

    .legend-container,
    .analysis-container {
        padding: 20px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        padding: 20px;
    }

    .chart-container,
    .legend-container,
    .analysis-container {
        box-shadow: none;
        page-break-inside: avoid;
    }

    .insight-card {
        page-break-inside: avoid;
    }
}

/* Animation for initial load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-container,
.legend-container,
.analysis-container {
    animation: fadeIn 0.6s ease-out;
}

.legend-container {
    animation-delay: 0.2s;
}

.analysis-container {
    animation-delay: 0.4s;
}

/* Focus styles for accessibility */
.legend-item:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

canvas {
    position: relative;
    z-index: 1;
    width: 100% !important;
    height: auto !important;
}
