/**
 * TV Matches Plugin - Match card layout
 * Structure: Home [logo] | TIME | [logo] Away (centered)
 */

:root {
    --tvm-primary: #1e40af;
    --tvm-text: #1f2937;
    --tvm-text-mid: #4b5563;
    --tvm-text-light: #9ca3af;
    --tvm-border: #e5e7eb;
    --tvm-bg: #ffffff;
    --tvm-bg-hover: #f8fafc;
    --tvm-tv-color: #047857;
    --tvm-tv-bg: #ecfdf5;
    --tvm-odd-bg: #f0f4ff;
    --tvm-odd-hover: #dbeafe;
}

/* ── Container ── */
.tvm {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--tvm-text);
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.4;
}

.tvm-empty {
    text-align: center;
    padding: 2rem;
    color: var(--tvm-text-light);
    font-size: 1rem;
}

/* ── Day ── */
.tvm-day {
    margin-bottom: 1.5rem;
    border: 1px solid var(--tvm-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--tvm-bg);
}

.tvm-day-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tvm-text);
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--tvm-border);
    text-align: center;
}

/* ── League ── */
.tvm-league {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tvm-text-mid);
    border-top: 1px solid var(--tvm-border);
}

.tvm-card:first-child .tvm-league,
.tvm-league:first-child {
    border-top: none;
}

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

.tvm-league-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Match card ── */
.tvm-card {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.tvm-card:last-child {
    border-bottom: none;
}

/* ── Main row: Home | Time | Away ── */
.tvm-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Teams */
.tvm-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

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

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

.tvm-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--tvm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tvm-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Center: time or score */
.tvm-center {
    flex-shrink: 0;
    min-width: 54px;
    text-align: center;
}

.tvm-kickoff {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--tvm-primary);
}

.tvm-score {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--tvm-text);
}

/* ── TV channel ── */
.tvm-tv {
    text-align: center;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tvm-tv-color);
    background: var(--tvm-tv-bg);
    padding: 0.1875rem 0.625rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    /* Center the inline-flex element */
    margin-left: auto;
    margin-right: auto;
    /* Make it block-level centered */
}

/* Wrapper trick to center inline-flex */
.tvm-card {
    text-align: center;
}

.tvm-row {
    text-align: left;
}

/* ── Odds ── */
.tvm-odds {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.tvm-odd {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    padding: 0.3125rem 0.625rem;
    background: var(--tvm-odd-bg);
    border-radius: 6px;
    text-decoration: none;
    color: var(--tvm-text);
    transition: background-color 0.12s;
    line-height: 1.3;
}

a.tvm-odd:hover {
    background: var(--tvm-odd-hover);
    color: var(--tvm-primary);
}

.tvm-odd-l {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--tvm-text-light);
    text-transform: uppercase;
}

.tvm-odd-v {
    font-size: 0.9375rem;
    font-weight: 700;
}

/* ── Backlink ── */
.tvm-backlink {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--tvm-text-light);
    text-align: center;
}

.tvm-backlink a {
    color: var(--tvm-primary);
    text-decoration: none;
}

.tvm-backlink a:hover {
    text-decoration: underline;
}

/* ── Mobile ── */
@media (max-width: 520px) {
    .tvm-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tvm-team {
        flex: none;
        width: auto;
        max-width: 42%;
    }

    .tvm-home {
        justify-content: flex-end;
    }

    .tvm-away {
        justify-content: flex-start;
    }

    .tvm-name {
        font-size: 0.875rem;
    }

    .tvm-logo {
        width: 24px;
        height: 24px;
    }

    .tvm-center {
        min-width: 44px;
    }

    .tvm-kickoff,
    .tvm-score {
        font-size: 1rem;
    }

    .tvm-odds {
        gap: 0.25rem;
    }

    .tvm-odd {
        min-width: 44px;
        padding: 0.25rem 0.5rem;
    }

    .tvm-odd-v {
        font-size: 0.875rem;
    }
}
