/* ===========================================
   Schedule Page Styles
   =========================================== */

/* Các biến bổ sung cho schedule (không override main styles) */
:root {
    --bg-dark: #0a0a0f;
    --bg-medium: #12121a;
    --bg-light: #1a1a24;
    --accent-cyan: #a461ff;
    --accent-purple: #a461ff;
    --accent-gold: #ffd700;
    --accent-red: #ff4444;
    --accent-green: #00ff88;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    /* Sử dụng --gradient từ main styles.css */
}

/* Schedule Section (giống experience/locations) */
.schedule-section {
    padding: 80px 5vw 120px;
    background: #1a0d2e;
    position: relative;
    min-height: 100vh;
}

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

/* Section Header (giống các trang khác) */
.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-description {
    font-size: 1.2rem;
    color: var(--muted);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* Next Race Section */
.next-race-section {
    padding: 2rem 0 3rem;
}

.next-race-card {
    background: var(--bg-medium);
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.next-race-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.next-race-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.next-race-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.next-race-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 215, 0, 0.2);
    color: var(--accent-gold);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.next-race-badge.live-badge {
    background: rgba(255, 68, 68, 0.2);
    color: var(--accent-red);
    animation: pulse 2s infinite;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--accent-red);
    border-radius: 50%;
    display: inline-block;
}

.next-race-header.live-header {
    align-items: center;
}

.next-race-card.live-card {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.05) 0%, var(--bg-medium) 100%);
}

.next-race-card.live-card::before {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.1) 0%, transparent 50%);
}

.next-race-countdown {
    display: flex;
    gap: 1rem;
}

.countdown-item {
    text-align: center;
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    min-width: 70px;
}

.countdown-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-cyan);
    display: block;
}

.countdown-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.next-race-info {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.next-race-flag {
    width: 80px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.next-race-details h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.next-race-track {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.next-race-game {
    display: inline-block;
    background: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--accent-purple);
    margin-top: 0.5rem;
}

/* Track Circuit Images */
.track-circuit-image {
    margin-left: auto;
    padding: 0;
}

.track-circuit-image img {
    width: 100%;
    max-width: 650px;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.track-circuit-image:hover img {
    opacity: 1;
    filter: brightness(1.1);
}

/* Track Circuit Thumbnail (for race cards) */
.track-circuit-thumb {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-circuit-thumb img {
    width: 150px;
    height: auto;
    max-height: 90px;
    object-fit: contain;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.race-card:hover .track-circuit-thumb img {
    opacity: 1;
}

.next-race-schedule {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Qualify link button - sits beside schedule-event items */
.qualify-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
}

.qualify-link-btn:hover {
    background: rgba(255, 215, 0, 0.18);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.2);
}

.qualify-link-btn svg {
    transition: transform 0.25s ease;
}

.qualify-link-btn:hover svg {
    transform: translateX(4px);
}

.schedule-event {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.event-icon {
    font-size: 1.5rem;
}

.event-info {
    flex: 1;
}

.event-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-datetime {
    font-weight: 600;
    color: var(--text-primary);
}

/* Filters */
.schedule-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    min-width: 180px;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

/* Schedule List */

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.loading-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Race Card */
.race-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1.5rem;
    align-items: center;
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.race-card:hover {
    border-color: var(--accent-cyan);
    filter: brightness(1.1);
}

.race-card.completed {
    opacity: 0.6;
}

.race-card.live {
    border-color: var(--accent-red);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
}

.race-round {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.round-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.round-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.race-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.race-track {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.track-flag {
    width: 40px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.track-name {
    font-size: 1.25rem;
    font-weight: 600;
}

.race-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.meta-tag.game {
    color: var(--accent-purple);
}

.meta-tag.series {
    color: var(--accent-cyan);
}

.race-times {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 200px;
}

.time-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.time-row.qualifying {
    border-left: 3px solid var(--accent-purple);
}

.time-row.race {
    border-left: 3px solid var(--accent-gold);
}

.time-icon {
    font-size: 1.25rem;
}

.time-details {
    flex: 1;
}

.time-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.time-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.upcoming {
    background: rgba(164, 97, 255, 0.1);
    color: var(--accent-cyan);
}

.status-badge.live {
    background: rgba(255, 68, 68, 0.2);
    color: var(--accent-red);
}

.status-badge.completed {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent-green);
}

/* Responsive - Tablet (1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .schedule-section {
        padding: 120px 4vw 100px;
    }

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

    .next-race-card {
        padding: 1.5rem;
    }

    .countdown-item {
        min-width: 60px;
        padding: 0.5rem 0.75rem;
    }

    .countdown-value {
        font-size: 1.5rem;
    }

    .race-times {
        min-width: 180px;
    }
}

/* Responsive - Tablet nhỏ (768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .schedule-section {
        padding: 100px 4vw 80px;
    }

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

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

    .next-race-header {
        flex-direction: column;
        gap: 1rem;
    }

    .next-race-countdown {
        justify-content: center;
        flex-wrap: wrap;
    }

    .countdown-item {
        min-width: 55px;
        padding: 0.5rem;
    }

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

    .next-race-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .next-race-flag {
        width: 60px;
        height: 40px;
    }

    .next-race-details h2 {
        font-size: 1.5rem;
    }

    .next-race-schedule {
        grid-template-columns: 1fr;
    }

    .schedule-filters .container {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        width: 100%;
        min-width: unset;
    }

    .race-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }

    .race-round {
        margin: 0 auto;
        width: 60px;
        height: 60px;
    }

    .round-number {
        font-size: 1.5rem;
    }

    .race-track {
        flex-direction: column;
        gap: 0.5rem;
    }

    .track-name {
        font-size: 1.1rem;
    }

    .race-meta {
        justify-content: center;
    }

    .race-times {
        width: 100%;
        min-width: unset;
    }

    .time-row {
        padding: 0.5rem;
    }
}

/* Responsive - Mobile lớn (576px) */
@media (max-width: 576px) {
    .schedule-section {
        padding: 90px 3vw 60px;
    }

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

    .section-header .eyebrow {
        font-size: 0.75rem;
    }

    .next-race-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .next-race-countdown {
        gap: 0.5rem;
    }

    .countdown-item {
        min-width: 50px;
        padding: 0.5rem 0.25rem;
    }

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

    .countdown-label {
        font-size: 0.6rem;
    }

    .next-race-details h2 {
        font-size: 1.25rem;
    }

    .next-race-track {
        font-size: 1rem;
    }

    .next-race-game {
        font-size: 0.75rem;
    }

    .schedule-event {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .event-icon {
        font-size: 1.25rem;
    }

    .event-datetime {
        font-size: 0.875rem;
    }

    .schedule-filters {
        top: 60px;
        padding: 1rem 0;
    }

    .race-card {
        border-radius: 12px;
    }

    .meta-tag {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .status-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Responsive - Mobile nhỏ (375px) */
@media (max-width: 375px) {
    .schedule-container {
        padding: 0 0.75rem;
    }

    .schedule-section {
        padding: 80px 2vw 40px;
    }

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

    .section-description {
        font-size: 0.875rem;
    }

    .countdown-item {
        min-width: 45px;
    }

    .countdown-value {
        font-size: 1rem;
    }

    .next-race-flag {
        width: 50px;
        height: 34px;
    }

    .next-race-details h2 {
        font-size: 1.1rem;
    }

    .race-round {
        width: 50px;
        height: 50px;
    }

    .round-number {
        font-size: 1.25rem;
    }

    .track-name {
        font-size: 1rem;
    }

    .time-value {
        font-size: 0.8rem;
    }
}