/* ── Football Hub Client CSS ────────────────────────────────────────────── */

/* Variables */
.fhc-wrap, .fhc-widget {
    --fhc-accent:     #00d46a;
    --fhc-live:       #ff3b3b;
    --fhc-live-bg:    rgba(255,59,59,.1);
    --fhc-gold:       #f5c242;
    --fhc-bg:         #f4f5f7;
    --fhc-card:       #ffffff;
    --fhc-border:     #e4e6ea;
    --fhc-text:       #111827;
    --fhc-text-2:     #374151;
    --fhc-muted:      #6b7280;
    --fhc-light:      #9ca3af;
    --fhc-shadow:     0 1px 4px rgba(0,0,0,.08);
    --fhc-shadow-md:  0 4px 16px rgba(0,0,0,.1);
    --fhc-radius:     8px;
    --fhc-radius-lg:  14px;
    --fhc-font:       -apple-system, 'Segoe UI', Arial, sans-serif;
    --fhc-mono:       'Courier New', monospace;
}

/* Dark mode */
.fhc-dark .fhc-wrap,
.fhc-dark .fhc-widget,
body.fhc-dark .fhc-wrap,
body.fhc-dark .fhc-widget {
    --fhc-bg:     #0d0f14;
    --fhc-card:   #161920;
    --fhc-border: #1f2330;
    --fhc-text:   #e8eaf0;
    --fhc-text-2: #c9cdd8;
    --fhc-muted:  #7a8099;
    --fhc-light:  #4a5068;
    --fhc-shadow: 0 1px 4px rgba(0,0,0,.4);
    --fhc-shadow-md: 0 4px 20px rgba(0,0,0,.5);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
.fhc-wrap {
    font-family: var(--fhc-font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--fhc-text);
    background: var(--fhc-bg);
    min-height: 200px;
    padding: 16px 0;
    box-sizing: border-box;
}

.fhc-wrap *, .fhc-widget * {
    box-sizing: border-box;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.fhc-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
}

@media (max-width: 900px) {
    .fhc-layout { grid-template-columns: 1fr; }
    .fhc-sidebar { display: none; }
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.fhc-card {
    background: var(--fhc-card);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius-lg);
    box-shadow: var(--fhc-shadow);
    margin-bottom: 12px;
}

.fhc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid var(--fhc-border);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--fhc-muted);
}

.fhc-card-head a {
    color: var(--fhc-accent);
    font-size: .72rem;
    text-decoration: none;
}

/* ── Match item ──────────────────────────────────────────────────────────── */
.fhc-match {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--fhc-border);
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: background .1s;
}

.fhc-match:hover { background: var(--fhc-bg); }
.fhc-match:last-child { border-bottom: none; }

.fhc-match-logo { width: 20px; flex-shrink: 0; }
.fhc-match-logo img { width: 18px; height: 18px; object-fit: contain; display: block; }

.fhc-match-teams { flex: 1; min-width: 0; }

.fhc-match-team {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.fhc-match-team img {
    width: 17px;
    height: 17px;
    object-fit: contain;
    flex-shrink: 0;
}

.fhc-match-team-name {
    font-size: .84rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fhc-match-team--win .fhc-match-team-name { font-weight: 700; }

.fhc-match-score {
    text-align: center;
    min-width: 50px;
    flex-shrink: 0;
}

.fhc-match-score-num {
    font-family: var(--fhc-mono);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.fhc-match-time {
    font-size: .75rem;
    font-weight: 600;
    color: var(--fhc-muted);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.fhc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .67rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.fhc-badge--live  { background: var(--fhc-live-bg); color: var(--fhc-live); }
.fhc-badge--done  { background: rgba(107,114,128,.12); color: var(--fhc-muted); }
.fhc-badge--soon  { background: rgba(0,212,106,.1); color: var(--fhc-accent); }
.fhc-badge--delay { background: rgba(245,194,66,.15); color: var(--fhc-gold); }

/* ── Live dot ────────────────────────────────────────────────────────────── */
.fhc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fhc-live);
    display: inline-block;
    animation: fhc-blink 1.4s infinite;
}

@keyframes fhc-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .25; }
}

/* ── Highlights ──────────────────────────────────────────────────────────── */
.fhc-hl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.fhc-hl-card {
    background: var(--fhc-card);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

.fhc-hl-card:hover { transform: translateY(-3px); box-shadow: var(--fhc-shadow-md); }

.fhc-hl-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--fhc-border);
    overflow: hidden;
}

