/* ============================================================
   GroupWidget — styles.css
   World Cup 2026
   Compact single-group standings widget (iframe embed)
   ============================================================ */

@font-face {
    font-family: 'MosesText';
    src: url('../assets/fonts/MosesText_Inter-VF.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MosesText', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    color: #03122B;
    direction: rtl;
}

/* ── Widget shell ────────────────────────────────────────── */

.widget {
    display: flex;
    flex-direction: column;
    background: #fff;
    padding-bottom: 15px;
    max-width: 400px;
    margin: auto;
}

/* ── Header ─────────────────────────────────────────────── */

.widget__header {
    height: 50px;
    flex-shrink: 0;
    background-image: url('../assets/images/bg_2.png?v=4b973086');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: right;
    overflow: hidden;
    padding-right: 15px;
}

.widget__title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

/* ── Column headers ─────────────────────────────────────── */

.widget__col-headers {
    display: flex;
    align-items: center;
    direction: rtl;
    background: transparent;
}

.widget__team-spacer {
    flex: 1;
    min-width: 0;
}

.widget__stats-header {
    display: flex;
    gap: 4px;
    padding: 5px 0;
    flex-shrink: 0;
}

/* shared column width helpers */
.wh-col,
.wr-col {
    display: inline-block;
    text-align: center;
    flex-shrink: 0;
}

.wh-col {
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    background: #30334E;
    padding: 5px 0;
}

.wh-col--p,  .wr-col--p  { width: 37px; }
.wh-col--w,  .wr-col--w  { width: 25px; }
.wh-col--d,  .wr-col--d  { width: 26px; }
.wh-col--l,  .wr-col--l  { width: 30px; }
.wh-col--gd, .wr-col--gd { width: 37px; }
.wh-col--pts,.wr-col--pts { width: 37px; font-weight: 700; }

/* ── Data rows ──────────────────────────────────────────── */

.widget__rows {
    display: flex;
    flex-direction: column;
}

.widget__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 30px;
    border-bottom: 1px solid #D9E6EF;
    direction: rtl;
}

/* Team cell: position + name, colored indicator on the right edge */
.widget__row-team {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-start; /* RTL: flex-start = physical right */
    padding-inline-start: 4px;
    border-inline-start: 3px solid transparent;
}

.widget__row-team--green  { border-inline-start-color: #00B140; }
.widget__row-team--orange { border-inline-start-color: #F09316; }

.widget__row-rank {
    font-size: 16px;
    font-weight: 700;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}

.widget__row-name {
    font-size: 14px;
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.widget__row-flag {
    height: 16px;
    width: 22px;
    object-fit: cover;
    border: 0.5px solid rgba(0,0,0,0.12);
    border-radius: 1px;
    flex-shrink: 0;
}

/* Stats cell */
.widget__row-stats {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.wr-col {
    font-size: 15px;
    font-weight: 400;
    color: #03122B;
}

.wr-col--pts {
    font-size: 18px;
    font-weight: 700;
}

/* ── Loading / error ─────────────────────────────────────── */

.widget__loading,
.widget__error {
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: #A5ACBB;
}

.widget__error {
    color: #E41D35;
}

/* ── Footer ─────────────────────────────────────────────── */

.widget__footer {
    display: flex;
    align-items: center;
    padding-top: 10px;
    direction: ltr; /* arrow on physical left, text to its right */
}

.widget__footer-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #03122B;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
}

.widget__footer-link span {
    border-bottom: 1px solid #03122B;
    line-height: 1.4;
}

.widget__footer-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
