/* ================= FILTER BAR ================= */

/* Light Theme */
body.site-light .match-tabs .nav-link {
    background-color: #f9f9f9;
    border-color: #ddd;
}

/* Dark Theme */
body.site-dark .match-tabs .nav-link {
    background-color: #121314;
    border-color: #444;
    color: #fff;
}


.pointsFilter {
    align-items: center;
}

@media (min-width: 768px) {
    .pointsFilter {
        display: grid;
        grid-template-columns: 160px 140px 1fr 120px;
        gap: 10px;
    }
}

@media (max-width: 767px) {
    .pointsFilter {
        display: flex;
        flex-direction: column;
    }
}

.filters,
.points-table-submit-btn {
    height: 42px !important;
    border-radius: 5px;
}

.filters {
    border-color: #2575fc;
}

/* Light Theme */
body.site-light .filters {
    background-color: #f0f0f0;
    color: #333;
}

/* Dark Theme */
body.site-dark .filters {
    background-color: #2c2f33;
    color: #fff;
}

.team-full-width {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-transform: none;
}

/* ================= MATCH ROW ================= */

.ipl-row {
    display: grid;
    grid-template-columns: 240px 1fr 180px;
    gap: 20px;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid #eee;
}

/* Light Theme */
body.site-light .ipl-row {
    border-bottom: 1px solid #ddd;
}

/* Dark Theme */
body.site-dark .ipl-row {
    border-bottom: 1px solid #444;
}

@media (max-width: 767px) {
    .ipl-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ================= LEFT TIMELINE ================= */

.ipl-left {
    position: relative;
    padding-left: 24px;
    border-left: 2px dotted #2ecc71;
}

/* Light Theme */
body.site-light .ipl-left {
    border-left: 2px dotted #2ecc71;
}

/* Dark Theme */
body.site-dark .ipl-left {
    border-left: 2px dotted #38d1d1;
}

@media (max-width: 767px) {
    .ipl-left {
        padding-left: 0;
        border-left: none;
    }
}

.ipl-dot {
    position: absolute;
    left: -6px;
    top: 34px;
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border-radius: 50%;
}

@media (max-width: 767px) {
    .ipl-dot {
        display: none;
    }
}

.ipl-match-tag {
    border: 1px solid #2ecc71;
    color: #2ecc71;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

/* Light Theme */
body.site-light .ipl-match-tag {
    background-color: #e7f4e1;
}

/* Dark Theme */
body.site-dark .ipl-match-tag {
    background-color: #1b3531;
}

.ipl-result {
    margin-top: 6px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

/* ================= MATCH CARD ================= */

.ipl-card {
    background: #fff;
    padding: 18px 24px;
    border-radius: 12px;
    min-height: 200px; /* Uniform height for all cards */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Light Theme */
body.site-light .ipl-card {
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

/* Dark Theme */
body.site-dark .ipl-card {
    background: #121314;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.ipl-meta {
    font-size: 14px;
    font-weight: 600;
}

.ipl-meta small {
    font-size: 12px;
    color: #777;
    font-weight: 400;
}

/* ================= TEAMS ================= */

.ipl-teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 36px;
    margin-top: 14px;
}

@media (max-width: 767px) {
    .ipl-teams {
        flex-direction: column;
        gap: 14px;
    }
}

.ipl-team {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: center;
}

/* Team text splitting logic */
.ipl-team span, .scorecard-team {
    white-space: normal !important; /* Allows wrapping */
    word-wrap: break-word;
    display: inline-block;
    max-width: 120px; /* Forces wrap at the space for team names */
    line-height: 1.2;
}

.ipl-team img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.ipl-score {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap; /* Keep numbers together */
}

.ipl-vs {
    font-weight: 700;
    opacity: 0.6;
}

/* ================= ACTION ================= */

.ipl-action {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 767px) {
    .ipl-action {
        justify-content: center;
    }
}

.ipl-btn {
    background: #ff4d2d;
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ipl-btn:hover {
    background: #e63b1e;
}

/* ================= MATCH TABS ================= */

.margin-match{
    margin-bottom: 2%;
}

/* Light Theme */
body.site-light .match-tabs {
    background-color: #fff;
    border: none;
    border-radius: 20px;
}

body.site-light .match-tabs .nav-link {
    background-color: transparent;
    border: none;
    color: #333;
    text-align: center;
}

/* Dark Theme */
body.site-dark .match-tabs {
    background-color: #d5d7d8;
    border: none;
    border-radius: 20px;
}

body.site-dark .match-tabs .nav-link {
    background-color: transparent;
    border: none;
    color: #333;
    text-align: center;
}

/* ================= MATCH TABS WRAPPER ================= */
.ipl-matches-tabs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border-bottom: none;
}

.match-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0;
}

/* Tab Link Styling */
.match-tabs .nav-link {
    padding: 12px 30px;
    font-weight: 700;
    font-size: 12px; /* Laptop default */
    text-transform: uppercase;
    background: transparent;
    border-radius: 0;
    transition: all 0.3s ease-in-out;
}

/* ================= SCROLLABLE AREAS ================= */

/* Makes Points Table, Fixtures, and Playoffs diagram scrollable */
.points_table_container, 
.ipl-matches-tabs + div, 
.playoffs-container,
.match-table-wrapper,
.ipl-playoffs-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

/* Prevent internal squashing */
.match-table, .points_table_container table {
    min-width: 600px; 
}

/* ================= TIMER FORMAT ================= */

.ipl-countdown {
    display: flex;
    gap: 10px;
}

.cd-box {
    background: #f4f4f4;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cd-val {
    font-size: 16px;
    font-weight: 700;
    color: #2575fc;
    line-height: 1;
}

.cd-label {
    font-size: 9px;
    color: #666;
    text-transform: uppercase;
}

.ipl-live-badge {
    background: #2575fc;
    color: #fff;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    letter-spacing: 3px;
    animation: pulse 1.2s infinite;
    width: fit-content;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(225,29,72,.6); }
    70% { box-shadow: 0 0 0 8px rgba(225,29,72,0); }
    100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); }
}


