/**
 * Cricket Match Widget Styles
 * Matches the reference design with carousel
 */

/* Category Pills (International/Domestic) – separate divider so hover does not disrupt the line */
.category-pills-wrapper {
    width: 100%;
    margin-bottom: 12px;
}

.category-pills-container {
    display: flex;
    gap: 0;
    width: 100%;
    position: relative;
}

/* Divider is its own element so tab hover background never overlaps it */
.category-pills-divider {
    height: 2px;
    width: 100%;
    background: #e5e7eb;
    margin-top: -2px;
    position: relative;
    z-index: 0;
    flex-shrink: 0;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
    position: relative;
    z-index: 1;
    border-radius: 6px 6px 0 0;
    isolation: isolate; /* stacking context so ::before z-index: -1 stays behind label */
}

/* Hover: background behind text, stops above the divider so the line is never disrupted */
.category-pill::before {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    top: 4px;
    bottom: 2px; /* do not cover bottom 2px – divider stays visible */
    background: transparent;
    border-radius: 4px 4px 0 0;
    pointer-events: none;
    transition: background-color 0.2s ease;
    z-index: -1; /* behind label so "International" / "Domestic" text always visible */
}

.category-pill:hover {
    color: #374151;
}

.category-pill:hover::before {
    background: #f3f4f6;
}

.category-pill.active {
    color: #2965ff;
    border-bottom-color: #2965ff;
    background: transparent;
}

.category-pill.active:hover::before {
    background: #eff6ff;
}

.category-pill.active:hover {
    border-bottom-color: #2965ff;
}

/* Competition Pills Container */
.competition-pills-container {
    margin-bottom: 12px;
    width: 100%;
    position: relative;
}

.competition-pills-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.competition-pills-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.competition-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: inherit;
}

.competition-pill:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.competition-pill.active {
    background: #2965ff;
    color: #ffffff;
    border-color: #2965ff;
}

.competition-pill.active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.competition-pill.live {
    position: relative;
}

.competition-pill.live::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

.competition-pill.live.active::before {
    background: #ffffff;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Home Page Widget Container */
.cricket-match-widget-home {
    margin: 20px 0 30px;
    width: 100%;
    display: block;
}

.cricket-match-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0px;
    width: 100%;
    overflow: hidden;
    flex-direction: row;
}

/* Carousel Navigation */
.carousel-nav {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    flex-shrink: 0;
    color: #666;
    z-index: 10;
}

.carousel-nav:hover {
    background: #e0e0e0;
    /* transform: scale(1.1); */
}

.carousel-nav:active {
    /* transform: scale(0.95); */
}

.carousel-nav svg {
    width: 20px;
    height: 20px;
}

.carousel-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;

}

/* Carousel Track */
.cricket-match-carousel {
    flex: 1;
    overflow: hidden;
    position: relative;
    width: 100%;
    display: block;
}

.cricket-match-carousel-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    transition: transform 0.3s ease;
    will-change: transform;
    touch-action: pan-x;
    width: max-content;
    min-width: 100%;
    align-items: stretch;
    overflow: visible;
}

/* Match Card Link Wrapper */
.cricket-match-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex-shrink: 0;
    min-width: 330px;
    max-width: 330px;
}

.cricket-match-card-link:hover,
.cricket-match-card-link:focus,
.cricket-match-card-link:active {
    text-decoration: none;
    color: inherit;
}

/* Match Card */
.cricket-match-card {
    min-width: 330px !important;
    max-width: 330px !important;
    width: 330px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
    cursor: pointer;
    min-height: 170px;
}

.cricket-match-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Match Header - Blue Bar */
.match-header {
    background: #2965ff;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 5px !important;
    margin: 4px 5px;
    border-radius: 8px;
    padding-right: 22%;
    min-height: unset;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

}

.match-tournament {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 10px;
}

.match-status-badge.status-live {
    background: #10b981;
    color: #ffffff;
    border-radius: 4px;
}

.match-status-badge.status-completed {
    background: #dc2626;
    color: #ffffff;
    border-radius: 4px;
    padding: 5px 14px;
    font-weight: 700;
}

.match-status-badge.status-upcoming {
    background: #9ca3af;
    color: #ffffff;
}

/* Match Info Line */
.match-info-line {
    padding: 2px 6px;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.6;
    background: #ffffff;
    font-weight: 500;
}

