/* ========================================
   TIMELINE EVENTS STYLE - EXACT MATCH
   ======================================== */

.STING-WEB-Events {
    background: #fdfdfd !important;
    padding: 20px 5px !important;
}

.events-tabs-container {
    margin-bottom: 20px !important;
    display: flex;
    justify-content: center;
}

.events-tabs {
    display: flex;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 500px;
}

.events-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #fff;
    color: #333;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.events-tab.active {
    background: #E31E24;
    color: #fff;
}

/* Timeline Row */
.timeline-event-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f2;
    position: relative;
    min-height: 60px;
}

.timeline-side {
    flex: 1;
    display: flex;
    align-items: center;
}

.side-left {
    justify-content: flex-end;
    padding-right: 15px;
    text-align: right;
}

.side-right {
    justify-content: flex-start;
    padding-left: 15px;
    text-align: left;
}

.timeline-center {
    width: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.timeline-center::before {
    content: '';
    position: absolute;
    width: 1px;
    height: 100%;
    background: #eee;
    z-index: 1;
}

.event-minute {
    background: #fdfdfd;
    color: #888;
    font-size: 12px;
    font-weight: 800;
    padding: 4px;
    position: relative;
    z-index: 2;
}

.event-details-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-text {
    display: flex;
    flex-direction: column;
}

.main-player {
    font-size: 13px;
    font-weight: 800;
    color: #222;
}

.sub-player {
    font-size: 11px;
    color: #999;
}

.event-icon-img {
    width: 22px;
    height: 22px;
}

.sub-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.8;
}

.arrow-in {
    color: #4CAF50;
    font-weight: 900;
    font-size: 16px;
}

.arrow-out {
    color: #F44336;
    font-weight: 900;
    font-size: 16px;
    margin-top: -2px;
}

.match-status-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0 25px 0;
}

.whistle-icon-svg {
    width: 28px;
    height: 28px;
    margin-bottom: 5px;
    fill: #E31E24;
}

.status-text {
    font-size: 12px;
    color: #777;
    font-weight: 800;
}

/* ========================================
   MATCH DETAILS - MODERN LAYOUT
   ======================================== */

.match-details-container {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid #f2f2f2;
}

.details-header {
    background: #E31E24;
    color: #fff;
    padding: 12px 15px;
    font-weight: 800;
    font-size: 15px;
    text-align: center;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    flex: 1;
    color: #999;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.info-value {
    flex: 2;
    color: #333;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.info-action {
    width: 30px;
    display: flex;
    justify-content: center;
    color: #E31E24;
    font-weight: 900;
    font-size: 16px;
}

.referee-more {
    color: #aaa;
    font-size: 12px;
    font-weight: 700;
    margin-right: 10px;
}

/* Form Circles */
.form-circles {
    display: flex;
    gap: 5px;
    justify-content: center;
    padding: 5px 0;
}

.form-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
}

.form-circle.win {
    background: #4CAF50;
}

.form-circle.draw {
    background: #FFC107;
}

.form-circle.loss {
    background: #F44336;
}

/* H2H Summary Box */
.h2h-summary-box {
    background: #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: -1px;
    border: 1px solid #f2f2f2;
}

.h2h-summary-numbers {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 5px;
}

.h2h-num {
    font-size: 24px;
    font-weight: 900;
    color: #222;
}

.h2h-labels {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #333;
    font-size: 14px;
    font-weight: 800;
}

.h2h-arrow-down {
    margin-top: 15px;
    color: #E31E24;
    font-size: 20px;
    font-weight: 900;
}

/* 🏟️ LINEUP STYLE STAYED UNTOUCHED */
.STING-WEB-Team {
    background: #f0f0f0 !important;
    padding: 10px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.STING-WEB-Lineup-Container {
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto !important;
}

.Team-Buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
}

.Team-Button {
    flex: 1;
    padding: 12px;
    border-radius: 50px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    background: #fff;
    color: #333;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.Team-Button.Lenup {
    background: #E31E24;
    color: #fff;
}

.STING-WEB-Home-Field-Map,
.STING-WEB-Away-Field-Map {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 4 / 5 !important;
    background-image: url('/site/assets/images/football-field-3d.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 20px 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    margin: 0 auto !important;
    border: 1px solid #eee !important;
}

.STING-WEB-Home-Field-Map .position,
.STING-WEB-Away-Field-Map .position {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    z-index: 5;
}

.position:nth-child(1) {
    transform: scale(0.85);
}

.position:nth-child(2) {
    transform: scale(0.95);
}

.position:nth-child(3) {
    transform: scale(1.05);
}

.position:nth-child(4) {
    transform: scale(1.15);
}

.lineup-player-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    padding-bottom: 20px;
}

.lineup-player-item:hover {
    transform: scale(1.1);
}

.lineup-player-item .img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #ffffff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.lineup-player-item .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lineup-player-item .player-name {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
}

.lineup-player-item .player-name h3 {
    font-size: 11px;
    font-weight: 900;
    color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 1);
    white-space: nowrap;
    z-index: 10;
}

