/* Report Container specific constraint */
.container {
    width: 100%;
    max-width: 1000px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
}

/* Report-specific styles */

.report-header {
    background: var(--light-bg);
    padding: 120px 0 60px;
}

.report-title-section {
    text-align: center;
    margin-bottom: 3rem;
}

.report-title-section h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.report-period {
    color: var(--text-light);
    font-size: 1.1rem;
}

.driver-info-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 2rem;
    align-items: center;
}

.driver-photo .photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2.5rem;
    font-weight: bold;
}

.driver-details {
    flex: 1;
}

.driver-details h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.driver-id, .vehicle {
    color: var(--text-light);
    margin: 0.25rem 0;
}

.driver-stats-quick {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.stat-badge {
    background: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.risk-score-badge {
    text-align: center;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.score-circle.low,
.score-circle.good {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.score-circle.moderate,
.score-circle.average {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.score-circle.high,
.score-circle.poor {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

.score-label {
    font-size: 0.8rem;
    color: var(--white);
    opacity: 0.9;
}

.risk-level {
    font-weight: 600;
    color: var(--text-dark);
}

.risk-score-note {
    margin: 6px auto 0;
    width: 100%;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Archetype Section */
.archetype-section {
    padding: 60px 0;
}

.archetype-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.archetype-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.archetype-icon {
    font-size: 4rem;
}

.archetype-info h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.archetype-confidence {
    color: var(--text-light);
}

.archetype-description {
    margin-bottom: 2rem;
}

.archetype-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.trait-tag {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.trait-tag.positive {
    background: #d1fae5;
    color: #065f46;
}

.trait-tag.warning {
    background: #fef3c7;
    color: #92400e;
}

.archetype-comparison {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.archetype-comparison h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Spider Chart */
.spider-section {
    padding: 60px 0;
    background: var(--light-bg);
}

.spider-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.spider-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spider-legend h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.dimension-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dimension-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--light-bg);
}

.dimension-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dimension-item.excellent .dimension-dot {
    background: #10b981;
}

.dimension-item.good .dimension-dot {
    background: #3b82f6;
}

.dimension-item.moderate .dimension-dot {
    background: #f59e0b;
}

.dimension-item.poor .dimension-dot {
    background: #ef4444;
}

.dimension-name {
    flex: 1;
    font-weight: 500;
}

.dimension-score {
    font-weight: 700;
    color: var(--text-dark);
}

/* Events Section */
.events-section {
    padding: 60px 0;
}

.events-summary {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.event-stat {
    text-align: center;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 150px;
}

.event-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.event-number.high {
    color: #ef4444;
}

.event-number.medium {
    color: #f59e0b;
}

.event-number.low {
    color: #10b981;
}

.event-label {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
}

.events-timeline {
    max-width: 900px;
    margin: 0 auto;
}

.events-timeline h3 {
    margin-bottom: 2rem;
    color: var(--text-dark);
}

/* Responsive layout fixes */
@media (max-width: 991px) {
    .driver-info-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .driver-stats-quick {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .spider-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .spider-chart-wrapper {
        width: 100%;
    }

    .events-summary {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .recommendations-grid,
    .trends-grid,
    .trip-details-cards,
    .insight-cards,
    .recommendation-list,
    .resource-list,
    .feedback-section .container > .feedback-card {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .trip-summary-card {
        overflow-x: auto;
    }

    .trip-summary-table {
        min-width: 560px;
    }
}

@media (max-width: 576px) {
    .report-header { padding: 80px 0 40px; }
    .report-title-section h1 { font-size: 2rem; }
    .driver-info-card { padding: 1.25rem; }
    .score-circle { width: 100px; height: 100px; }
    .score-value { font-size: 2rem; }
    .spider-container { padding: 1.25rem; }
    .events-section,
    .recommendations-section,
    .trends-section,
    .trip-section,
    .insights-section,
    .feedback-section,
    .resources-section {
        padding: 40px 0;
    }
    .event-card { padding: 1rem; }
    .event-details h4 { font-size: 1.15rem; }
    .stat-badge { font-size: 0.85rem; }
    .driver-info-card {
        align-items: center;
        text-align: center;
    }
    .driver-details {
        text-align: center;
    }
    .driver-stats-quick {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    .driver-stats-quick .stat-badge {
        width: 100%;
        max-width: 220px;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    .risk-score-badge {
        text-align: center;
    }
}

.event-card {
    background: var(--white);
    border-left: 4px solid;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.event-card.high-risk {
    border-color: #ef4444;
}

.event-card.medium-risk {
    border-color: #f59e0b;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.event-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.event-badge.critical {
    background: #fee2e2;
    color: #991b1b;
}

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

.event-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.event-details h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.event-location {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.event-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.event-context {
    background: #fef3c7;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.event-context p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

/* Recommendations */
.recommendations-section {
    padding: 60px 0;
    background: var(--light-bg);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.recommendation-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.priority-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.recommendation-card.priority-high .priority-badge {
    background: #fee2e2;
    color: #991b1b;
}

.recommendation-card.priority-medium .priority-badge {
    background: #fef3c7;
    color: #92400e;
}

.impact-score {
    font-size: 0.85rem;
    color: #10b981;
    font-weight: 600;
}

.recommendation-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.recommendation-modules {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.module {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Trends */
.trends-section {
    padding: 60px 0;
}

.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.trend-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    border-top: 4px solid;
}

.trend-card.improving {
    border-color: #10b981;
}

.trend-card.declining {
    border-color: #ef4444;
}

.trend-card.stable {
    border-color: #64748b;
}

.trend-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.trend-change {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.mini-chart {
    height: 100px;
}

/* Prediction */
.prediction-section {
    padding: 60px 0;
    background: var(--light-bg);
}

.prediction-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.confidence-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.prediction-content {
    display: grid;
    gap: 2rem;
}

.prediction-probability {
    text-align: center;
    padding: 2rem;
    background: var(--light-bg);
    border-radius: 10px;
}

.probability-value {
    display: block;
    font-size: 4rem;
    font-weight: 800;
    color: #f59e0b;
    line-height: 1;
}

.probability-label {
    display: block;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.prediction-factors h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.prediction-factors ul {
    list-style: none;
    padding-left: 0;
}

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

.prediction-factors li:before {
    content: "⚠";
    position: absolute;
    left: 0;
    color: #f59e0b;
}

.prediction-action {
    background: #fef3c7;
    padding: 1.5rem;
    border-radius: 10px;
}

/* Impact Tags */
.impact-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.impact-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.impact-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.impact-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.impact-tag:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Responsive */
@media (max-width: 768px) {
    .driver-info-card {
        flex-direction: column;
        text-align: center;
    }
    
    .spider-container {
        grid-template-columns: 1fr;
    }
    
    .event-metrics {
        grid-template-columns: 1fr 1fr;
    }
}
