/* =========================================================
   Football World Cup Plugin — Frontend Styles
   ========================================================= */

/* ---- Base / Tokens ---- */
.fwc-wrap {
    --fwc-green:     #1a7a4a;
    --fwc-green-lt:  #e8f5ee;
    --fwc-gold:      #d4a010;
    --fwc-red:       #dc2626;
    --fwc-gray-50:   #f9fafb;
    --fwc-gray-100:  #f3f4f6;
    --fwc-gray-200:  #e5e7eb;
    --fwc-gray-400:  #9ca3af;
    --fwc-gray-600:  #4b5563;
    --fwc-gray-900:  #111827;
    --fwc-radius:    10px;
    --fwc-shadow:    0 1px 4px rgba(0,0,0,.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--fwc-gray-900);
    line-height: 1.5;
    box-sizing: border-box;
}
.fwc-wrap *, .fwc-wrap *::before, .fwc-wrap *::after { box-sizing: inherit; }

.fwc-error {
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: var(--fwc-radius); padding: 14px 18px;
    color: #b91c1c; font-size: 14px;
}
.fwc-empty {
    background: var(--fwc-gray-100); border-radius: var(--fwc-radius);
    padding: 24px; text-align: center; color: var(--fwc-gray-600); font-size: 14px;
}

/* =========================================================
   CRESTS
   ========================================================= */
.fwc-crest {
    width: 36px; height: 36px;
    object-fit: contain; flex-shrink: 0;
}
.fwc-crest--sm { width: 22px; height: 22px; }

/* =========================================================
   STATUS BADGES
   ========================================================= */
.fwc-status {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px; text-transform: uppercase;
    letter-spacing: .5px;
}
.fwc-status--live       { background: #dc2626; color: #fff; animation: fwc-pulse 1.5s infinite; }
.fwc-status--finished   { background: var(--fwc-gray-200); color: var(--fwc-gray-600); }
.fwc-status--scheduled  { background: var(--fwc-green-lt); color: var(--fwc-green); }
.fwc-status--suspended  { background: #fef3c7; color: #92400e; }

@keyframes fwc-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .65; }
}

/* =========================================================
   MATCHES
   ========================================================= */
.fwc-section-title {
    font-size: 20px; font-weight: 700; margin-bottom: 20px;
    color: var(--fwc-green); border-left: 4px solid var(--fwc-green);
    padding-left: 12px;
}

.fwc-day-group { margin-bottom: 24px; }

.fwc-day-header {
    font-size: 13px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1px; color: var(--fwc-gray-600);
    padding: 8px 0; border-bottom: 2px solid var(--fwc-gray-200);
    margin-bottom: 8px;
}

.fwc-match-list { display: flex; flex-direction: column; gap: 8px; }

.fwc-match {
    background: #fff; border: 1px solid var(--fwc-gray-200);
    border-radius: var(--fwc-radius); padding: 12px 16px;
    box-shadow: var(--fwc-shadow); transition: box-shadow .15s;
}
.fwc-match:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.fwc-match--live { border-color: var(--fwc-red); border-left-width: 3px; }
.fwc-match--finished { background: var(--fwc-gray-50); }

.fwc-match__meta {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
}
.fwc-match__group {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: var(--fwc-green);
    background: var(--fwc-green-lt); padding: 2px 8px; border-radius: 10px;
}

.fwc-match__teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.fwc-match__team {
    display: flex; align-items: center; gap: 10px;
}
.fwc-match__team--away {
    flex-direction: row-reverse;
    text-align: right;
}

.fwc-match__team-name {
    font-weight: 600; font-size: 15px;
}
.fwc-match__team-name--short { display: none; }

@media (max-width: 560px) {
    .fwc-match__team-name--full  { display: none; }
    .fwc-match__team-name--short { display: inline; }
    .fwc-crest { width: 28px; height: 28px; }
}

.fwc-match__score {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-width: 80px;
}

.fwc-score {
    font-size: 26px; font-weight: 800; line-height: 1;
    display: flex; align-items: center; gap: 6px;
}
.fwc-score__sep { color: var(--fwc-gray-400); font-weight: 300; }
.fwc-score__minute {
    font-size: 12px; color: var(--fwc-red); font-weight: 700;
}
.fwc-score__ht {
    font-size: 11px; color: var(--fwc-gray-400);
}
.fwc-score__time {
    font-size: 18px; font-weight: 700; color: var(--fwc-green);
}

.fwc-match__venue {
    margin-top: 8px; font-size: 11px; color: var(--fwc-gray-400);
}

/* =========================================================
   GROUPS / STANDINGS
   ========================================================= */
.fwc-groups__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.fwc-group-card {
    background: #fff; border: 1px solid var(--fwc-gray-200);
    border-radius: var(--fwc-radius); overflow: hidden;
    box-shadow: var(--fwc-shadow);
}