.lineup-player-item .image-wrapper .rate {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #2196F3 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.STING-WEB-Formation {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 900;
    color: #E31E24;
    border: 1px solid #E31E24;
    z-index: 20;
}

/* ========================================
   DARK MODE ADJUSTMENTS
   ======================================== */

body.dark-mode,
body.dark,
[data-theme="dark"] {
    --Detail-BG: #191d2d;
    --Detail-Row: #151825;
    --Detail-Border: #2c2c2c;
    --Text-Light: #b4bec7;
    --Value-Color: #ffffff;
}

body.dark-mode .match-details-container,
body.dark .match-details-container,
[data-theme="dark"] .match-details-container {
    background: var(--Detail-BG) !important;
    box-shadow: none !important;
    border: 1px solid var(--Detail-Border) !important;
}

body.dark-mode .info-row,
body.dark .info-row,
[data-theme="dark"] .info-row {
    background: var(--Detail-Row) !important;
    border-bottom: 1px solid var(--Detail-Border) !important;
}

body.dark-mode .info-label,
body.dark .info-label,
[data-theme="dark"] .info-label {
    color: var(--Text-Light) !important;
}

body.dark-mode .info-value,
body.dark .info-value,
[data-theme="dark"] .info-value {
    color: var(--Value-Color) !important;
}

body.dark-mode .h2h-summary-box,
body.dark .h2h-summary-box,
[data-theme="dark"] .h2h-summary-box {
    background: #111420 !important;
    border: 1px solid var(--Detail-Border) !important;
}

body.dark-mode .h2h-num,
body.dark .h2h-num,
[data-theme="dark"] .h2h-num {
    color: #fff !important;
}

body.dark-mode .h2h-labels,
body.dark .h2h-labels,
[data-theme="dark"] .h2h-labels {
    color: var(--Text-Light) !important;
}

body.dark-mode .STING-WEB-Team,
body.dark .STING-WEB-Team,
[data-theme="dark"] .STING-WEB-Team {
    background: transparent !important;
}

body.dark-mode .Team-Button,
body.dark .Team-Button,
[data-theme="dark"] .Team-Button {
    background: #151825 !important;
    color: #fff !important;
}

body.dark-mode .Team-Button.Lenup,
body.dark .Team-Button.Lenup,
[data-theme="dark"] .Team-Button.Lenup {
    background: #E31E24 !important;
}

body.dark-mode .STING-WEB-Home-Field-Map,
body.dark-mode .STING-WEB-Away-Field-Map,
body.dark .STING-WEB-Home-Field-Map,
body.dark .STING-WEB-Away-Field-Map,
[data-theme="dark"] .STING-WEB-Home-Field-Map,
[data-theme="dark"] .STING-WEB-Away-Field-Map {
    background-color: #111420 !important;
    border: 1px solid #333 !important;
    box-shadow: none !important;
}

body.dark-mode .STING-WEB-Formation,
body.dark .STING-WEB-Formation,
[data-theme="dark"] .STING-WEB-Formation {
    background: #191d2d !important;
    color: #fff !important;
    border-color: #444 !important;
}

/* ============================================
   COUNTDOWN TIMER - MOBILE FIX
   Fixes overflow in the match card center column
   ============================================ */
@media (max-width: 768px) {

    /* Widen center column: team logos get 1fr each, center gets 2fr */
    .STING-WEB-Card-Vs {
        grid-template-columns: 1fr 2fr 1fr !important;
        overflow: hidden !important;
    }

    /* Team logos slightly smaller to give center more room */
    .STING-WEB-Card-Vs-Right img,
    .STING-WEB-Card-Vs-Left img {
        width: 40px !important;
        height: 40px !important;
    }

    /* Center column fills width */
    .STING-WEB-Card-Vs-Center,
    .STING-WEB-Time-Status-Container {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Countdown wrapper: tight, no wrap */
    .countdown-wrapper {
        gap: 3px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        justify-content: center !important;
        margin-top: 4px !important;
    }

    /* Each countdown box */
    .countdown-unit {
        min-width: 24px !important;
        padding: 2px 3px !important;
        border-radius: 5px !important;
    }

    /* The big number */
    .countdown-value {
        font-size: 13px !important;
        line-height: 1.1 !important;
    }

    /* The label (يوم / ساعة / ...) */
    .countdown-label {
        font-size: 6px !important;
        margin-top: 2px !important;
        text-transform: uppercase !important;
    }

    /* The ":" separator */
    .countdown-sep {
        font-size: 13px !important;
        margin-bottom: 6px !important;
        margin-top: 0 !important;
        line-height: 1.5 !important;
    }

    /* "يبدأ بعد" label above countdown */
    .header-timer-wrapper > span:first-child {
        font-size: 9px !important;
        margin-bottom: 3px !important;
        letter-spacing: 0 !important;
    }

    /* Match date/time below countdown */
    .match-start-time {
        font-size: 9px !important;
        margin-top: 3px !important;
    }

    /* header-countdown el itself */
    .header-countdown {
        font-size: 13px !important;
        min-height: auto !important;
    }

    /* header-timer wrapper fills center col */
    .header-timer-wrapper {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
}