/* ================= FINAL RESPONSIVE FIXES ================= */

* { box-sizing: border-box; }

/* Global spacing for filters */
.pointsFilter {
    row-gap: 20px !important; 
    display: flex !important;
    flex-direction: column !important;
}

@media (min-width: 768px) {
    .pointsFilter {
        display: grid !important;
        grid-template-columns: 160px 140px 1fr 120px !important;
        gap: 15px !important;
    }
}

/* Tablet Layout Fixes (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .match-tabs .nav-link {
        font-size: 10px !important;
        padding: 10px 5px !important;
        white-space: nowrap !important;
    }

    .ipl-row {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .ipl-teams {
        flex-direction: row !important;
        justify-content: center !important;
    }
}

/* Mobile Layout Fixes (under 768px) */
@media (max-width: 767px) {
    /* FORCE NAV ITEMS INTO ONE HORIZONTAL LINE */
    .match-tabs {
        display: flex !important;
        flex-wrap: nowrap !important; /* No splitting into 2 lines */
        justify-content: space-around !important;
        width: 100% !important;
        overflow: hidden !important; /* No scroll, force everything to fit */
    }

    .match-tabs .nav-link {
        font-size: 8px !important; /* Small mobile font */
        padding: 8px 1px !important; /* Tight padding to fit */
        flex: 1;
        white-space: nowrap !important; /* No line breaks in text */
        text-align: center;
    }

    .ipl-card {
        min-height: auto;
        padding: 15px 10px !important;
    }

    .ipl-teams {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px !important;
    }
}

/* Breadcrumb Styling */
.ipl-breadcrumb-nav .breadcrumb {
    background: transparent;
    padding: 10px 0;
    margin-bottom: 40px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.ipl-breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
    content: ">>"; /* Or use "/" */
    color: #6c757d;
}

.ipl-breadcrumb-nav .breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.ipl-breadcrumb-nav .breadcrumb-item a:hover {
    text-decoration: underline;
}

.ipl-breadcrumb-nav .breadcrumb-item.active {
    color: #6c757d;
    pointer-events: none;
}