.fhc-hl-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.fhc-hl-card:hover .fhc-hl-thumb img { transform: scale(1.04); }

.fhc-hl-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.3);
    opacity: 0;
    transition: opacity .2s;
}

.fhc-hl-card:hover .fhc-hl-play { opacity: 1; }

.fhc-hl-play-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--fhc-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    padding-left: 3px;
}

.fhc-hl-info { padding: 10px 12px; }

.fhc-hl-title {
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--fhc-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fhc-hl-meta { font-size: .7rem; color: var(--fhc-muted); margin-top: 5px; }

/* ── Video modal ─────────────────────────────────────────────────────────── */
#fhc-video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.92);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#fhc-video-modal.fhc-open { display: flex; }

.fhc-vmodal-inner { width: 100%; max-width: 960px; position: relative; }

.fhc-vmodal-close {
    position: absolute;
    top: -44px;
    right: 0;
    color: rgba(255,255,255,.7);
    font-size: 1.6rem;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.fhc-vmodal-close:hover { color: #fff; }

.fhc-vmodal-frame {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--fhc-radius-lg);
    overflow: hidden;
}

.fhc-vmodal-frame iframe { width: 100%; height: 100%; border: none; }
.fhc-vmodal-title { color: rgba(255,255,255,.8); font-size: .85rem; margin-top: 10px; text-align: center; }

/* ── Standings ───────────────────────────────────────────────────────────── */
.fhc-std-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.fhc-std-table th {
    padding: 8px 10px;
    border-bottom: 2px solid var(--fhc-border);
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--fhc-light);
}

.fhc-std-table th:nth-child(2) { text-align: left; }

.fhc-std-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--fhc-border);
    text-align: center;
}

.fhc-std-table td:nth-child(2) { text-align: left; }
.fhc-std-table tr:last-child td { border-bottom: none; }
.fhc-std-table tr:hover td { background: var(--fhc-bg); }

