/* ==============================================
   series.css - Series page styles
   ============================================== */

/* ============================================================
   SECTION 1: HOMEPAGE SERIES GRID (ALL TILES SHOWN)
   ============================================================ */

.series-slideshow-wrapper {
    position: relative;
    width: 100%;
    padding: 10px 0 20px;
}

.series-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.series-place-card {
    background: linear-gradient(180deg, #1e1e1e, #181818);
    border: 2px solid rgba(0,191,255,0.35);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.series-place-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.55), 0 0 20px rgba(0,191,255,0.35);
}

/* Thumbnail */
.series-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
    overflow: hidden;
}

.series-event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.75);
    display: block;
    transition: transform 0.3s ease;
}

.series-place-card:hover .series-event-image {
    transform: scale(1.05);
}

/* Sim logo positioned over thumbnail */
.series-thumbnail .sim-logo {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 36px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 4px;
    border-radius: 5px;
    z-index: 2;
    pointer-events: none;
}

/* Series info */
.series-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.series-org-badge {
    display: inline-block;
    background: rgba(0, 191, 255, 0.15);
    border: 1px solid rgba(0, 191, 255, 0.4);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.65rem;
    color: #00bfff;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: fit-content;
}

.series-org-badge.pnr-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 1px solid #FF8C00;
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.35);
}

.event-org-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-block;
    background: rgba(0, 191, 255, 0.9);
    border: 1px solid rgba(0, 191, 255, 0.6);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.65rem;
    color: #000;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    max-width: fit-content;
    z-index: 10;
}

.event-org-badge:empty {
    display: none;
}

.event-org-badge.pnr-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 1px solid #FF8C00;
    color: #000;
}

.series-title {
    font-family: 'Audiowide', sans-serif;
    font-size: 1rem;
    color: #fff;
    margin: 0;
    font-weight: 900;
}

.series-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.series-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.series-meta-label {
    font-size: 0.78rem;
    color: #888;
}

/* Action buttons */
.series-actions {
    padding: 20px 12px;
    display: flex;
    gap: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
}

.series-actions .details-btn,
.series-actions .join-btn {
    flex: 1 1 auto;
    padding: 15px 15px;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 175px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.show-all-button {
    margin: 10px 0 20px;
}

/* ============================================================
   SECTION 2: SERIES PAGE STYLES
   ============================================================ */

body.series-page .banner { display: none; }
body.series-page .content { padding-top: 0; }
body.series-page .page-container { max-width: 100%; padding: 0; }
body.series-page .page-container > h1 { display: none; }

/* ── Hero ── */
.series-hero {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
}

.series-hero img.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.35);
    display: block;
}

.series-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.92) 35%, rgba(0,0,0,0.3) 100%);
}

.series-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.series-sim-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0,191,255,0.12);
    border: 1px solid rgba(0,191,255,0.4);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 0.68rem;
    color: #00bfff;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.series-hero-title {
    font-family: 'Audiowide', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-stat {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 8px 16px;
    text-align: center;
    min-width: 90px;
}

.hero-stat-value {
    font-size: 1.1rem;
    font-weight: 900;
    color: #00bfff;
    font-family: 'Audiowide', sans-serif;
    display: block;
}

.hero-stat-label {
    font-size: 0.6rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 2px;
    display: block;
}

.toggle-link {
    font-size: 0.75rem;
    color: #888;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    padding: 8px 16px;
    transition: all 0.2s;
    white-space: nowrap;
}

.toggle-link:hover { color: #00bfff; border-color: rgba(0,191,255,0.3); text-decoration: none; }

/* ── Progress bar ── */
.round-progress-wrap {
    background: rgba(0,0,0,0.5);
    border-top: 1px solid rgba(0,191,255,0.12);
    border-bottom: 1px solid rgba(0,191,255,0.12);
}

.round-progress-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.round-label {
    font-size: 0.68rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.round-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.07);
    border-radius: 2px;
    overflow: hidden;
}