.fwc-group-card__header {
    background: var(--fwc-green); color: #fff;
    padding: 10px 16px; font-weight: 700; font-size: 14px;
    text-transform: uppercase; letter-spacing: 1px;
}

.fwc-group-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.fwc-group-table thead tr {
    background: var(--fwc-gray-100);
}
.fwc-group-table th {
    padding: 7px 8px; font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--fwc-gray-600); text-align: center;
}
.fwc-group-table th.fwc-col-team { text-align: left; }

.fwc-group-row td {
    padding: 8px 8px; border-top: 1px solid var(--fwc-gray-100);
    text-align: center; vertical-align: middle;
}
.fwc-col-team { text-align: left !important; display: flex; align-items: center; gap: 6px; }
.fwc-col-pos   { width: 28px; font-weight: 700; }
.fwc-col-pts   { font-weight: 700; color: var(--fwc-green); }
.fwc-col-stat  { width: 32px; color: var(--fwc-gray-600); }

.fwc-gd--pos { color: var(--fwc-green); }
.fwc-gd--neg { color: var(--fwc-red); }

.fwc-row--first  td:first-child { border-left: 3px solid var(--fwc-green); }
.fwc-row--second td:first-child { border-left: 3px solid #60a5fa; }
.fwc-row--third  td:first-child { border-left: 3px solid var(--fwc-gold); }

.fwc-team-name--short { display: none; }
@media (max-width: 400px) {
    .fwc-team-name--full  { display: none; }
    .fwc-team-name--short { display: inline; }
}

.fwc-group-card__legend {
    padding: 8px 12px; font-size: 11px; color: var(--fwc-gray-400);
    border-top: 1px solid var(--fwc-gray-100);
}
.fwc-legend {
    display: inline-block; width: 12px; height: 12px;
    border-radius: 2px; vertical-align: middle;
}
.fwc-legend--q1 { background: var(--fwc-green); }
.fwc-legend--q3 { background: var(--fwc-gold); }

/* =========================================================
   TEAMS GRID
   ========================================================= */
.fwc-teams__count {
    font-size: 13px; color: var(--fwc-gray-400);
    margin-bottom: 16px;
}

.fwc-teams__grid {
    display: grid;
    grid-template-columns: repeat(var(--fwc-cols, 4), 1fr);
    gap: 16px;
}

@media (max-width: 900px) { .fwc-teams__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .fwc-teams__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .fwc-teams__grid { grid-template-columns: 1fr; } }

.fwc-team-card {
    background: #fff; border: 1px solid var(--fwc-gray-200);
    border-radius: var(--fwc-radius); padding: 16px 14px;
    display: flex; flex-direction: column; align-items: center;
    text-align: center; gap: 10px;
    box-shadow: var(--fwc-shadow); transition: box-shadow .15s, transform .15s;
}
.fwc-team-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }

.fwc-team-card__crest img {
    width: 64px; height: 64px; object-fit: contain;
}
.fwc-team-card__no-crest {
    width: 64px; height: 64px; background: var(--fwc-green-lt);
    color: var(--fwc-green); font-weight: 800; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

.fwc-team-card__name {
    font-weight: 700; font-size: 14px; line-height: 1.3;
}
.fwc-team-card__area {
    font-size: 12px; color: var(--fwc-gray-600);
}
.fwc-team-card__venue, .fwc-team-card__founded {
    font-size: 11px; color: var(--fwc-gray-400);
}
.fwc-team-card__link {
    font-size: 11px; color: var(--fwc-green);
    text-decoration: none; margin-top: 4px;
}
.fwc-team-card__link:hover { text-decoration: underline; }

/* =========================================================
   SCORERS TABLE
   ========================================================= */
.fwc-scorers-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
    background: #fff; border-radius: var(--fwc-radius);
    overflow: hidden; box-shadow: var(--fwc-shadow);
}
.fwc-scorers-table thead tr {
    background: var(--fwc-green); color: #fff;
}
.fwc-scorers-table th {
    padding: 10px 12px; font-weight: 600; font-size: 12px;
    text-align: left;
}
.fwc-scorers-table td {
    padding: 10px 12px; border-top: 1px solid var(--fwc-gray-100);
    vertical-align: middle;
}
.fwc-scorers-table tr:hover td { background: var(--fwc-gray-50); }

.fwc-scorer__name { font-weight: 600; display: block; }
.fwc-scorer__nat  { font-size: 11px; color: var(--fwc-gray-400); }
.fwc-scorer__team { display: flex; align-items: center; gap: 6px; }

.fwc-row--gold   td:first-child { border-left: 4px solid #d97706; font-weight: 800; }
.fwc-row--silver td:first-child { border-left: 4px solid #9ca3af; }
.fwc-row--bronze td:first-child { border-left: 4px solid #92400e; }
