/**
 * MFT Football Odds - H2H (Head to Head) Styles
 *
 * @package MFT_Football_Odds
 */

/* ========================================
   H2H Container
   ======================================== */

.mft-fo-h2h {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.mft-fo-h2h--dark {
    background: #1e293b;
    color: #e2e8f0;
}

.mft-fo-h2h__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.mft-fo-h2h--dark .mft-fo-h2h__title {
    border-bottom-color: #374151;
}

/* ========================================
   Form Badges (W/D/L)
   ======================================== */

.mft-fo-form {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.mft-fo-form__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mft-fo-form__badge--w {
    background: #22c55e; /* Green - Win */
}

.mft-fo-form__badge--d {
    background: #9ca3af; /* Gray - Draw */
}

.mft-fo-form__badge--l {
    background: #ef4444; /* Red - Loss */
}

/* Larger variant */
.mft-fo-form--large .mft-fo-form__badge {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 6px;
}

/* ========================================
   Team Form Section
   ======================================== */

.mft-fo-h2h__section {
    margin-bottom: 24px;
}

.mft-fo-h2h__section:last-child {
    margin-bottom: 0;
}

.mft-fo-h2h__section-title {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mft-fo-h2h--dark .mft-fo-h2h__section-title {
    color: #9ca3af;
}

.mft-fo-h2h__team-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mft-fo-h2h__team-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mft-fo-h2h__team-name {
    font-size: 14px;
    font-weight: 500;
    min-width: 120px;
    color: #374151;
}

.mft-fo-h2h--dark .mft-fo-h2h__team-name {
    color: #e5e7eb;
}

/* ========================================
   Statistics Cards
   ======================================== */

.mft-fo-h2h__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.mft-fo-h2h__stat-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.mft-fo-h2h--dark .mft-fo-h2h__stat-card {
    background: #374151;
}

.mft-fo-h2h__stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.mft-fo-h2h--dark .mft-fo-h2h__stat-value {
    color: #f3f4f6;
}

.mft-fo-h2h__stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mft-fo-h2h--dark .mft-fo-h2h__stat-label {
    color: #9ca3af;
}

/* Win percentage bars */
.mft-fo-h2h__stat-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
    display: flex;
}

.mft-fo-h2h__stat-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.mft-fo-h2h__stat-bar-segment--win {
    background: #22c55e;
}

.mft-fo-h2h__stat-bar-segment--draw {
    background: #9ca3af;
}

.mft-fo-h2h__stat-bar-segment--loss {
    background: #ef4444;
}

/* ========================================
   H2H Tables
   ======================================== */

.mft-fo-h2h__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mft-fo-h2h__table th,
.mft-fo-h2h__table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.mft-fo-h2h--dark .mft-fo-h2h__table th,
.mft-fo-h2h--dark .mft-fo-h2h__table td {
    border-bottom-color: #374151;
}

.mft-fo-h2h__table th {
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
}

.mft-fo-h2h--dark .mft-fo-h2h__table th {
    background: #374151;
    color: #9ca3af;
}

.mft-fo-h2h__table tbody tr:hover {
    background: #f9fafb;
}

.mft-fo-h2h--dark .mft-fo-h2h__table tbody tr:hover {
    background: #1f2937;
}

.mft-fo-h2h__table tbody tr:last-child td {
    border-bottom: none;
}

/* Table cell variants */
.mft-fo-h2h__table-date {
    white-space: nowrap;
    color: #6b7280;
    font-size: 13px;
}

.mft-fo-h2h__table-league {
    color: #6b7280;
    font-size: 13px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mft-fo-h2h__table-teams {
    font-weight: 500;
}

.mft-fo-h2h__table-score {
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.mft-fo-h2h__table-result {
    text-align: center;
}

/* Team highlight in table */
.mft-fo-h2h__team--highlight {
    color: #2563eb;
    font-weight: 600;
}

.mft-fo-h2h--dark .mft-fo-h2h__team--highlight {
    color: #60a5fa;
}

.mft-fo-h2h__team--winner {
    color: #16a34a;
}

.mft-fo-h2h__team--loser {
    color: #dc2626;
}

/* ========================================
   Last Results Table
   ======================================== */

.mft-fo-h2h__results-table {
    width: 100%;
}

.mft-fo-h2h__results-table th {
    text-align: center;
}

.mft-fo-h2h__results-table td {
    text-align: center;
}

.mft-fo-h2h__results-opponent {
    text-align: left !important;
    font-weight: 500;
}

.mft-fo-h2h__results-venue {
    color: #6b7280;
    font-size: 12px;
}

.mft-fo-h2h__results-venue--home {
    color: #22c55e;
}

.mft-fo-h2h__results-venue--away {
    color: #f97316;
}

/* ========================================
   No Data Message
   ======================================== */

.mft-fo-h2h__no-data {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

.mft-fo-h2h__no-data-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .mft-fo-h2h {
        padding: 16px;
    }

    .mft-fo-h2h__title {
        font-size: 16px;
    }

    .mft-fo-h2h__stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .mft-fo-h2h__stat-card {
        padding: 12px;
    }

    .mft-fo-h2h__stat-value {
        font-size: 22px;
    }

    .mft-fo-h2h__table {
        font-size: 13px;
    }

    .mft-fo-h2h__table th,
    .mft-fo-h2h__table td {
        padding: 10px 8px;
    }

    .mft-fo-h2h__table-league {
        display: none;
    }

    .mft-fo-h2h__team-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .mft-fo-h2h__team-name {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .mft-fo-h2h__stats {
        grid-template-columns: 1fr;
    }

    .mft-fo-form__badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .mft-fo-h2h__table-date {
        font-size: 11px;
    }
}

/* ========================================
   H2H Comparison Row (2 teams side by side)
   ======================================== */

.mft-fo-h2h__comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.mft-fo-h2h--dark .mft-fo-h2h__comparison {
    border-bottom-color: #374151;
}

.mft-fo-h2h__comparison:last-child {
    border-bottom: none;
}

.mft-fo-h2h__comparison-home,
.mft-fo-h2h__comparison-away {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mft-fo-h2h__comparison-home {
    align-items: flex-end;
    text-align: right;
}

.mft-fo-h2h__comparison-away {
    align-items: flex-start;
    text-align: left;
}

.mft-fo-h2h__comparison-vs {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
}

.mft-fo-h2h__comparison-value {
    font-size: 24px;
    font-weight: 700;
}

.mft-fo-h2h__comparison-label {
    font-size: 12px;
    color: #6b7280;
}

/* ========================================
   Goal Distribution Chart
   ======================================== */

.mft-fo-h2h__goal-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.mft-fo-h2h__goal-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mft-fo-h2h__goal-period {
    width: 80px;
    font-size: 12px;
    color: #6b7280;
    text-align: right;
}

.mft-fo-h2h__goal-bar-container {
    flex: 1;
    height: 20px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.mft-fo-h2h--dark .mft-fo-h2h__goal-bar-container {
    background: #374151;
}

.mft-fo-h2h__goal-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.mft-fo-h2h__goal-bar--home {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.mft-fo-h2h__goal-bar--away {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.mft-fo-h2h__goal-count {
    width: 40px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