.round-fill {
    height: 100%;
    background: linear-gradient(90deg, #00bfff, #0077aa);
    border-radius: 2px;
}

.round-fraction {
    font-size: 0.72rem;
    color: #00bfff;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Page wrapper ── */
.series-page-wrapper {
    max-width: 1300px;
    min-width: min(1100px, 100%);
    margin: 0 auto;
    padding: 24px 24px 60px;
    box-sizing: border-box;
}

.section-title {
    font-family: 'Audiowide', sans-serif;
    font-size: 0.72rem;
    color: #00bfff;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ── Event cards ── */
.series-events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    margin: 0 auto 28px;
    padding: 0;
}

/* Event cards now use event-place-card styling from events.css */
.series-events-grid .event-place-card {
    border: 2px solid rgba(0,191,255,0.35);
}

.series-events-grid .event-place-card.finished {
    opacity: 0.85;
    border-color: rgba(255,255,255,0.15);
}

/* Badge positioning in series event cards */
.series-events-grid .event-org-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.series-events-grid .ev-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
    z-index: 9;
}

.ev-badge-finished { background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.12); color: #777; }
.ev-badge-upcoming { background: rgba(0,191,255,0.15); border: 1px solid rgba(0,191,255,0.4); color: #00bfff; }

/* Responsive grid */
@media (max-width: 1200px) {
    .series-events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .series-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .series-events-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Pagination ── */
.series-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 36px;
}

.page-btn {
    padding: 8px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #888;
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.2s;
}

.page-btn:hover { border-color: rgba(0,191,255,0.3); color: #00bfff; text-decoration: none; }
.page-current { color: #00bfff; font-weight: 700; font-size: 0.82rem; }

/* ── Standings ── */
.series-standings { margin-top: 8px; }

.standings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.class-select {
    background: #1e1e1e;
    border: 1px solid rgba(0,191,255,0.3);
    border-radius: 6px;
    color: #fff;
    padding: 7px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
}

/* ── Podium ── */
.standings-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 180px;
    margin-bottom: 24px;
}

.standings-podium-slot { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 220px; }
.standings-podium-info { text-align: center; margin-bottom: 8px; }

.standings-podium-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.standings-podium-pts { font-size: 0.72rem; color: #00bfff; margin-top: 3px; font-weight: 700; }

.standings-podium-block {
    width: 100%;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.sp1 .standings-podium-block { height: 100px; background: linear-gradient(180deg, rgba(255,215,0,0.2), rgba(255,215,0,0.05)); border: 2px solid rgba(255,215,0,0.4); border-bottom: none; }
.sp2 .standings-podium-block { height: 70px; background: linear-gradient(180deg, rgba(192,192,192,0.18), rgba(192,192,192,0.04)); border: 2px solid rgba(192,192,192,0.3); border-bottom: none; }
.sp3 .standings-podium-block { height: 50px; background: linear-gradient(180deg, rgba(205,127,50,0.18), rgba(205,127,50,0.04)); border: 2px solid rgba(205,127,50,0.3); border-bottom: none; }

.podium-base-line { height: 2px; background: rgba(0,191,255,0.1); margin-bottom: 24px; }

/* ── Standings table ── */
.standings-table-wrap {
    background: linear-gradient(180deg, #1e1e1e, #181818);
    border: 2px solid rgba(0,191,255,0.2);
    border-radius: 10px;
    overflow: hidden;
}

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

.standings-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #00bfff;
    border-bottom: 1px solid rgba(0,191,255,0.15);
}

.standings-table td {
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.85rem;
    color: #ccc;
}

.standings-table tr:last-child td { border-bottom: none; }
.standings-table tbody tr:nth-child(1) td { background: rgba(255,215,0,0.04); }
.standings-table tbody tr:nth-child(2) td { background: rgba(192,192,192,0.03); }
.standings-table tbody tr:nth-child(3) td { background: rgba(205,127,50,0.03); }
.standings-table tr:hover td { background: rgba(0,191,255,0.04) !important; }

.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
}

.pb1 { background: rgba(255,215,0,0.15); color: #ffd700; border: 1px solid rgba(255,215,0,0.4); }
.pb2 { background: rgba(192,192,192,0.15); color: #c0c0c0; border: 1px solid rgba(192,192,192,0.35); }
.pb3 { background: rgba(205,127,50,0.15); color: #cd7f32; border: 1px solid rgba(205,127,50,0.35); }
.pb-other { background: rgba(255,255,255,0.04); color: #666; border: 1px solid rgba(255,255,255,0.1); }

.driver-link { color: #00bfff; text-decoration: none; }
.driver-link:hover { text-decoration: underline; }

.points-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0,191,255,0.08);
    border: 1px solid rgba(0,191,255,0.2);
    border-radius: 4px;
    color: #00bfff;
    font-weight: 700;
    font-size: 0.8rem;
}

.full-standings-btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 12px;
    border-radius: 6px;
    font-family: 'Termina', sans-serif;
}

.full-standings-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 16px rgba(13,110,253,0.3); text-decoration: none; color: #fff; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .series-slideshow-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .series-cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .series-hero { height: 210px; }
    .series-hero-title { font-size: 1.3rem; }
    .series-hero-content { flex-direction: column; align-items: flex-start; gap: 10px; }
    .hero-stats { gap: 6px; }
    .hero-stat { min-width: 75px; padding: 6px 10px; }
    .series-events-grid { grid-template-columns: 1fr; }
    .standings-podium { height: 140px; }
    .standings-podium-name { max-width: 100px; font-size: 0.78rem; }
    .series-page-wrapper { padding: 16px 16px 40px; }

    /* ── Series card grid on tablet ── */
    .series-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .series-thumbnail {
        height: 150px;
    }
    
    .series-title {
        font-size: 0.92rem;
    }
}

@media (max-width: 480px) {
    .series-cards-container {
        grid-template-columns: 1fr;
    }
}