/* Teams Section */
.match-teams {
    padding: 6px 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* flex: 1; */
}

.team {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    align-items: flex-end;

}

.team-logo {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    object-fit: contain;
    background: #f3f4f6;
    margin-top: 2px;
}

.team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.team-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 2px;
}

.team-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 2px;
}

.team-a .team-score {
    font-size: 13px;
    color: #2563eb;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 2px;
}

.team-b .team-score {
    font-size: 13px;
    color: #111827;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 2px;
}

/* Match Result/Status Text */
.match-result,
.match-status-text {
    padding: 10px 12px;
    font-size: 12px;
    color: #374151;
    font-weight: 600;
    line-height: 1.5;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
    background: #fafafa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cricket-match-widget-home {
        margin: 15px 0 20px;
        padding: 0;
    }

    .cricket-match-carousel-container {
        gap: 0;
        position: relative;
        padding: 0 40px;
    }

    .cricket-match-carousel {
        width: 100%;
        flex: 1;
    }

    .cricket-match-card {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .carousel-nav {
        position: absolute;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        z-index: 20;
        top: 50%;
        transform: translateY(-50%);
    }

    .carousel-nav.carousel-prev {
        left: 4px;
    }

    .carousel-nav.carousel-next {
        right: 4px;
    }
    
    .carousel-nav svg {
        width: 18px;
        height: 18px;
    }

    .match-header {
        padding: 10px 7px;
        font-size: 12px;
        min-height: 38px;
    }

    .match-info-line {
        padding: 2px 6px;
        font-size: 11px;
    }

    .match-teams {
        padding: 6px 6px;
        gap: 5px;
    }

    .team-logo {
        width: 28px;
        height: 28px;
    }

    .team-name {
        font-size: 12px;
    }

    .team-a .team-score,
    .team-b .team-score {
        font-size: 12px;
    }

    .match-result,
    .match-status-text {
        padding: 8px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .cricket-match-widget-home {
        margin: 10px 0 15px;
        padding: 0;
    }

    .cricket-match-carousel-container {
        gap: 0;
        position: relative;
        padding: 0 36px;
    }

    .cricket-match-carousel {
        width: 100%;
        flex: 1;
    }

    .cricket-match-card {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: 180px;
    }
    
    .carousel-nav {
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    .carousel-nav.carousel-prev {
        left: 2px;
    }

    .carousel-nav.carousel-next {
        right: 2px;
    }
    
    .carousel-nav svg {
        width: 16px;
        height: 16px;
    }

    .match-header {
        padding: 8px 10px;
        font-size: 11px;
        min-height: 36px;
    }

    .match-tournament {
        font-size: 12px;
    }
    
    .match-status-badge {
        padding: 4px 10px;
        font-size: 9px;
        margin-left: 8px;
    }

    .match-info-line {
        padding: 2px 5px;
        font-size: 10px;
    }

    .match-teams {
        padding: 6px 6px;
        gap: 5px;
    }

    .team {
        gap: 8px;
    }

    .team-logo {
        width: 26px;
        height: 26px;
    }

    .team-name {
        font-size: 11px;
    }

    .team-a .team-score,
    .team-b .team-score {
        font-size: 11px;
    }

    .match-result,
    .match-status-text {
        padding: 8px 10px;
        font-size: 10px;
    }
}

/* Regular Widget Styles (for detail pages) */
.cricket-match-widget {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cricket-match-widget.loading {
    text-align: center;
    padding: 40px 20px;
}

.cricket-match-widget-error {
    padding: 20px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
}

.cricket-match-widget-loading {
    padding: 20px;
    color: #666;
}

.cricket-match-widget-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.match-header {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
}

.match-teams {
    display: flex;
    align-items: left;
    /* justify-content: space-between; */
    gap: 3px !important;
    /* flex-wrap: wrap; */
}

.team {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: row;
    align-items: left;
    gap: 2px;
}

.team-name {
    font-size: 10px;
    font-weight: 600;
    text-transform: capitalize;
    color: #000;
    font: 13px / 1 bouldsemibold;
}

.team-score {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.vs {
    font-size: 16px;
    font-weight: 500;
    color: #999;
    padding: 0 10px;
}

.match-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-status,
.match-venue,
.match-time {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.match-status:last-child,
.match-venue:last-child,
.match-time:last-child {
    border-bottom: none;
}

.status-label,
.venue-label,
.time-label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
}

.status-value,
.venue-value,
.time-value {
    color: #333;
}

.status-live .status-value {
    color: #e74c3c;
    font-weight: 600;
}

.status-upcoming .status-value {
    color: #3498db;
}

.status-completed .status-value {
    color: #27ae60;
}

/* Match Detail Page Styles */
.cricket-match-article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cricket-match-content {
    margin: 30px 0;
}

.match-details {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
}

.match-details .match-teams {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 0px;
    padding-bottom: 0px;
    border-bottom: 2px solid #ddd;
}

.match-details .team {
    text-align: center;
}

.match-details .team .score {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-top: 10px;
    color: #2c3e50;
}

.match-details .vs {
    font-size: 20px;
    font-weight: 500;
    color: #999;
}

.match-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.match-info > div {
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.match-status .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.status-live {
    background: #fee;
    color: #c33;
}

.status-upcoming {
    background: #eef;
    color: #339;
}

.status-completed {
    background: #efe;
    color: #363;
}

.cricket-match-card {
    background: #ffffff;
    border-radius: 2px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
    min-width: 320px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
}

.match-header {
    background: #2965FF;
    color: #ffffff;
    padding: 5px 6px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.match-tournament {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.match-status-pill {
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    line-height: 1;
    font-weight: 700;
    border-radius: 4px;
    line-height: 1;
    text-transform: capitalize;
    width: auto;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px;
}

.match-status-pill.live {
    background: #22c55e;
    color: #ffffff;
}

.match-status-pill.upcoming {
    background: #e5e7eb;
    color: #374151;
}

.match-status-pill.completed, .match-status-pill.cancelled {
    background: #b30401;
    color: #ffffff;
}
.match-info-line {
    padding: 1px 9px !important;
    font-size: 10px !important;
    color: #5f606f;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-family: bouldsemibold;
}
.match-teams {
    padding: 5px 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.team-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.team-logo {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    object-fit: contain;
    background: #f3f4f6;
}

.team-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 0px;
}
.team-score {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

.team-score.highlight {
    color: #2563eb;
}
.match-footer-text {
    padding: 2px 6px !important;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    background: #ffff;
    /* border-top: 1px solid #e5e7eb; */
    margin: 0px !important;

}
.cricket-match-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
@media (max-width: 480px) {
    .cricket-match-card {
        min-width: 100%;
        max-width: 100%;
    }

    .match-header {
        padding: 8px 10px;
    }

    .team-name {
        font-size: 12px;
    }

    .team-score {
        font-size: 12px;
    }

    .match-footer-text {
        font-size: 11px;
    }

    .cricket-match-card {
        min-width: 281px !important;
        max-width: 330px !important;
        width: 330px !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        background: #ffffff;
        border-radius: 2px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        transition: box-shadow 0.2s;
        cursor: pointer;
        min-height: 170px;
    }
}
@media (max-width: 480px) {
    .match-header {
        padding: 1px 6px !important;
        font-size: 6px !important;
        min-height: 33px;
    }
}

/* Competition Pills Responsive Styles */
@media (max-width: 768px) {
    .competition-pills-container {
        margin-bottom: 10px;
    }

    .competition-pills-scroll {
        gap: 6px;
        padding: 2px 0;
    }

    .competition-pill {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 16px;
    }

    .competition-pill.live::before {
        width: 5px;
        height: 5px;
        margin-right: 5px;
    }
}

@media (max-width: 480px) {
    .competition-pills-container {
        margin-bottom: 8px;
    }

    .competition-pills-scroll {
        gap: 5px;
    }

    .competition-pill {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 14px;
    }

    .competition-pill.live::before {
        width: 4px;
        height: 4px;
        margin-right: 4px;
    }
}

/* No Matches Message */
.cricket-match-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    width: 100%;
    padding: 20px;
    font-size: 14px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

/* Category Pills Responsive Styles */
@media (max-width: 768px) {
    .category-pills-container {
        margin-bottom: 10px;
    }

    .category-pill {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .category-pills-container {
        margin-bottom: 8px;
    }

    .category-pill {
        padding: 6px 12px;
        font-size: 12px;
        flex: 1;
        text-align: center;
    }
}