.fhc-std-pos { font-weight: 700; color: var(--fhc-muted); font-size: .78rem; }
.fhc-std-pos--cl  { color: #2563eb; border-left: 3px solid #2563eb; padding-left: 6px; }
.fhc-std-pos--el  { color: #f97316; border-left: 3px solid #f97316; padding-left: 6px; }
.fhc-std-pos--rel { color: var(--fhc-live); border-left: 3px solid var(--fhc-live); padding-left: 6px; }

.fhc-std-team { display: flex; align-items: center; gap: 7px; font-weight: 500; text-decoration: none; color: inherit; }
.fhc-std-team img { width: 16px; height: 16px; object-fit: contain; }
.fhc-std-pts { font-weight: 800; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.fhc-tabs {
    display: flex;
    gap: 2px;
    background: var(--fhc-bg);
    border-radius: var(--fhc-radius);
    padding: 3px;
    margin-bottom: 12px;
}

.fhc-tab-btn {
    flex: 1;
    padding: 7px 10px;
    border-radius: 6px;
    border: none;
    background: none;
    font-size: .8rem;
    font-weight: 600;
    color: var(--fhc-muted);
    cursor: pointer;
    transition: all .15s;
    font-family: var(--fhc-font);
}

.fhc-tab-btn:hover { color: var(--fhc-text); }
.fhc-tab-btn.fhc-on { background: var(--fhc-card); color: var(--fhc-text); box-shadow: var(--fhc-shadow); }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.fhc-filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.fhc-select {
    padding: 7px 12px;
    border-radius: var(--fhc-radius);
    border: 1px solid var(--fhc-border);
    background: var(--fhc-card);
    color: var(--fhc-text);
    font-family: var(--fhc-font);
    font-size: .8rem;
    cursor: pointer;
    outline: none;
}

/* Date strip */
.fhc-date-strip { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 12px; }

.fhc-date-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: var(--fhc-radius);
    border: 1px solid var(--fhc-border);
    background: var(--fhc-card);
    color: var(--fhc-muted);
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s;
    display: inline-block;
}

.fhc-date-btn.fhc-on,
.fhc-date-btn:hover { border-color: var(--fhc-accent); background: var(--fhc-accent); color: #fff; }

/* ── Match detail - Stats ─────────────────────────────────────────────────── */
.fhc-stat-bars { display: flex; flex-direction: column; gap: 10px; }

.fhc-stat-row {
    display: grid;
    grid-template-columns: 3fr 1fr 3fr;
    gap: 8px;
    align-items: center;
    font-size: .8rem;
}

.fhc-stat-row .fhc-v-h { text-align: right; font-weight: 700; }
.fhc-stat-row .fhc-v-label { text-align: center; font-size: .68rem; color: var(--fhc-light); text-transform: uppercase; letter-spacing: .04em; }
.fhc-stat-row .fhc-v-a { font-weight: 700; }

.fhc-stat-track {
    height: 4px;
    background: var(--fhc-border);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    grid-column: 1/-1;
    margin-top: -6px;
}

.fhc-stat-fill-h { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fhc-accent); border-radius: 2px; }
.fhc-stat-fill-a { position: absolute; right: 0; top: 0; bottom: 0; background: var(--fhc-live); border-radius: 2px; }

/* ── Pitch lineup ────────────────────────────────────────────────────────── */
.fhc-pitch {
    background: linear-gradient(180deg, #1a6b3a, #1e7a43);
    border-radius: var(--fhc-radius-lg);
    padding: 16px;
    min-height: 360px;
}

.fhc-pitch-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }

.fhc-pitch-player { display: flex; flex-direction: column; align-items: center; gap: 3px; }

.fhc-pitch-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 800;
}

.fhc-pitch-num--h { background: rgba(255,255,255,.92); color: #1a6b3a; }
.fhc-pitch-num--a { background: rgba(255,59,59,.9); color: #fff; }

.fhc-pitch-name {
    font-size: .6rem;
    color: rgba(255,255,255,.9);
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    max-width: 56px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fhc-pitch-divider { height: 1px; background: rgba(255,255,255,.2); margin: 6px 0 10px; }

/* ── Events ──────────────────────────────────────────────────────────────── */
.fhc-event {
    display: grid;
    grid-template-columns: 38px 1fr 28px;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--fhc-border);
    font-size: .8rem;
    transition: background .1s;
}

.fhc-event:hover { background: var(--fhc-bg); }
.fhc-event:last-child { border-bottom: none; }
.fhc-event--away { direction: rtl; }

.fhc-event-time { font-size: .7rem; font-weight: 700; color: var(--fhc-accent); }
.fhc-event-player { font-weight: 600; }
.fhc-event-assist { font-size: .7rem; color: var(--fhc-muted); }
.fhc-event-icon { font-size: .9rem; }

/* ── Odds ────────────────────────────────────────────────────────────────── */
.fhc-odds-tbl { width: 100%; border-collapse: collapse; font-size: .8rem; }
.fhc-odds-tbl th { padding: 7px 12px; border-bottom: 2px solid var(--fhc-border); text-align: center; font-size: .68rem; color: var(--fhc-light); text-transform: uppercase; }
.fhc-odds-tbl th:first-child { text-align: left; }
.fhc-odds-tbl td { padding: 8px 12px; border-bottom: 1px solid var(--fhc-border); text-align: center; }
.fhc-odds-tbl td:first-child { text-align: left; color: var(--fhc-muted); font-size: .75rem; }
.fhc-odds-tbl tr:last-child td { border-bottom: none; }
.fhc-odds-val { font-weight: 700; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.fhc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .75rem;
    color: var(--fhc-muted);
    margin-bottom: 14px;
    flex-wrap: wrap;
    font-family: var(--fhc-font);
}

.fhc-breadcrumb a { text-decoration: none; color: var(--fhc-muted); transition: color .15s; }
.fhc-breadcrumb a:hover { color: var(--fhc-accent); }
.fhc-breadcrumb__sep { color: var(--fhc-light); }
.fhc-breadcrumb__cur { color: var(--fhc-text); font-weight: 500; }

/* ── Search ──────────────────────────────────────────────────────────────── */
.fhc-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.fhc-search-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--fhc-radius);
    border: 1px solid var(--fhc-border);
    background: var(--fhc-card);
    color: var(--fhc-text);
    font-family: var(--fhc-font);
    font-size: .9rem;
    outline: none;
    transition: border-color .15s;
}

.fhc-search-input:focus { border-color: var(--fhc-accent); }

.fhc-search-btn {
    padding: 10px 18px;
    border-radius: var(--fhc-radius);
    border: none;
    background: var(--fhc-accent);
    color: #fff;
    font-family: var(--fhc-font);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.fhc-search-btn:hover { background: #00b85c; }

.fhc-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--fhc-border);
    text-decoration: none;
    color: inherit;
    transition: background .1s;
}

.fhc-search-result:hover { background: var(--fhc-bg); }
.fhc-search-result img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.fhc-search-result-name { font-size: .85rem; font-weight: 600; }
.fhc-search-result-type { font-size: .7rem; color: var(--fhc-muted); }

/* ── Stat boxes ──────────────────────────────────────────────────────────── */
.fhc-stat-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px,1fr)); gap: 8px; }

