/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    line-height: 1.6;
}

/* Dashboard Layout */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    border-left: 4px solid #4299e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    flex: 1;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 5px;
}

.dashboard-subtitle {
    color: #718096;
    font-size: 1rem;
}

/* Export Button */
.export-button {
    background: linear-gradient(135deg, #4299e1 0%, #63b3ed 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

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

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 4px solid;
    transition: transform 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
}

.kpi-card.blue { border-left-color: #4299e1; }
.kpi-card.green { border-left-color: #48bb78; }
.kpi-card.purple { border-left-color: #9f7aea; }
.kpi-card.orange { border-left-color: #ed8936; }

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.kpi-label {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
}

.kpi-trend {
    font-size: 0.8rem;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.trend-positive { 
    background: #c6f6d5; 
    color: #22543d; 
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

/* Chart Container */
.chart-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.chart-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a202c;
}

/* Clusters Chart */
.clusters-chart {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.cluster-item {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: white;
    position: relative;
}

.cluster-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.cluster-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.cluster-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.cluster-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.cluster-percentage {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.cluster-name {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Experience Chart */
.experience-chart {
    margin-top: 20px;
}

.experience-bars {
    display: flex;
    gap: 12px;
    align-items: end;
    height: 150px;
    margin: 20px 0;
}

.experience-bar {
    flex: 1;
    background: linear-gradient(to top, #4299e1, #63b3ed);
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: end;
    justify-content: center;
    color: white;
    font-weight: 600;
    padding-bottom: 10px;
    position: relative;
}

.bar-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.8rem;
    color: #4a5568;
    font-weight: 500;
}

/* Data Table */
.data-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-header {
    background: #f7fafc;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
}

.table-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
}

.table-content {
    padding: 0;
}

.table-row {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.table-row:hover {
    background: #f7fafc;
}

.table-row:last-child {
    border-bottom: none;
}

.metric-name {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.metric-value {
    font-weight: 600;
    color: #4299e1;
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.insight-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-top: 3px solid #4299e1;
}

.insight-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.insight-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.insight-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
}

.insight-content {
    color: #4a5568;
    line-height: 1.6;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4299e1, #63b3ed);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Methodology Footer */
.methodology-footer {
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-top: 25px;
    font-size: 0.9rem;
    color: #718096;
    text-align: center;
}

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

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Print Styles for PDF Export */
@media print {
    body {
        background: white;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }

    .dashboard {
        max-width: none;
        padding: 0;
    }

    .export-button {
        display: none;
    }

    .chart-container,
    .kpi-card,
    .insight-card,
    .data-table,
    .dashboard-header,
    .methodology-footer {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        break-inside: avoid;
        margin-bottom: 15px;
    }

    .kpi-grid,
    .insights-grid {
        break-inside: avoid;
    }

    .main-content {
        break-inside: avoid;
    }

    .cluster-item {
        break-inside: avoid;
    }

    /* Ensure colors print properly */
    * {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}