/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 30px;
}

h2 {
    color: #34495e;
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 8px;
}

/* Chart container */
.chart-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Legend panel */
.legend-panel {
    margin: 30px 0;
}

.legend-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.legend-color.foundational {
    background: rgba(76, 175, 80, 0.7);
    border-color: rgba(76, 175, 80, 1);
}

.legend-color.intermediate {
    background: rgba(33, 150, 243, 0.6);
    border-color: rgba(33, 150, 243, 1);
}

.legend-color.orphaned {
    background: rgba(244, 67, 54, 0.7);
    border-color: rgba(244, 67, 54, 1);
}

.legend-text {
    flex: 1;
}

.legend-text strong {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
}

.legend-text p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

/* Metrics panel */
.metrics-panel {
    margin: 30px 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.metric-card {
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.metric-card.foundational-card {
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    color: white;
}

.metric-card.intermediate-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.metric-card.orphaned-card {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.metric-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-indicator {
    margin-top: 20px;
    padding: 15px;
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    text-align: center;
}

.indicator-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    font-weight: bold;
}

.indicator-text {
    color: #155724;
    font-weight: 600;
}

/* Analysis section */
.analysis {
    background: #f8f9fa;
    border-left: 4px solid #e74c3c;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.analysis p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.analysis p:last-child {
    margin-bottom: 0;
}

.analysis strong {
    color: #2c3e50;
}

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

    h1 {
        font-size: 22px;
    }

    .subtitle {
        font-size: 14px;
    }

    .chart-container {
        padding: 15px;
    }

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

    .metric-value {
        font-size: 28px;
    }

    .legend-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .legend-color {
        margin-bottom: 10px;
    }
}

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

    .container {
        padding: 15px;
    }
}

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

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

    .metric-card, .legend-item {
        break-inside: avoid;
    }
}
