/* ================================================================
   Football Leagues Pro — Frontend Stylesheet v3.0.0
   ================================================================ */

/* ---- Reset / Base -------------------------------------------- */
.flp-wrap {
    --flp-border:   #e5e7eb;
    --flp-bg:       #f9fafb;
    --flp-bg2:      #f3f4f6;
    --flp-text:     #111827;
    --flp-muted:    #6b7280;
    --flp-radius:   10px;
    --flp-shadow:   0 1px 4px rgba(0,0,0,.07);
    --flp-shadow-h: 0 6px 20px rgba(0,0,0,.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--flp-text);
    line-height: 1.5;
    box-sizing: border-box;
    margin-bottom: 28px;
}
.flp-wrap *, .flp-wrap *::before, .flp-wrap *::after { box-sizing: inherit; }

/* ---- Utility ------------------------------------------------- */
.flp-card {
    background: #fff;
    border: 1px solid var(--flp-border);
    border-radius: var(--flp-radius);
    overflow: hidden;
    box-shadow: var(--flp-shadow);
}
.flp-card-body { padding: 16px; }

.flp-error {
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: var(--flp-radius); padding: 12px 16px;
    color: #991b1b; font-size: 14px; display: flex; gap: 8px; align-items: flex-start;
}
.flp-empty {
    background: var(--flp-bg2); border-radius: var(--flp-radius);
    padding: 24px; text-align: center; color: var(--flp-muted);
}

/* ---- Crests -------------------------------------------------- */
.flp-crest {
    object-fit: contain; flex-shrink: 0;
    display: inline-block; vertical-align: middle;
}
.flp-no-crest {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--flp-bg2); color: var(--flp-muted);
    font-weight: 700; flex-shrink: 0;
}

