/* ==========================================
   Summary
========================================== */

.h2h-widget{

    border-radius:20px;

     margin-bottom:18px;

}

.h2h-history-title{

    display:flex;

    align-items:center;

    justify-content:center;

    gap:10px;

    margin:1px 0 12px;

    color:#374151;

    font-size:14px;

    font-weight:400;

}

.h2h-history-title::before,
.h2h-history-title::after{

    content:"";

    flex:1;

    height:1px;

    background:#ececec;

}

.h2h-history-title i{

    color:#16a34a;

    font-size:15px;

}

/* ==========================================
   H2H Summary - Modern Design
========================================== */

.h2h-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 12px;

    padding: 24px 18px 16px;
    text-align: center;
}

.h2h-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.h2h-team-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 32px;
    margin-bottom: 8px;
}

.h2h-team-logo img {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.h2h-stat-spacer {
    height: 40px;
    margin-bottom: 0;
}

.h2h-stat-number {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    border-radius: 12px;
    border: 1px solid var(--h2h-stat-color, #1687F8);
    background: var(--h2h-stat-color, #1687F8);
    color: #fff;

    font-size: 21px;
    font-weight: 600;
    line-height: 1;

    box-sizing: border-box;
}

.h2h-draw-number {
    background: #d1d5db;
    border-color: #d1d5db;
    color: #1f2937;
}

.h2h-stat-label {
    margin-top: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.h2h-results-bar {
    display: flex;
    gap: 4px;

    width: 70%;
    height: 8px;
    margin: 0 auto 22px;

    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.h2h-results-bar span {
    display: block;
    flex: 0 0 auto;
    min-width: 0;
    height: 100%;
}

.h2h-bar-draw {
    background: #d1d5db;
}

.h2h-bar-empty {
    width: 100%;
    background: #e5e7eb;
}

/* ==========================================
   Mobile
========================================== */

@media (max-width: 768px) {

    .h2h-summary {
        gap: 8px;
        padding: 22px 12px 14px;
    }

    .h2h-team-logo {
        width: 40px;
        height: 32px;
    }

    .h2h-team-logo img {
        width: 40px;
        height: 45px;
    }

    .h2h-stat-number {
        width: 52px;
        height: 52px;
        border-radius: 12px;
        font-size: 20px;
    }

    .h2h-stat-label {
        font-size: 12px;
    }

      .h2h-results-bar {
        width: 75%;
        height: 8px;
        margin: 0 auto 20px;
    }

}


/* ==========================================
   Total
========================================== */

.h2h-list{
    margin-top:5px;
}

.h2h-match{

    display:block;

      padding:20px 24px;

    background:#fff;

    border:1px solid #ececec;

    border-radius:16px;

    margin-top:14px;

    transition:.25s;

}

.h2h-match:hover{
    background:#f8fafc;
}

.h2h-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:16px;

}

.h2h-competition{
    display:flex;
    align-items:center;
    gap:6px;
    font-size:13px;
    color:#6b7280;
}

.h2h-competition i{
    color:#f59e0b;
}

.h2h-date{
    font-size:13px;
    color:#6b7280;
}

.h2h-bottom{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:18px;
}

.h2h-home,
.h2h-away{
    display:flex;
    align-items:center;
    gap:8px;
    width:180px;
}

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

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

.h2h-home img,
.h2h-away img{
    width:28px;
    height:28px;
    object-fit:contain;
}

.h2h-score{
    min-width:48px;
    text-align:center;
    font-size:18px;
    font-weight:700;
}

.h2h-team-name{
    font-size:13px;
     font-weight:500;
    color:#374151;
    white-space:nowrap;
}

@media(max-width:768px){

    .h2h-header{

        display:flex;

        justify-content:space-between;

        align-items:center;


    }

    .h2h-bottom{
        gap:10px;
    }

    .h2h-home,
    .h2h-away{
        width:auto;
        flex:1;
    }

    .h2h-team-name{
        font-size:12px;
    }

    .h2h-score{
        min-width:42px;
    }

}

/* =========================================
   سجل المواجهات - توحيد عرض البطاقتين
========================================= */

@media (max-width: 768px) {

    .match-page .match-content .match-widget.h2h-widget {
        width: calc(100vw - 30px) !important;
        max-width: none !important;

        margin-left: calc((100% - (100vw - 30px)) / 2) !important;
        margin-right: calc((100% - (100vw - 30px)) / 2) !important;

        box-sizing: border-box !important;
    }

}

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

/* =========================================
   H2H - French date direction
========================================= */

.h2h-widget--fr .h2h-date {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    text-align: left;
}

/* =========================================
   H2H - French / LTR
========================================= */

.h2h-widget--fr {
    direction: ltr !important;
    text-align: left !important;
}

/* العنوان */
.h2h-widget--fr .h2h-history-title {
    direction: ltr !important;
    text-align: left !important;
}

/* بطاقة المواجهة */
.h2h-widget--fr .h2h-match {
    direction: ltr !important;
    text-align: left !important;
}

/* رأس البطاقة */
.h2h-widget--fr .h2h-header {
    direction: ltr !important;
}

/* البطولة */
.h2h-widget--fr .h2h-competition {
    direction: ltr !important;
    text-align: left !important;
}

/* التاريخ */
.h2h-widget--fr .h2h-date {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    text-align: left !important;
}

/* المواجهة */
.h2h-widget--fr .h2h-bottom {
    direction: ltr !important;
}

/* الفريق المضيف - يسار */
.h2h-widget--fr .h2h-home {
    direction: ltr !important;
    justify-content: flex-end !important;
    text-align: right !important;
}

/* النتيجة */
.h2h-widget--fr .h2h-score {
    direction: ltr !important;
    text-align: center !important;
}

/* الفريق الضيف - يمين */
.h2h-widget--fr .h2h-away {
    direction: ltr !important;
    justify-content: flex-start !important;
    text-align: left !important;
}

/* أسماء الفرق */
.h2h-widget--fr .h2h-team-name {
    direction: ltr !important;
}

/* الشعارات */
.h2h-widget--fr .h2h-home img,
.h2h-widget--fr .h2h-away img {
    flex-shrink: 0;
}


/* H2H team names: full on desktop, short on mobile */
.h2h-team-name--short {
    display: none;
}

@media (max-width: 768px) {
    .h2h-team-name--full {
        display: none !important;
    }

    .h2h-team-name--short {
        display: inline !important;
        white-space: nowrap;
    }

    .h2h-home,
    .h2h-away {
        min-width: 0;
    }
}


/* Arabic H2H date order */

.h2h-date-parts {
    display: inline-flex;
    flex-direction: row;
    direction: ltr !important;
    unicode-bidi: isolate !important;
    gap: 4px;
    white-space: nowrap;
}

.h2h-date-parts > span {
    display: inline-block;
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* Keep Arabic month text isolated */
.h2h-date-parts > span[dir="rtl"] {
    direction: rtl !important;
    unicode-bidi: isolate !important;
}


.h2h-date-parts > span {
    display: inline-block;
    unicode-bidi: isolate;
}


.h2h-date-parts {
    display: inline-flex !important;
    flex-direction: row !important;
    direction: ltr !important;
    gap: 4px;
    white-space: nowrap;
}

.h2h-date-parts > span {
    display: inline-block;
    unicode-bidi: isolate;
}

