/* ============================================================
   TeamMatchesWidget — styles.css
   World Cup 2026
   Compact team-matches widget (iframe embed)
   Usage: TeamMatchesWidget/index.html?countryCode=KR
   ============================================================ */

@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;
    max-height: 390px;
}

/* ── Header ─────────────────────────────────────────────── */

.widget__header {
    height: 50px;
    flex-shrink: 0;
    background-color: #00182F;
    background-image: url('../assets/images/bg_2.png?v=4b973086');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.widget__title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    padding: 0 10px;
    text-align: center;
}

/* ── Match list ──────────────────────────────────────────── */

.widget__matches {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* direction:ltr pushes the scrollbar to the right side even in RTL layout */
    direction: ltr;
    /* Scrollbar hidden by default — shown on widget hover */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.widget__matches::-webkit-scrollbar {
    display: none;
}

.widget:hover .widget__matches {
    scrollbar-width: thin;
    scrollbar-color: #A5ACBB transparent;
}

.widget:hover .widget__matches::-webkit-scrollbar {
    display: block;
    width: 4px;
}

.widget:hover .widget__matches::-webkit-scrollbar-thumb {
    background: #A5ACBB;
    border-radius: 2px;
}

/* ── Match card ──────────────────────────────────────────── */

/* Restore RTL for card content inside the ltr scroll container */
.tm-card {
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: #EEF2FB;
    border-bottom: 1px solid #A5ACBB;
    border-left: 1px solid #A5ACBB;
    border-right: 1px solid #A5ACBB;
    flex-shrink: 0;
}

/* Team column (flag + name, vertical) */
.tm-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 70px;
    flex-shrink: 0;
}

.tm-card__flag {
    height: 23px;
    width: 30px;
    object-fit: cover;
    border-radius: 1px;
    flex-shrink: 0;
}

.tm-card__flag-placeholder {
    height: 23px;
    width: 30px;
    flex-shrink: 0;
    display: inline-block;
}

.tm-card__name {
    font-size: 14px;
    font-weight: 300;
    color: #03122B;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

/* Center info column */
.tm-card__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.tm-card__meta {
    font-size: 14px;
    font-weight: 400;
    color: #03122B;
    text-align: center;
    white-space: nowrap;
}

/* Score row */
.tm-card__score-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-card__score-digit {
    font-size: 30px;
    font-weight: 700;
    color: #03122B;
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

.tm-card__score-sep {
    font-size: 20px;
    font-weight: 700;
    color: #03122B;
    width: 20px;
    text-align: center;
    line-height: 1;
}

/* Time for upcoming matches (same size as score) */
.tm-card__time {
    font-size: 24px;
    font-weight: 700;
    color: #03122B;
    text-align: center;
    line-height: 1;
}

.tm-card__time[data-kickoff] {
    color: #E41D35;
}

.tm-card__time--soon {
    font-size: 14px;
    color: #E41D35;
    line-height: 1.35;
    font-weight: 500;
}

/* Status line below score/time */
.tm-card__status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #03122B;
    text-align: center;
}

.tm-card__status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #30D158;
    flex-shrink: 0;
}

/* Overnight label (red) */
.tm-card__overnight {
    font-size: 12px;
    font-weight: 500;
    color: #F43056;
    text-align: center;
}

/* ── 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;
}

.widget__footer-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #03122B;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.widget__footer-link span {
    border-bottom: 1px solid #03122B;
    line-height: 1.4;
}

.widget__footer-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
