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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1rem;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.metadata {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 1rem;
    opacity: 0.95;
}

.metadata span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Card Sections */
.card {
    padding: 2rem;
    margin: 2rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.card h2 {
    font-size: 1.75rem;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #667eea;
}

.card h3 {
    font-size: 1.25rem;
    color: #374151;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.card p {
    color: #4b5563;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.card ul {
    margin-left: 1.5rem;
    color: #4b5563;
}

.card li {
    margin-bottom: 0.5rem;
}

/* Summary Section */
.summary {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-left: 5px solid #667eea;
}

.key-finding {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid #10b981;
}

.key-finding h3 {
    color: #10b981;
    margin-top: 0;
}

.highlight {
    color: #667eea;
    font-size: 1.2em;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.chart-subtitle {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Tables */
.results-table,
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
}

.results-table th,
.comparison-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.results-table td,
.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.results-table tr:hover,
.comparison-table tr:hover {
    background: #f9fafb;
}

.best-model {
    background: #ecfdf5 !important;
    font-weight: 600;
}

.baseline {
    background: #fef3c7 !important;
}

.baseline-row {
    background: #fef3c7 !important;
    font-weight: 600;
}

.improvement {
    background: #ecfdf5 !important;
}

.degradation {
    background: #fee2e2 !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warning {
    background: #fed7aa;
    color: #92400e;
}

/* Comparison Colors */
.positive {
    color: #10b981;
    font-weight: 600;
}

.negative {
    color: #ef4444;
    font-weight: 600;
}

/* Model Details */
.model-detail {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

.baseline-detail {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.metric {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e5e7eb;
}

.metric-label {
    font-size: 0.85rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

/* Conclusions */
.conclusions {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 5px solid #f59e0b;
}

.conclusion-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.conclusion-item h3 {
    margin-top: 0;
    color: #111827;
}

/* Methodology */
.methodology {
    background: #f0fdf4;
    border-left: 5px solid #10b981;
}

.methodology ul {
    list-style: none;
    margin-left: 0;
}

.methodology li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.methodology li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Footer */
.footer {
    background: #1f2937;
    color: #9ca3af;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

.footer p {
    margin: 0.5rem 0;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .metadata {
        flex-direction: column;
        gap: 0.5rem;
    }

    .card {
        margin: 1rem 0.5rem;
        padding: 1.5rem;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    .chart-container {
        height: 300px;
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .metric-value {
        font-size: 1.25rem;
    }

    .results-table,
    .comparison-table {
        font-size: 0.85rem;
    }

    .results-table td,
    .comparison-table td,
    .results-table th,
    .comparison-table th {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 2rem 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .card h2 {
        font-size: 1.25rem;
    }

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

    .container {
        border-radius: 0;
    }
}

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

    .container {
        box-shadow: none;
    }

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

    .chart-container {
        page-break-inside: avoid;
    }
}
