/* F1 Driver Pole Comparison Styles */

/* General Container */
.f1-pole-comparison {
    max-width: 1400px;
    margin: 30px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.f1-pole-comparison-error {
    padding: 20px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    margin: 20px 0;
}

.f1-pole-comparison-error p {
    margin: 0;
    color: #c62828;
    font-weight: 500;
}

/* Driver Links */
.f1-pole-comparison a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

.f1-pole-comparison a:hover {
    color: #4caf50;
    text-decoration: underline;
}

/* Header */
.comparison-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #4caf50;
}

.comparison-header h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 36px;
    font-weight: 700;
}

.comparison-period {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* Drivers Overview */
.drivers-overview {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 40px;
}

.driver-card {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s;
}

.driver-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.driver-card.driver-1 {
    border-color: #4caf50;
}

.driver-card.driver-2 {
    border-color: #2196F3;
}

.driver-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.driver-header h3 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.driver-number {
    font-size: 28px;
    font-weight: 700;
    color: #7f8c8d;
}

.driver-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
}

.detail-item .label {
    color: #7f8c8d;
    font-size: 14px;
}

.detail-item .value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.vs-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    letter-spacing: 2px;
}

/* Comparison Section */
.comparison-section {
    margin: 40px 0;
    padding: 30px;
    background: #fafafa;
    border-radius: 12px;
}

.section-title {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

/* Stats Comparison Grid */
.stats-comparison-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.stat-comparison {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-label {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.stat-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 10px;
}

.stat-bar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.stat-bar-wrapper.driver-1-bar {
    justify-content: flex-start;
}

.stat-bar-wrapper.driver-2-bar {
    justify-content: flex-end;
}

.stat-bar {
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: width 0.5s ease;
    min-width: 80px;
}

.stat-bar-wrapper.driver-1-bar .stat-bar {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    justify-content: flex-start;
}

.stat-bar-wrapper.driver-2-bar .stat-bar {
    background: linear-gradient(90deg, #2196F3, #42a5f5);
    justify-content: flex-end;
}

.stat-bar.conversion-bar {
    min-width: 100px;
}

.stat-bar.dnf-bar {
    background: linear-gradient(90deg, #f44336, #ef5350) !important;
}

.stat-value {
    color: white;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.stat-winner {
    text-align: center;
    margin-top: 10px;
}

.stat-winner .winner {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.stat-winner .winner.driver-1 {
    background: #4caf50;
    color: white;
}

.stat-winner .winner.driver-2 {
    background: #2196F3;
    color: white;
}

.stat-winner .tie {
    color: #7f8c8d;
    font-weight: 600;
}

/* Yearly Comparison Table */
.yearly-comparison-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.yearly-comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.yearly-comparison-table thead {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

.yearly-comparison-table th {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.yearly-comparison-table .driver-1-header {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.yearly-comparison-table .driver-2-header {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.yearly-comparison-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.yearly-comparison-table tbody tr:hover {
    background-color: #f8f9fa;
}

.yearly-comparison-table td {
    padding: 15px 10px;
    text-align: center;
    vertical-align: middle;
}

.year-cell {
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
    background: #f0f0f0;
}

.poles-cell, .wins-cell, .podiums-cell {
    font-size: 15px;
    font-weight: 600;
}

.poles-cell.winner, .conversion-cell.winner {
    background: #e8f5e9;
}

.poles-cell.tie, .conversion-cell.tie {
    background: #fff9e6;
}

.winner-badge {
    margin-left: 5px;
    font-size: 12px;
}

.conversion-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 13px;
    min-width: 60px;
}

.no-data {
    color: #bdc3c7;
    font-weight: 500;
    font-style: italic;
}

.yearly-comparison-table tfoot {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    font-weight: 700;
}

.yearly-comparison-table tfoot td {
    padding: 18px 10px;
    font-size: 16px;
}

.totals-row .winner {
    background: rgba(255, 215, 0, 0.3);
}

.totals-row .tie {
    background: rgba(255, 193, 7, 0.2);
}

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

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.summary-icon {
    font-size: 48px;
    line-height: 1;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-detail {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .drivers-overview {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vs-badge {
        width: 60px;
        height: 60px;
        font-size: 24px;
        margin: 0 auto;
    }
    
    .stat-bars {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .f1-pole-comparison {
        padding: 15px;
    }
    
    .comparison-header h2 {
        font-size: 28px;
    }
    
    .driver-header h3 {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .yearly-comparison-table {
        font-size: 12px;
    }
    
    .yearly-comparison-table th,
    .yearly-comparison-table td {
        padding: 8px 5px;
    }
}

/* Print Styles */
@media print {
    .f1-pole-comparison {
        box-shadow: none;
    }
    
    .driver-card {
        page-break-inside: avoid;
    }
    
    .comparison-section {
        page-break-inside: avoid;
    }
}
