/**
 * Today's Matches / Live Scores Widget
 * [oe_todays_matches] shortcode styling
 */

.oe-livescores {
    width: 100%;
    background: var(--oe-color-white);
    border-radius: 8px;
    border: 1px solid var(--oe-color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ── Tabs ─────────────────────────────────────── */

.oe-livescores__tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--oe-color-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.oe-livescores__tabs::-webkit-scrollbar {
    display: none;
}

.oe-livescores__tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 19px 16px;
    border: 1px solid transparent;
    border-bottom-width: 2px;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--oe-color-text-light);
    white-space: nowrap;
    margin-bottom: -2px;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.oe-livescores__tab:hover,
.oe-livescores__tab:focus,
.oe-livescores__tab:active {
    color: var(--oe-color-primary);
    background: var(--oe-color-primary-tint);
    outline: none;
}

.oe-livescores__tab:focus-visible {
    outline: 2px solid var(--oe-color-primary);
    outline-offset: -2px;
}

.oe-livescores__tab--active,
.oe-livescores__tab--active:hover,
.oe-livescores__tab--active:focus,
.oe-livescores__tab--active:active {
    color: var(--oe-color-primary);
    background: var(--oe-color-primary-tint);
    border-color: var(--oe-color-primary-a15);
    border-bottom-color: var(--oe-color-primary);
    font-weight: 600;
}

.oe-livescores__tab-count {
    font-size: 11px;
    font-weight: 700;
    background: var(--oe-color-bg);
    color: var(--oe-color-text-light);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.oe-livescores__tab--active .oe-livescores__tab-count {
    background: var(--oe-color-primary);
    color: var(--oe-color-white);
}

/* ── Body ─────────────────────────────────────── */

.oe-livescores__body {
    padding: 0;
}

/* ── League group ─────────────────────────────── */

.oe-livescores__league {
    border-bottom: 1px solid var(--oe-color-border);
}

.oe-livescores__league:last-child {
    border-bottom: none;
}

.oe-livescores__league-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--oe-color-bg-alt);
    border-left: 3px solid #555;
}

.oe-livescores__league-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.oe-livescores__league-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.oe-livescores__league-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--oe-color-text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oe-livescores__league-country {
    font-size: 11px;
    color: var(--oe-color-text-light);
    white-space: nowrap;
}

/* ── Match row ────────────────────────────────── */

.oe-livescores__match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--oe-color-border);
    border-right: 3px solid transparent;
    transition: background-color 0.15s ease;
    position: relative;
}

.oe-livescores__match:last-child {
    border-bottom: none;
}

.oe-livescores__match:hover {
    background: var(--oe-color-bg);
}

/* Live match: red right border */
.oe-livescores__match--live {
    border-right-color: var(--oe-color-error);
}

/* Match with tips: extra right padding for badge */
.oe-livescores__match:has(.oe-livescores__tips-badge) {
    padding-right: 30px;
}

/* Finished match: green right border + muted text */
.oe-livescores__match--finished {
    border-right-color: var(--oe-color-primary, #036133);
}

.oe-livescores__match--finished .oe-livescores__team-name {
    color: var(--oe-color-text-light);
}

/* ── Team column ──────────────────────────────── */

.oe-livescores__team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.oe-livescores__team--home {
    justify-content: flex-end;
    text-align: right;
}

.oe-livescores__team--away {
    justify-content: flex-start;
    text-align: left;
}

.oe-livescores__team-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--oe-color-text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oe-livescores__team-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ── Center column (score / time / state) ─────── */

.oe-livescores__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.oe-livescores__score {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--oe-color-text-dark);
    display: flex;
    align-items: center;
    gap: 4px;
}

.oe-livescores__score--live {
    color: var(--oe-color-error);
}

.oe-livescores__score-sep {
    font-weight: 400;
    color: var(--oe-color-text-light);
}

.oe-livescores__time {
    font-size: 14px;
    font-weight: 600;
    color: var(--oe-color-text-dark);
}

.oe-livescores__state {
    font-size: 10px;
    font-weight: 600;
    color: var(--oe-color-text-light);
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Pulsing live dot */
.oe-livescores__live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--oe-color-error);
    border-radius: 50%;
    animation: oe-live-pulse 1.5s ease-in-out infinite;
}

@keyframes oe-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Score change flash */
.oe-livescores__match--score-changed .oe-livescores__score {
    animation: oe-score-flash 1.5s ease-out;
}

@keyframes oe-score-flash {
    0% { background: var(--oe-color-secondary); border-radius: 4px; }
    100% { background: transparent; }
}

/* ── Tips badge ───────────────────────────────── */

.oe-livescores__tips-badge {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--oe-color-primary);
    color: var(--oe-color-white);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* ── Empty state ──────────────────────────────── */

.oe-livescores__empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--oe-color-text-light);
    font-size: 14px;
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 640px) {
    .oe-livescores__tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .oe-livescores__match {
        gap: 8px;
        padding: 8px 12px;
    }

    .oe-livescores__team-name {
        font-size: 12px;
    }

    .oe-livescores__team-logo {
        width: 16px;
        height: 16px;
    }

    .oe-livescores__score {
        font-size: 14px;
    }

    .oe-livescores__center {
        min-width: 50px;
    }

    .oe-livescores__league-header {
        padding: 8px 12px;
    }
}

@media (max-width: 400px) {
    .oe-livescores__team-logo {
        display: none;
    }

    .oe-livescores__match {
        gap: 6px;
        padding: 8px 10px;
    }
}
