/* ===============================
   Widget container
================================= */
.h2h-widget {
    font-family: 'Inter', sans-serif;
    max-width: 960px;
    margin: 40px auto;
    padding: 10px;
    background: #1f1f1f;
    border-radius: 12px;
    color: #eee;
}

/* ===============================
   Match Header
================================= */
.h2h-match-header {
    background: #1f1f1f;
    padding: 20px 16px;
    border-bottom: 1px solid #333;
    border-radius: 0 0 10px 10px;
    max-width: 960px;
    margin: 0 auto 32px;
    text-align: center;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease-in-out;
}

.h2h-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.h2h-header-row .team-logo {
    max-height: 36px;
    object-fit: contain;
}

.h2h-header-row .team-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.h2h-header-row .vs-text {
    font-size: 0.95rem;
    color: #ccc;
    font-weight: 500;
}

.h2h-subtitle-row {
    font-size: 0.9rem;
    color: #aaa;
}

.h2h-date-time {
    margin-top: 4px;
    font-size: 0.9rem;
    color: #bbb;
}

/* ===============================
   Current Form and Positions
================================= */
.h2h-summary-overview {
    padding: 24px 1px;
    margin-bottom: 32px;
    background: #1f1f1f;
    border-radius: 12px;
    text-align: center;
}

.h2h-summary-overview .section-title {
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: #fff;
}

.h2h-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.team-overview {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 0;
    justify-content: center;
}

.team-overview.team-left {
    flex-direction: row;
    text-align: left;
}

.team-overview.team-right {
    flex-direction: row-reverse;
    text-align: right;
}

/* Logos pequeños sin depender de clase específica */
.team-overview img {
    max-height: 28px; /* Desktop */
    object-fit: contain;
}

@media screen and (max-width: 768px) {
    .team-overview img {
        max-height: 24px; /* Responsive */
    }
}

.team-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.team-info .team-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.team-info .team-form {
    font-size: 0.9rem;
    color: #bbb;
    margin-top: 4px;
}

/* ===============================
   Toggle Button
================================= */
.h2h-summary-scroll-link {
    margin-top: 20px;
}

.h2h-summary-scroll-link button {
    background-color: #333;
    color: #fff;
    padding: 8px 16px;
    font-size: 0.9rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.h2h-summary-scroll-link button:hover {
    background-color: #444;
}

/* ===============================
   League Match List
================================= */
.h2h-league-results {
    margin-top: 24px;
    text-align: left;
}

.h2h-league-matches-cols {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.h2h-team-league {
    flex: 1;
}

.h2h-team-league h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.h2h-team-league h4 img {
    max-height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.h2h-league-match-list {
    list-style: none;
    padding-left: 0;
    margin-top: 8px;
}

.h2h-league-match-list li {
    padding: 4px 0;
    font-size: 0.9rem;
    color: #ddd;
}

/* ===============================
   Head-to-Head Summary
================================= */
.h2h-h2h-summary {
    background: #1f1f1f;
    padding: 10px 1px;
    border-radius: 12px;
    margin-bottom: 10px;
    text-align: center;
}

.h2h-h2h-summary .section-title {
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: #fff;
}

.h2h-h2h-logos {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 102px;
    margin-bottom: 29px;
    flex-wrap: wrap;
}

.h2h-team-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #eee;
    text-align: center;
}

.h2h-team-col img {
    max-height: 40px;
    margin-bottom: 6px;
    object-fit: contain;
}

.h2h-team-values {
    margin-top: 12px;
    font-size: 0.95rem;
}

.h2h-team-values .label {
    font-weight: 500;
    color: #bbb;
    margin-bottom: 4px;
}

.h2h-team-values .value {
    font-weight: 600;
    color: #eee;
    margin-bottom: 10px;
}

/* ===============================
   Matches Table
================================= */
.h2h-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 0.95rem;
    text-align: center;
}

.h2h-table th,
.h2h-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #444;
    vertical-align: middle;
}

.h2h-table th {
    color: #ccc;
    font-weight: 600;
}

.h2h-table td {
    background: #222;
    color: #eee;
}

.match-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    justify-content: center;
}

.team-cell img {
    max-height: 24px;
    object-fit: contain;
}

.score-cell {
    font-weight: 600;
    font-size: 1rem;
}

.date-cell {
    font-size: 0.9rem;
    color: #bbb;
}

.loser {
    opacity: 0.6;
}

/* ===============================
   Section titles
================================= */
.h2h-widget .section-title {
    background: #262626;
    color: #d1d1d1;
    padding: 10px 16px;
    border-radius: 6px;
    margin: 32px 0 24px;
    font-size: 1.05rem;
    text-align: center;
    font-weight: 400;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ===============================
   Goals Table (nuevo)
================================= */
.h2h-goals-table {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    font-size: 14px;
}

.h2h-goals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    margin-bottom: 12px;
    font-weight: bold;
}

.h2h-goals-header .team {
    flex: 1;
}

.h2h-goals-header .team img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-bottom: 4px;
}

.h2h-goals-header .title-center {
    flex: 1;
    text-align: center;
    font-weight: 600;
}

.h2h-goals-body .goal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    border-bottom: 1px solid #e1e1e1;
    padding: 6px 0;
}

.h2h-goals-body .goal-value {
    width: 30%;
    text-align: center;
    font-weight: 500;
}

.h2h-goals-body .goal-label {
    width: 40%;
    text-align: center;
    font-weight: 400;
    color: #666;
}

/* ===============================
   Tabs (igual que botón scroll-link)
================================= */
.h2h-tab-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    list-style: none;
    padding: 0;
}

.h2h-tab-list li {
    background-color: #333;
    color: #fff;
    padding: 8px 16px;
    font-size: 0.9rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    user-select: none;
    outline: none;
}

.h2h-tab-list li:hover {
    background-color: #444;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.h2h-tab-list li:focus-visible {
    background-color: #444;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.35);
    transform: translateY(-2px);
}

.h2h-tab-list li:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.h2h-tab-list li.active {
    background-color: #555;
    box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}

@media (prefers-reduced-motion: reduce) {
    .h2h-tab-list li {
        transition: none;
    }
}

.h2h-tab-content {
    display: none;
}

.h2h-tab-content.active {
    display: block;
}

/* ===============================
   Responsive
================================= */
@media screen and (max-width: 768px) {
    .h2h-match-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background-color: #1f1f1f;
        border-radius: 0;
        border-bottom: 2px solid #333;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    }

    .h2h-header-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: center;
    }

    .h2h-h2h-logos {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 29px;
    }

    .h2h-table td,
    .h2h-table th {
        padding: 10px 4px;
    }

    .score-cell {
        font-size: 0.95rem;
    }

    .team-cell img {
        max-height: 20px;
    }

    .team-overview img {
        max-height: 24px;
    }

    .team-info .team-name {
        font-size: 0.9rem;
    }

    .team-info .team-form {
        font-size: 0.67rem;
    }

    .h2h-league-matches-cols {
        flex-direction: column;
        gap: 20px;
    }
}