/* ---- League header bar --------------------------------------- */
.flp-league-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; color: #fff;
}
.flp-lb-emoji   { font-size: 20px; }
.flp-lb-name    { font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.flp-lb-country { margin-left: auto; font-size: 12px; opacity: .75; }
.flp-lb-count   { margin-left: auto; font-size: 12px; opacity: .75; font-weight: 500; }

/* ---- Status badges ------------------------------------------ */
.flp-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: .3px;
}
.badge-live   { background: #dc2626; color: #fff; animation: flp-pulse 1.4s infinite; }
.badge-done   { background: var(--flp-bg2); color: var(--flp-muted); }
.badge-sched  { background: #dcfce7; color: #15803d; }
.badge-warn   { background: #fef3c7; color: #92400e; }

@keyframes flp-pulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ================================================================
   MATCHES
   ================================================================ */
.flp-day-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--flp-muted);
    padding: 6px 0; border-bottom: 2px solid var(--flp-border);
    margin: 20px 0 8px;
}
.flp-day-label:first-child { margin-top: 0; }

.flp-match {
    background: #fff; border: 1px solid var(--flp-border);
    border-radius: var(--flp-radius); padding: 12px 14px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 8px 12px;
    box-shadow: var(--flp-shadow);
    transition: box-shadow .15s, transform .1s;
}
.flp-match:hover  { box-shadow: var(--flp-shadow-h); }
.flp-match.flp-live { border-color: #dc2626; border-left-width: 3px; background: #fff8f8; }
.flp-match.flp-done { background: var(--flp-bg); }

.flp-team {
    display: flex; align-items: center; gap: 9px;
}
.flp-team-away {
    flex-direction: row-reverse; text-align: right;
}
.flp-tname { font-weight: 600; font-size: 14px; }

@media (max-width: 500px) {
    .flp-tname { font-size: 12px; }
    .flp-crest { width: 24px !important; height: 24px !important; }
}

.flp-score-col {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 5px; min-width: 90px;
}
.flp-score {
    font-size: 26px; font-weight: 800; line-height: 1;
    display: flex; align-items: center; gap: 4px;
}
.flp-score-sep { color: #d1d5db; font-weight: 300; }
.flp-minute    { font-size: 11px; font-weight: 700; color: #dc2626; }
.flp-ht        { font-size: 11px; color: var(--flp-muted); }
.flp-ko        { font-size: 17px; font-weight: 700; }

.flp-match-meta {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 10px;
    font-size: 11px; color: #9ca3af;
}
.flp-match-meta span { display: flex; align-items: center; gap: 3px; }

/* ================================================================
   STANDINGS TABLE
   ================================================================ */
.flp-section-sub {
    background: var(--flp-bg2); padding: 8px 16px;
    font-weight: 700; font-size: 13px; text-transform: uppercase;
    letter-spacing: .5px; color: #374151;
    border-bottom: 1px solid var(--flp-border);
}

.flp-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.flp-table thead tr { background: var(--flp-bg2); }
.flp-table th {
    padding: 8px 10px; font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: .5px; color: var(--flp-muted);
    text-align: center; white-space: nowrap;
}
.flp-table th.col-team, .flp-table td.col-team { text-align: left; }
.flp-table td {
    padding: 9px 10px; border-top: 1px solid var(--flp-border);
    text-align: center; vertical-align: middle;
}
.flp-table tr:hover td { background: var(--flp-bg); }

.col-pos  { width: 36px; font-weight: 700; }
.col-team { display: flex !important; align-items: center; gap: 8px; min-width: 140px; }
.col-pts  { font-weight: 700; }
.col-form { width: 100px; }

/* Zone markers */
.flp-table tr.z-ucl  td:first-child { border-left: 3px solid #15803d; }
.flp-table tr.z-uel  td:first-child { border-left: 3px solid #f97316; }
.flp-table tr.z-conf td:first-child { border-left: 3px solid #eab308; }
.flp-table tr.z-rel  td:first-child { border-left: 3px solid #dc2626; }

/* GD */
.flp-gd       { font-weight: 500; }
.flp-gd.pos   { color: #15803d; }
.flp-gd.neg   { color: #dc2626; }

/* Form dots */
.flp-form { display: flex; gap: 2px; align-items: center; }
.flp-fd {
    width: 18px; height: 18px; border-radius: 50%;
    font-size: 10px; font-weight: 700; line-height: 18px;
    text-align: center; display: inline-block;
}
.fw { background: #15803d; color: #fff; }
.fd { background: #9ca3af; color: #fff; }
.fl { background: #dc2626; color: #fff; }

.flp-tn { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* Legend */
.flp-legend {
    display: flex; flex-wrap: wrap; gap: 12px;
    padding: 8px 14px; font-size: 11px; color: var(--flp-muted);
    border-top: 1px solid var(--flp-border);
}
.flp-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 2px; margin-right: 3px; vertical-align: middle;
}

/* ================================================================
   GROUPS GRID
   ================================================================ */
.flp-groups-header {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 800; margin-bottom: 18px;
}
.flp-gh-emoji { font-size: 28px; }

.flp-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.flp-group-card {
    background: #fff; border: 1px solid var(--flp-border);
    border-radius: var(--flp-radius); overflow: hidden;
    box-shadow: var(--flp-shadow);
}
.flp-group-head {
    padding: 10px 14px; font-weight: 700; font-size: 13px;
    text-transform: uppercase; letter-spacing: 1px; color: #fff;
}

.flp-gtable { width: 100%; border-collapse: collapse; font-size: 12px; }
.flp-gtable th {
    background: var(--flp-bg2); padding: 6px 8px;
    font-weight: 600; text-align: center; color: var(--flp-muted);
    font-size: 10px; text-transform: uppercase;
}
.flp-gtable th.gt-team { text-align: left; }
.flp-gtable td {
    padding: 8px 8px; border-top: 1px solid var(--flp-border);
    text-align: center; vertical-align: middle;
}
.flp-gtable td.gt-team {
    text-align: left; display: flex; align-items: center; gap: 5px;
    white-space: nowrap;
}
.flp-gtable .gt-pts { font-weight: 700; }
.flp-gtable tr.zg-1 td:first-child { border-left: 3px solid #15803d; }
.flp-gtable tr.zg-2 td:first-child { border-left: 3px solid #3b82f6; }
.flp-gtable tr.zg-3 td:first-child { border-left: 3px solid #f59e0b; }
.flp-gtable tr:hover td { background: var(--flp-bg); }

.flp-group-leg {
    padding: 7px 12px; font-size: 10px; color: var(--flp-muted);
    border-top: 1px solid var(--flp-border);
    display: flex; gap: 12px;
}

/* ================================================================
   TEAMS GRID
   ================================================================ */
.flp-teams-note {
    font-size: 12px; color: var(--flp-muted);
    background: var(--flp-bg2); border-radius: 8px;
    padding: 8px 12px; margin: 0 0 16px;
    border-left: 3px solid #d1d5db;
}
.flp-teams-grid {
    display: grid;
    grid-template-columns: repeat(var(--tc, 4), 1fr);
    gap: 14px;
}
@media (max-width: 920px) { .flp-teams-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .flp-teams-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .flp-teams-grid { grid-template-columns: 1fr; } }

/* Card - uniform height, flex column so ID badge always at bottom */
.flp-team-card {
    background: #fff;
    border: 1px solid var(--flp-border);
    border-radius: var(--flp-radius);
    padding: 18px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    box-shadow: var(--flp-shadow);
    transition: box-shadow .15s, transform .15s;
    min-height: 180px;
}
.flp-team-card:hover { box-shadow: var(--flp-shadow-h); transform: translateY(-2px); }

/* Crest container - fixed size, perfectly centered */
.flp-tc-crest {
    width: 72px; height: 72px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px; flex-shrink: 0;
}
.flp-tc-crest img {
    width: 72px; height: 72px;
    object-fit: contain;
    display: block;
}
.flp-tc-no-crest {
    width: 72px; height: 72px;
    background: var(--flp-bg2); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: var(--flp-muted); font-size: 16px;
}

/* Info block fills remaining space */
.flp-tc-info {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; gap: 3px;
    width: 100%;
}
.flp-tc-name {
    font-weight: 700; font-size: 13px; line-height: 1.3;
    color: var(--flp-text); margin-bottom: 4px;
}
.flp-tc-meta { font-size: 11px; color: var(--flp-muted); line-height: 1.4; }

/* ID badge pinned at bottom */
.flp-tc-id {
    margin-top: 10px;
    font-size: 10px; font-weight: 600;
    color: #6b7280;
    background: var(--flp-bg2);
    border: 1px solid var(--flp-border);
    border-radius: 20px;
    padding: 2px 10px;
    letter-spacing: .3px;
    flex-shrink: 0;
}

/* ================================================================
   SQUAD
   ================================================================ */
.flp-squad-header {
    background: #fff; border: 1px solid var(--flp-border);
    border-radius: var(--flp-radius); padding: 20px;
    display: flex; align-items: flex-start; gap: 18px;
    margin-bottom: 20px; box-shadow: var(--flp-shadow);
}
.flp-sh-crest img { width: 72px; height: 72px; object-fit: contain; }
.flp-sh-name  { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.flp-sh-meta-grid { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--flp-muted); }
.flp-sh-comps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.flp-comp-tag {
    background: var(--flp-bg2); color: var(--flp-muted);
    font-size: 11px; font-weight: 500; padding: 2px 10px;
    border-radius: 20px; border: 1px solid var(--flp-border);
}
.flp-sh-count { font-size: 12px; color: #9ca3af; margin-top: 6px; }

.flp-pos-section { margin-bottom: 22px; }
.flp-pos-label {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 13px; text-transform: uppercase;
    letter-spacing: .5px; padding: 8px 0;
    border-bottom: 2px solid var(--flp-border); margin-bottom: 8px;
}
.flp-pos-count { font-size: 11px; color: var(--flp-muted); font-weight: 400; }

.flp-pos { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; display: inline-block; }
.pos-gk  { background: #fef3c7; color: #92400e; }
.pos-df  { background: #dbeafe; color: #1e40af; }
.pos-mf  { background: #dcfce7; color: #15803d; }
.pos-fw  { background: #fce7f3; color: #9d174d; }

.flp-squad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.flp-squad-table thead tr { background: var(--flp-bg2); }
.flp-squad-table th {
    padding: 8px 10px; font-weight: 600; text-align: left;
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--flp-muted);
}
.flp-squad-table td { padding: 9px 10px; border-top: 1px solid var(--flp-border); vertical-align: middle; }
.flp-squad-table tr:hover td { background: var(--flp-bg); }
.flp-num { font-weight: 700; text-align: center; width: 40px; }

/* ================================================================
   SCORERS
   ================================================================ */
.flp-scorers-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.flp-scorers-table thead tr { color: #fff; }
.flp-scorers-table th { padding: 10px 12px; font-weight: 600; font-size: 12px; text-align: left; white-space: nowrap; }
.flp-scorers-table td { padding: 10px 12px; border-top: 1px solid var(--flp-border); vertical-align: middle; }
.flp-scorers-table tr:hover td { background: var(--flp-bg); }

.sc-rank   { font-weight: 700; font-size: 16px; width: 36px; }
.sc-player { font-weight: 600; }
.sc-nat    { font-size: 11px; color: var(--flp-muted); }
.sc-club   { display: flex; align-items: center; gap: 6px; }
.sc-goals  { font-weight: 800; font-size: 18px; text-align: center; }

.sc-gold   td:first-child { border-left: 4px solid #d97706; }
.sc-silver td:first-child { border-left: 4px solid #9ca3af; }
.sc-bronze td:first-child { border-left: 4px solid #92400e; }

/* ================================================================
   DASHBOARD
   ================================================================ */
.flp-dashboard > .flp-league-bar {
    border-radius: var(--flp-radius) var(--flp-radius) 0 0;
}
.flp-dash-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    background: #fff;
    border: 1px solid var(--flp-border);
    border-top: none;
    border-radius: 0 0 var(--flp-radius) var(--flp-radius);
    padding: 16px;
    box-shadow: var(--flp-shadow);
}
@media (max-width: 860px) { .flp-dash-grid { grid-template-columns: 1fr; } }

.flp-dash-title {
    font-weight: 700; font-size: 15px; margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 2px solid var(--flp-border);
}

/* Dashboard match row */
.flp-dash-match {
    background: #fff; border: 1px solid var(--flp-border);
    border-radius: 8px; padding: 10px 12px;
    margin-bottom: 8px; transition: box-shadow .15s;
}
.flp-dash-match:hover { box-shadow: var(--flp-shadow-h); }
.flp-dash-match.flp-live { border-color: #dc2626; border-left-width: 3px; }
.flp-dash-match.flp-done { background: var(--flp-bg); }

.flp-dm-date {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: var(--flp-muted); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .5px;
}
.flp-dm-md { font-weight: 600; }

.flp-dm-teams {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 8px;
}
.flp-dm-team { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.flp-dm-away { flex-direction: row-reverse; text-align: right; }
.flp-dm-score { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 80px; }
.flp-dm-score strong { font-size: 20px; font-weight: 800; }
.flp-dm-time { font-size: 14px; font-weight: 700; }

/* ================================================================
   LIVE REFRESH BANNER
   ================================================================ */
.flp-live-banner {
    display: inline-flex; align-items: center; gap: 8px;
    background: #dc2626; color: #fff; border-radius: 8px;
    padding: 8px 16px; font-size: 13px; font-weight: 600;
    margin-bottom: 12px; animation: flp-pulse 1.4s infinite;
}

/* ================================================================
   RESPONSIVE TWEAKS
   ================================================================ */
@media (max-width: 640px) {
    .flp-match      { gap: 6px 8px; padding: 10px; }
    .flp-score      { font-size: 20px; }
    .flp-tn         { font-size: 12px; }
    .col-form       { display: none; }
    .flp-table th:nth-child(n+6):not(.col-pts),
    .flp-table td:nth-child(n+6):not(.col-pts) { display: none; }
}
