/* F1 Pole Position Statistics Styles */

/* General Styles */
.f1-pole-stats {
    max-width: 1200px;
    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;
}

.pole-stats-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #4caf50;
}

.pole-stats-header h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 32px;
    font-weight: 700;
}

.pole-stats-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

/* Driver Poles Table */
.pole-stats-table-wrapper {
    overflow-x: auto;
}

.pole-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.pole-stats-table thead {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.pole-stats-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pole-stats-table .rank-col { width: 60px; text-align: center; }
.pole-stats-table .driver-col { width: auto; }
.pole-stats-table .team-col { width: 200px; }
.pole-stats-table .number-col { width: 100px; text-align: center; }
.pole-stats-table .poles-col { width: 150px; text-align: center; }

.pole-stats-table tbody tr.pole-row {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.pole-stats-table tbody tr.pole-row:hover {
    background-color: #f8f9fa;
}

.pole-stats-table td {
    padding: 15px 10px;
}

.rank-cell {
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    color: #4caf50;
}

.driver-cell strong {
    font-size: 16px;
    color: #2c3e50;
}

.nationality {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 3px;
}

.number-cell {
    text-align: center;
    font-weight: 600;
    color: #34495e;
}

.poles-cell {
    text-align: center;
}

.pole-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
}

.pole-details-row {
    display: none;
}

.pole-row:hover + .pole-details-row {
    display: table-row;
}

.pole-details-cell {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.pole-details strong {
    display: block;
    margin-bottom: 10px;
    color: #2c3e50;
}

.races-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.race-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 13px;
    border: 1px solid #c8e6c9;
}

/* Yearly Poles Grid */
.yearly-poles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gp-pole-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.gp-pole-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.gp-pole-card.won-race {
    border-color: #ffd700;
    background: linear-gradient(135deg, #fff9e6, #ffffff);
}

.gp-pole-card.podium-finish {
    border-color: #4caf50;
    background: linear-gradient(135deg, #e8f5e9, #ffffff);
}

.gp-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.gp-number {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.gp-name {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 8px 0;
}

.gp-date {
    font-size: 13px;
    color: #95a5a6;
}

.pole-winner {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.pole-icon {
    font-size: 48px;
    line-height: 1;
}

.driver-info {
    flex: 1;
}

.driver-name-large {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.driver-number {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 600;
}

.driver-team {
    font-size: 14px;
    color: #4caf50;
    font-weight: 600;
    margin-top: 5px;
}

.race-result {
    text-align: center;
    margin-top: 15px;
}

.result-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.win-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b7500;
    border: 2px solid #ffd700;
}

.podium-badge {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
}

.finish-badge {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.dnf-badge {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.points-earned {
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
}

/* Pole Conversion Stats */
.conversion-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.conversion-stats-table thead {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.conversion-stats-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

.conversion-stats-table .wins-col,
.conversion-stats-table .podiums-col,
.conversion-stats-table .conversion-col,
.conversion-stats-table .viz-col {
    text-align: center;
}

.conversion-row {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.conversion-row:hover {
    background-color: #f8f9fa;
}

.conversion-row td {
    padding: 15px 10px;
}

.conversion-row.excellent {
    background: linear-gradient(to right, rgba(76, 175, 80, 0.05), transparent);
}

.conversion-row.good {
    background: linear-gradient(to right, rgba(33, 150, 243, 0.05), transparent);
}

.conversion-row.average {
    background: linear-gradient(to right, rgba(255, 193, 7, 0.05), transparent);
}

.conversion-row.poor {
    background: linear-gradient(to right, rgba(244, 67, 54, 0.05), transparent);
}

.wins-cell .win-badge {
    display: inline-block;
    background: #ffd700;
    color: #8b7500;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

.podiums-cell .podium-badge {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

.conversion-percentage {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
}

.conversion-percentage.excellent {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
}

.conversion-percentage.good {
    background: linear-gradient(135deg, #2196F3, #42a5f5);
    color: white;
}

.conversion-percentage.average {
    background: linear-gradient(135deg, #ff9800, #ffa726);
    color: white;
}

.conversion-percentage.poor {
    background: linear-gradient(135deg, #f44336, #ef5350);
    color: white;
}

.conversion-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.bar-fill.excellent {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.bar-fill.good {
    background: linear-gradient(90deg, #2196F3, #42a5f5);
}

.bar-fill.average {
    background: linear-gradient(90deg, #ff9800, #ffa726);
}

.bar-fill.poor {
    background: linear-gradient(90deg, #f44336, #ef5350);
}

.conversion-details-row {
    display: none;
}

.conversion-row:hover + .conversion-details-row {
    display: table-row;
}

.conversion-details-cell {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.conversion-breakdown {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.breakdown-label {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.breakdown-value {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.conversion-legend {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.conversion-legend h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.legend-item.excellent {
    background: #4caf50;
    color: white;
}

.legend-item.good {
    background: #2196F3;
    color: white;
}

.legend-item.average {
    background: #ff9800;
    color: white;
}

.legend-item.poor {
    background: #f44336;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .f1-pole-stats {
        padding: 15px;
    }
    
    .pole-stats-header h2 {
        font-size: 24px;
    }
    
    .yearly-poles-grid {
        grid-template-columns: 1fr;
    }
    
    .pole-stats-table,
    .conversion-stats-table {
        font-size: 13px;
    }
    
    .pole-stats-table th,
    .conversion-stats-table th {
        padding: 10px 5px;
        font-size: 11px;
    }
    
    .pole-stats-table td,
    .conversion-stats-table td {
        padding: 10px 5px;
    }
    
    .conversion-breakdown {
        flex-direction: column;
    }
    
    .legend-items {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    .f1-pole-stats {
        box-shadow: none;
    }
    
    .gp-pole-card {
        page-break-inside: avoid;
    }
}