.fhc-stat-box {
    background: var(--fhc-bg);
    border-radius: var(--fhc-radius);
    padding: 10px 8px;
    text-align: center;
}

.fhc-stat-box__n { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.fhc-stat-box__l { font-size: .62rem; color: var(--fhc-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }

/* ── Team grid ───────────────────────────────────────────────────────────── */
.fhc-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 10px; }

.fhc-team-card {
    background: var(--fhc-card);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius-lg);
    padding: 14px 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.fhc-team-card:hover { border-color: var(--fhc-accent); transform: translateY(-2px); box-shadow: var(--fhc-shadow-md); }
.fhc-team-card img { width: 44px; height: 44px; object-fit: contain; margin: 0 auto 8px; display: block; }
.fhc-team-card-name { font-size: .76rem; font-weight: 600; line-height: 1.3; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.fhc-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--fhc-border);
    border-top-color: var(--fhc-accent);
    border-radius: 50%;
    animation: fhc-spin .6s linear infinite;
    display: inline-block;
}

@keyframes fhc-spin { to { transform: rotate(360deg); } }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.fhc-pagination { display: flex; justify-content: center; gap: 5px; padding: 16px 0; }

.fhc-pg-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--fhc-border);
    background: var(--fhc-card);
    color: var(--fhc-muted);
    font-size: .82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s;
}

.fhc-pg-btn:hover, .fhc-pg-btn.fhc-on {
    background: var(--fhc-accent);
    border-color: var(--fhc-accent);
    color: #fff;
}

/* ── Error / Stale banners ───────────────────────────────────────────────── */
.fhc-error {
    background: var(--fhc-card);
    border: 1px solid var(--fhc-border);
    border-radius: var(--fhc-radius-lg);
    padding: 40px 20px;
    text-align: center;
    color: var(--fhc-muted);
    font-family: var(--fhc-font);
}

.fhc-error__icon { font-size: 2.5rem; margin-bottom: 10px; }
.fhc-error__title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--fhc-text); }
.fhc-error__msg { font-size: .85rem; }

.fhc-stale {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--fhc-radius);
    padding: 8px 14px;
    font-size: .8rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-family: var(--fhc-font);
}

/* ── Section head ────────────────────────────────────────────────────────── */
.fhc-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fhc-sec-head__title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fhc-muted); white-space: nowrap; font-family: var(--fhc-font); }
.fhc-sec-head__line { flex: 1; height: 1px; background: var(--fhc-border); }
.fhc-sec-head__more { font-size: .72rem; font-weight: 700; color: var(--fhc-accent); white-space: nowrap; text-decoration: none; }

/* ── Dark toggle button ──────────────────────────────────────────────────── */
.fhc-theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid var(--fhc-border);
    background: var(--fhc-card);
    color: var(--fhc-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .95rem;
    transition: all .15s;
    font-family: var(--fhc-font);
}

.fhc-theme-toggle:hover { background: var(--fhc-border); }

/* ── Page title bar ──────────────────────────────────────────────────────── */
.fhc-page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.fhc-page-title h1 { font-size: 1.4rem; font-weight: 800; margin: 0; color: var(--fhc-text); }

/* ── Form badges (form W/D/L) ─────────────────────────────────────────────── */
.fhc-form-row { display: flex; gap: 3px; }
.fhc-fw, .fhc-fd, .fhc-fl { width: 18px; height: 18px; border-radius: 3px; font-size: .62rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.fhc-fw { background: rgba(0,212,106,.2); color: var(--fhc-accent); }
.fhc-fd { background: var(--fhc-border); color: var(--fhc-muted); }
.fhc-fl { background: rgba(255,59,59,.15); color: var(--fhc-live); }

/* ── Widget ──────────────────────────────────────────────────────────────── */
.fhc-widget {
    font-family: var(--fhc-font);
    font-size: 14px;
    color: var(--fhc-text);
}

.fhc-widget .fhc-card { margin-bottom: 0; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .fhc-hl-grid { grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }
    .fhc-team-grid { grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); }
    .fhc-layout { gap: 12px; }
}
