/* ===========================
   Standings Page Styles
   =========================== */

.standings-section {
    padding: 80px 5vw 120px;
    min-height: 100vh;
    background: #1a0d2e;
    position: relative;
}

.standings-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Section Header - giống experience/locations */
.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-header .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin: 0 0 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--muted);
    line-height: 1.6;
}

/* ===========================
   Podium Layout
   =========================== */

.podium-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
    align-items: end;
}

.podium-card {
    background: linear-gradient(180deg, rgba(30, 20, 50, 0.4) 0%, rgba(20, 10, 35, 0.8) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Springy transition */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Animated gradient border overlay */
.podium-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, transparent 0%, var(--card-accent, rgba(255, 255, 255, 0.1)) 50%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Dynamic floating hover effect */
.podium-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--card-hover-glow, rgba(164, 97, 255, 0.15));
    border-color: transparent;
    /* Handled by pseudo element now */
}

.podium-card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, var(--card-accent) 0%, transparent 50%, var(--card-accent) 100%);
}

/* Position Specific Styles & Glows */
.rank-1 {
    --card-accent: #ffd700;
    --card-hover-glow: rgba(255, 215, 0, 0.25);
    grid-column: 3;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, rgba(20, 10, 35, 0.9) 100%);
    padding: 3rem 1.5rem;
    z-index: 3;
}

.rank-2 {
    --card-accent: #e0e0e0;
    --card-hover-glow: rgba(224, 224, 224, 0.2);
    grid-column: 2;
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.08) 0%, rgba(20, 10, 35, 0.85) 100%);
    z-index: 2;
}

.rank-3 {
    --card-accent: #cd7f32;
    --card-hover-glow: rgba(205, 127, 50, 0.2);
    grid-column: 4;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.08) 0%, rgba(20, 10, 35, 0.85) 100%);
    z-index: 2;
}

.rank-4 {
    --card-accent: #a461ff;
    --card-hover-glow: rgba(164, 97, 255, 0.15);
    grid-column: 1;
    z-index: 1;
}

.rank-5 {
    --card-accent: #a461ff;
    --card-hover-glow: rgba(164, 97, 255, 0.15);
    grid-column: 5;
    z-index: 1;
}

/* Podium Position Badge */
.podium-position {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 50%;
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 0;
    color: var(--text);
    border: 3px solid var(--card-accent);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.rank-1 .podium-position {
    top: -32px;
    width: 64px;
    height: 64px;
    font-size: 2rem;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.5);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.rank-1 .podium-position svg {
    display: none;
}

/* Driver Avatar */
.driver-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--card-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
}

.rank-1 .driver-avatar {
    width: 120px;
    height: 120px;
    border-width: 4px;
}

.driver-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Driver Info */
.driver-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.rank-1 .driver-info h3 {
    font-size: 1.375rem;
}

.driver-username {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-bottom: 0.75rem;
}

/* Driver Flag */
.driver-flag {
    margin: 0.75rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20px;
}

.driver-flag img {
    height: 16px;
    width: auto;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Rank Badge */
.driver-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.rank-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-block;
    color: #000;
}

.rank-badge.small {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
}

/* Removed Rank Tier and Badge specific coloring since they are removed from UI */

