/* ============================================================================
   PODIUM - ESTILOS
   ============================================================================ */

/* Header con botones */
.pole-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.pole-header-left h2 {
    margin: 0 0 8px 0;
    font-size: 2em;
}

.section-subtitle {
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

.pole-header-actions {
    display: flex;
    gap: 12px;
}

.pole-header-actions .btn {
    padding: 12px 24px;
    font-size: 1em;
    white-space: nowrap;
}

/* Next Race Card */
.next-race-card {
    background: linear-gradient(135deg, #e10600 0%, #c10500 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.3);
}

.next-race-card h3 {
    font-size: 1.3em;
    margin: 0 0 8px 0;
}

.next-race-card p {
    opacity: 0.95;
    margin: 4px 0;
    font-size: 0.95em;
}

/* Pole Selection Container */
.pole-selection-container {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Podium */
.pole-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
}

.podium-position {
    flex: 1;
    max-width: 180px;
}

.podium-box {
    background: white;
    border-radius: 10px;
    padding: 16px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid #ddd;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* Altura fija para los podium boxes */
.podium-box.first {
    border-color: #FFD700;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    height: 200px;
}

.podium-box.second {
    border-color: #C0C0C0;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    height: 180px;
}

.podium-box.third {
    border-color: #CD7F32;
    background: linear-gradient(135deg, #fff5f0 0%, #ffffff 100%);
    height: 160px;
}

.position-label {
    font-size: 1.8em;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
}

.podium-box.first .position-label { color: #FFD700; }
.podium-box.second .position-label { color: #C0C0C0; }
.podium-box.third .position-label { color: #CD7F32; }

.rider-selection {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.empty-selection {
    color: #999;
    font-style: italic;
    font-size: 0.85em;
}

.selected-rider {
    width: 100%;
}

.selected-rider-number {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.selected-rider-name {
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1.3;
}

/* Ya no se usa selected-rider-team */

/* Riders Grid - SIN SCROLL */
.riders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    max-height: none; /* Sin altura máxima = sin scroll */
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.rider-card-selectable {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.rider-card-selectable:hover {
    border-color: #e10600;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rider-card-selectable.selected {
    border-color: #e10600;
    background: #fff5f5;
    opacity: 0.5;
    cursor: not-allowed;
}

.rider-card-number {
    font-size: 1em;
    font-weight: 700;
    color: #666;
    margin-bottom: 6px;
}

.rider-card-name {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 4px;
}

.rider-card-team {
    font-size: 0.7em;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pole Actions - ELIMINADO (botones ahora en header) */

/* No Race Message */
.no-race-message {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-race-message p {
    font-size: 1.2em;
}

/* Podiums Modal */
.poles-container {
    margin-top: 20px;
}

.poles-modal-icon {
    font-size: 1.3em;
    margin-right: 8px;
}

/* No Poles Message */
.no-poles-message {
    text-align: center;
    padding: 60px 20px;
}

.no-poles-icon {
    font-size: 4em;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-poles-message p {
    color: #999;
    font-size: 1.1em;
}

/* Poles Table Container */
.poles-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.poles-table {
    width: 100%;
    border-collapse: collapse;
}

/* Table Header */
.poles-table thead {
    background: linear-gradient(135deg, #e10600 0%, #c10500 100%);
    color: white;
}

.poles-table thead th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poles-table thead .th-team {
    width: 25%;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.poles-table thead .th-rider {
    width: 25%;
    text-align: center;
}

.medal-header {
    font-size: 1.3em;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

/* Table Body */
.poles-table tbody tr {
    transition: background-color 0.2s ease;
}

.pole-row.even {
    background: #ffffff;
}

.pole-row.odd {
    background: #f8f9fa;
}

.pole-row:hover {
    background: #fff5f5;
}

.poles-table tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid #e9ecef;
}

/* Team Cell */
.td-team {
    border-right: 2px solid #e9ecef;
}

.team-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-name {
    font-weight: 700;
    font-size: 1.05em;
    color: #2c3e50;
}

.team-subtitle {
    font-size: 0.85em;
    color: #7f8c8d;
    font-style: italic;
}

/* Rider Cells */
.td-rider {
    text-align: center;
}

.rider-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rider-number {
    font-weight: 700;
    font-size: 1.1em;
    color: #2c3e50;
}

.rider-name {
    font-size: 0.9em;
    color: #555;
}

/* Color backgrounds for positions */
.first-place {
    background: linear-gradient(135deg, #fff9e6 0%, transparent 100%);
}

.second-place {
    background: linear-gradient(135deg, #f5f5f5 0%, transparent 100%);
}

.third-place {
    background: linear-gradient(135deg, #fff5f0 0%, transparent 100%);
}

.pole-row:hover .first-place {
    background: linear-gradient(135deg, #fff3cc 0%, transparent 100%);
}

.pole-row:hover .second-place {
    background: linear-gradient(135deg, #eeeeee 0%, transparent 100%);
}

.pole-row:hover .third-place {
    background: linear-gradient(135deg, #ffe6dc 0%, transparent 100%);
}

/* Poles Summary */
.poles-summary {
    margin-top: 20px;
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.poles-count {
    font-weight: 600;
    color: #666;
    font-size: 0.95em;
}

/* Responsive */
@media (max-width: 768px) {
    .poles-table thead .th-team {
        width: 30%;
    }
    
    .poles-table thead .th-rider {
        width: 23.33%;
        font-size: 0.8em;
        padding: 12px 6px;
    }
    
    .medal-header {
        font-size: 1.1em;
        display: block;
        margin-bottom: 4px;
    }
    
    .poles-table tbody td {
        padding: 12px 6px;
        font-size: 0.9em;
    }
    
    .team-name {
        font-size: 0.95em;
    }
    
    .team-subtitle {
        font-size: 0.75em;
    }
    
    .rider-number {
        font-size: 1em;
    }
    
    .rider-name {
        font-size: 0.8em;
    }
}

.pole-entry {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #f0f0f0;
}

.pole-entry-header {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 4px;
    color: #e10600;
}

.pole-entry-team {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 16px;
}

.pole-riders {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pole-rider-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.pole-rider-position {
    font-weight: 700;
    min-width: 30px;
}

.pole-rider-position.first { color: #FFD700; }
.pole-rider-position.second { color: #C0C0C0; }
.pole-rider-position.third { color: #CD7F32; }

.pole-rider-info {
    flex: 1;
}

.pole-rider-name {
    font-weight: 600;
    font-size: 0.95em;
}

/* Responsive */
@media (max-width: 768px) {
    .pole-header-row {
        flex-direction: column;
        gap: 16px;
    }

    .pole-header-actions {
        width: 100%;
        flex-direction: column;
    }

    .pole-header-actions .btn {
        width: 100%;
    }

    .pole-podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-position {
        width: 100%;
        max-width: 300px;
    }

    .podium-box.first,
    .podium-box.second,
    .podium-box.third {
        height: 180px;
    }
    
    .riders-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .poles-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   MODAL DE ÉXITO PERSONALIZADO
   ============================================================================ */

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
}

.custom-modal {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    text-align: center;
}

.custom-modal-overlay.show .custom-modal {
    transform: scale(1);
}

.success-modal-icon {
    margin-bottom: 20px;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-size: 50px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    animation: checkmarkPop 0.5s ease;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-modal-title {
    font-size: 2em;
    font-weight: 800;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.success-modal-subtitle {
    font-size: 1.2em;
    color: #e10600;
    font-weight: 600;
    margin: 0 0 24px 0;
}

.success-pole-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.success-pole-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    margin: 8px 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.success-pole-medal {
    font-size: 2em;
}

.success-pole-rider {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.success-modal-message {
    font-size: 1em;
    color: #666;
    margin: 20px 0 30px 0;
}

.success-modal-btn {
    padding: 14px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.success-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 6, 0, 0.3);
}
