/* Standings Grid Styles */
.standings-grid-section {
    background: transparent;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.standings-selector-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.standings-selector-wrapper .tier-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.standings-header-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px 40px;
    background: linear-gradient(90deg, #000000, #000000);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(255, 102, 0, 0.3);
}

.standings-logo {
    height: 60px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.standings-main-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    line-height: 60px;
    display: block;
    white-space: nowrap;
}

.standings-grid-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    width: 100%;
    max-width: 1600px;
}

.standings-grid-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(45, 45, 45, 0.95);
    border-radius: 10px;
    overflow: hidden;
    min-width: 1000px;
    margin: 0 auto;
    border: 2px solid rgba(255, 102, 0, 0.4);
}

.standings-grid-table thead th {
    background: linear-gradient(90deg, #ff6600, #ff8533);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    padding: 15px 8px;
    text-align: center;
    color: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 10;
}

.standings-grid-table tbody td {
    background: rgba(45, 45, 45, 0.95);
    padding: 12px 8px;
    text-align: center;
    font-size: 0.95rem;
    min-height: 50px;
    vertical-align: middle;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.standings-grid-table tbody tr:hover td {
    background: rgba(255, 102, 0, 0.2);
}

.standings-grid-table .pos-cell {
    font-weight: bold;
    color: #ffffff;
    width: 60px;
    text-align: center;
}

.standings-grid-table .driver-cell {
    text-align: center;
    font-weight: 500;
    min-width: 150px;
    width: 200px;
}

.standings-grid-table .team-cell {
    text-align: center;
    color: #ffffff;
    font-size: 0.9rem;
    min-width: 120px;
    width: 150px;
}

.standings-grid-table .points-cell {
    font-weight: bold;
    color: #ffffff;
    font-size: 1.1rem;
    width: 80px;
    text-align: center;
}

.standings-grid-table .round-cell {
    padding: 8px 4px;
    width: 70px;
    text-align: center;
    transition: all 0.3s ease;
}

.standings-grid-table .round-cell:hover {
    background: rgba(255, 102, 0, 0.3);
    transform: scale(1.05);
}

.standings-grid-table .round-cell:active {
    transform: scale(0.95);
}

.track-flag {
    display: block;
    margin: 0 auto 4px;
    width: 40px;
    height: 26px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.round-cell:hover .track-flag {
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.5);
    transform: translateY(-2px);
}

.round-fallback {
    font-size: 0.85rem;
    color: #ff8533;
    font-weight: 600;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.round-cell:hover .round-fallback {
    color: #ff6600;
    transform: scale(1.1);
}

.result-cell {
    font-weight: bold;
    font-size: 1rem;
    position: relative;
    width: 70px;
    text-align: center;
}

.result-content {
    position: relative;
    display: inline-block;
}

/* Result color coding */
.result-podium-1 {
    background: linear-gradient(135deg, #FFD700, #cfb000) !important;
    color: #1a1a1a !important;
    box-shadow: 0 0 10px #ffd70080;
}

.result-podium-2 {
    background: linear-gradient(135deg, #d4d4d4, #929292) !important;
    color: #1a1a1a !important;
    box-shadow: 0 0 10px #d4d4d480;
}

.result-podium-3 {
    background: linear-gradient(135deg, #ffae00, #b47b00) !important;
    color: #1a1a1a !important;
    box-shadow: 0 0 10px #ffae0080;
}

.result-points {
    background: linear-gradient(135deg, #4ade80, #3db86a) !important;
    color: #1a1a1a !important;
    box-shadow: 0 0 10px #4ade8080;
}

.result-finish {
    background: rgba(100, 116, 139, 0.8) !important;
    color: #e2e8f0 !important;
}

.result-dnf {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    font-weight: bold;
}

.result-dns {
    background: linear-gradient(135deg, #6e6e6e, #4d4d4d) !important;
    color: #1a1a1a !important;
    font-weight: bold;
}

.result-none {
    background: rgba(30, 30, 30, 0.9) !important;
    color: #666 !important;
}

.fastest-lap-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    color: #a855f7;
    font-size: 0.7rem;
    text-shadow: 0 0 5px rgba(168, 85, 247, 0.8);
}

.fastest-lap-border {
    box-shadow: inset 0 0 0 2px #a855f7;
}

/* Hover effect for clickable round headers */
.standings-grid-table thead th.round-cell {
    position: relative;
}

.standings-grid-table thead th.round-cell::after {
    content: '👁️';
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.9rem;
}

.standings-grid-table thead th.round-cell:hover::after {
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 1200px) {
    .standings-main-title {
        font-size: 2rem;
        line-height: 50px;
    }
    
    .standings-logo {
        height: 50px;
    }
    
    .standings-grid-table {
        font-size: 0.9rem;
    }
    
    .standings-grid-table tbody td {
        padding: 10px 6px;
    }
}

@media (max-width: 768px) {
    .standings-header-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    
    .standings-main-title {
        font-size: 1.5rem;
        line-height: normal;
    }
    
    .standings-grid-table {
        font-size: 0.85rem;
    }
    
    .standings-grid-table tbody td {
        padding: 8px 4px;
    }
    
    .track-flag {
        width: 30px;
        height: 20px;
    }
    
    .driver-cell,
    .team-cell {
        min-width: 100px;
    }
    
    .standings-selector-wrapper .tier-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
}

/* Split result cell for constructors */
.result-split-cell {
    padding: 0 !important;
    position: relative;
    width: 80px;
    height: 80px;
    overflow: hidden;
}

.result-split-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.result-split-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 99.5% 0, 0 99.5%);
}

.result-split-bottom {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(100.5% 0, 100.5% 100.5%, 0 100.5%);
}

.result-split-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.result-split-line::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 141.42%; /* sqrt(2) * 100% for diagonal */
    height: 2px;
    background: #000000;
    transform: translate(-50%, -50%) rotate(45deg);
    transform-origin: center;
}

.result-split-top-content {
    position: absolute;
    top: 10px;
    left: 10px;
    font-weight: bold;
    font-size: 1rem;
    z-index: 3;
}

.result-split-bottom-content {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-weight: bold;
    font-size: 1rem;
    z-index: 3;
}

/* Color classes for split cells - now using background-color instead of border-color */
.split-podium-1-top {
    background: linear-gradient(135deg, #FFD700, #cfb000) !important;
}

.split-podium-2-top {
    background: linear-gradient(135deg, #d4d4d4, #929292) !important;
}

.split-podium-3-top {
    background: linear-gradient(135deg, #ffae00, #b47b00) !important;
}

.split-points-top {
    background: linear-gradient(135deg, #4ade80, #3db86a) !important;
}

.split-finish-top {
    background-color: rgba(100, 116, 139, 0.8) !important;
}

.split-dnf-top {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.split-dns-top {
    background: linear-gradient(135deg, #6e6e6e, #4d4d4d) !important;
}

.split-none-top {
    background: linear-gradient(135deg, #6e6e6e, #4d4d4d) !important;
}

/* Color classes for split cells - bottom */
.split-podium-1-bottom {
    background: linear-gradient(135deg, #FFD700, #cfb000) !important;
}

.split-podium-2-bottom {
    background: linear-gradient(135deg, #d4d4d4, #929292) !important;
}

.split-podium-3-bottom {
    background: linear-gradient(135deg, #ffae00, #b47b00) !important;
}

.split-points-bottom {
    background: linear-gradient(135deg, #4ade80, #3db86a) !important;
}

.split-finish-bottom {
    background-color: rgba(100, 116, 139, 0.8) !important;
}

.split-dnf-bottom {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.split-dns-bottom {
    background: linear-gradient(135deg, #6e6e6e, #4d4d4d) !important;
}

.split-none-bottom {
    background: linear-gradient(135deg, #6e6e6e, #4d4d4d) !important;
}

/* Text colors for split cells */
.split-text-dark {
    color: #1a1a1a !important;
}

.split-text-light {
    color: #ffffff !important;
}

.split-text-gray {
    color: #666 !important;
}

/* Fastest lap indicator for split cells */
.split-fastest-lap-top .result-split-top-content::before {
    content: '◉ ';
    color: #a855f7;
    font-size: 0.6rem;
    text-shadow: 0 0 5px rgba(168, 85, 247, 0.8);
    margin-right: 2px;
}

.split-fastest-lap-bottom .result-split-bottom-content::after {
    content: ' ◉';
    color: #a855f7;
    font-size: 0.6rem;
    text-shadow: 0 0 5px rgba(168, 85, 247, 0.8);
    margin-left: 2px;
}