/* Driver Stats */
.driver-stats {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Override global .stat-item animation from main styles.css */
/* Ensure stats always visible in podium cards */
.podium-card .stat-item,
.driver-stats .stat-item {
    text-align: center;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    /* Increased size */
    font-weight: 800;
    /* Bolder */
    color: #ffffff;
    /* Pure white for max contrast */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    /* Subtle shadow for lift */
}

.stat-highlight {
    grid-column: 1 / -1;
    background: rgba(164, 97, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px solid rgba(164, 97, 255, 0.2);
}

.stat-highlight .stat-value {
    color: var(--accent-cyan);
    font-size: 1.5rem;
}

/* ===========================
   Filters
   =========================== */

.standings-filters {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.standings-filters h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #fff;
}

.filter-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.filter-item label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.select-selected {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

/* Arrow icon */
.select-selected::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
    transition: transform 0.3s ease;
}

.custom-select.open .select-selected::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select:hover .select-selected,
.custom-select.open .select-selected {
    border-color: var(--accent-cyan);
    background: rgba(164, 97, 255, 0.1);
}

/* Dropdown options container */
.select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(164, 97, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.custom-select.open .select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Individual option */
.select-option {
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.select-option:last-child {
    border-bottom: none;
}

.select-option:hover {
    background: linear-gradient(135deg, rgba(164, 97, 255, 0.15) 0%, rgba(164, 97, 255, 0.15) 100%);
    color: #fff;
    padding-left: 1.25rem;
}

.select-option.selected {
    background: linear-gradient(135deg, rgba(164, 97, 255, 0.25) 0%, rgba(164, 97, 255, 0.25) 100%);
    color: var(--accent-cyan);
    font-weight: 600;
}

.select-option.selected::before {
    content: '✓';
    margin-right: 0.5rem;
    color: var(--accent-cyan);
}

/* ===========================
   Standings Table
   =========================== */

.standings-table-wrapper {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

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

.standings-table thead {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(164, 97, 255, 0.3);
}

.standings-table th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.standings-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.standings-table tbody tr:hover {
    background: rgba(164, 97, 255, 0.05);
}

.standings-table td {
    padding: 1.25rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
}

.position-cell {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--accent-cyan);
}

.driver-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.driver-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.driver-cell>div {
    display: flex;
    flex-direction: column;
}

.driver-name {
    font-weight: 600;
    color: #fff;
    display: block;
    margin-bottom: 0.125rem;
}

.driver-sub {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
}

.points-cell {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--accent-cyan);
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 1200px) {
    .podium-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }

    .podium-card {
        flex: 0 0 auto;
        /* Allow sizing based on content/width */
        width: 30%;
        /* Target 3 columns roughly */
        min-width: 220px;
        /* Reduced from 250px to fit 3 cols on smaller tablets */
    }

    /* Maintain correct podium visual order: 2 - 1 - 3 */
    .rank-2 {
        order: 1;
    }

    .rank-1 {
        order: 2;
    }

    .rank-3 {
        order: 3;
    }

    /* Bottom row */
    .rank-4 {
        order: 4;
    }

    .rank-5 {
        order: 5;
    }

    /* Reset grid columns as we are using flex */
    .rank-1,
    .rank-2,
    .rank-3,
    .rank-4,
    .rank-5 {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .section-header h2 {
        font-size: 2rem;
    }

    .podium-container {
        display: grid;
        /* Restore grid for mobile stack */
        grid-template-columns: minmax(auto, 500px);
        justify-content: center;
        gap: 1rem;
    }

    .podium-card {
        width: 100%;
        /* Reset width from tablet view */
    }

    .rank-1,
    .rank-2,
    .rank-3,
    .rank-4,
    .rank-5 {
        grid-column: auto;
    }

    .rank-1 {
        order: 1;
    }

    .rank-2 {
        order: 2;
    }

    .rank-3 {
        order: 3;
    }

    .rank-4 {
        order: 4;
    }

    .rank-5 {
        order: 5;
    }

    .filter-group {
        grid-template-columns: 1fr;
    }

    .standings-table-wrapper {
        overflow-x: auto;
    }

    .standings-table {
        min-width: 600px;
    }

    .standings-table th,
    .standings-table td {
        padding: 1rem;
        font-size: 0.875rem;
    }

    .driver-cell {
        gap: 0.75rem;
    }

    .driver-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .driver-thumb {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .standings-section {
        padding: 100px 0 60px;
    }

    .standings-container {
        padding: 0 1rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .podium-card {
        padding: 1.5rem 1rem;
    }

    .driver-avatar {
        width: 80px;
        height: 80px;
    }

    .rank-1 .driver-avatar {
        width: 100px;
        height: 100px;
    }

    .podium-position {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        top: 0.75rem;
        left: 0.75rem;
    }

    .driver-info h3 {
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .standings-filters {
        padding: 1rem;
        border-radius: 12px;
    }

    .standings-filters h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

/* Responsive - Mobile nhỏ (375px) */
@media (max-width: 375px) {
    .standings-section {
        padding: 90px 0 40px;
    }

    .standings-container {
        padding: 0 0.75rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .eyebrow {
        font-size: 0.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .podium-card {
        padding: 1.25rem 0.75rem;
        border-radius: 16px;
    }

    .podium-container {
        gap: 0.75rem;
    }

    .driver-avatar {
        width: 70px;
        height: 70px;
    }

    .rank-1 .driver-avatar {
        width: 90px;
        height: 90px;
    }

    .driver-stats {
        gap: 0.5rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .standings-table {
        min-width: 500px;
    }

    .standings-table th,
    .standings-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .driver-thumb {
        width: 28px;
        height: 28px;
    }

    .driver-name {
        font-size: 0.875rem;
    }

    .driver-sub {
        font-size: 0.75rem;
    }
}

/* ===========================
   Pagination
   =========================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(164, 97, 255, 0.15);
    border-color: var(--accent-cyan);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-color: transparent;
    color: #000;
    font-weight: 600;
}

.pagination-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 0 1rem;
}