/* ============================================================
   GHSA Basketball Scores Widget — Stylesheet
   Design: Sports-editorial, bold team-card layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
.ghsa-scores-wrap {
    --ghsa-bg:          #0d1117;
    --ghsa-surface:     #161b22;
    --ghsa-border:      #30363d;
    --ghsa-accent:      #e85d04;
    --ghsa-accent-2:    #f48c06;
    --ghsa-text:        #e6edf3;
    --ghsa-muted:       #7d8590;
    --ghsa-winner:      #ffd60a;
    --ghsa-final-bg:    #1a2332;
    --ghsa-radius:      10px;
    --ghsa-gap:         10px;

    font-family: 'Inter', sans-serif;
    background: var(--ghsa-bg);
    color: var(--ghsa-text);
    border-radius: var(--ghsa-radius);
    overflow: hidden;
    max-width: 480px;
    border: 1px solid var(--ghsa-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* ── Header ───────────────────────────────────────────────── */
.ghsa-scores-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    background: linear-gradient(135deg, #1a0a00 0%, #2d1200 50%, #1a0a00 100%);
    border-bottom: 2px solid var(--ghsa-accent);
    gap: 10px;
}

.ghsa-scores-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ghsa-icon {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(232,93,4,0.6));
    animation: ghsa-pulse 3s ease-in-out infinite;
}

@keyframes ghsa-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.07); }
}

.ghsa-scores-logo > div {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.ghsa-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.5px;
    color: #fff;
    text-transform: uppercase;
}

.ghsa-subtitle {
    font-size: 10px;
    font-weight: 500;
    color: var(--ghsa-accent-2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.ghsa-scores-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.ghsa-date-label {
    font-size: 9px;
    color: var(--ghsa-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ghsa-date-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--ghsa-accent-2);
}

/* ── Games list ───────────────────────────────────────────── */
.ghsa-games-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--ghsa-border);
}

/* ── Game Card ────────────────────────────────────────────── */
.ghsa-game-card {
    background: var(--ghsa-surface);
    padding: 12px 16px;
    transition: background 0.15s ease;
    position: relative;
}

.ghsa-game-card:hover {
    background: #1f2937;
}

.ghsa-game-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--ghsa-border);
}

.ghsa-status-final::before,
.ghsa-status-final-(ot)::before {
    background: var(--ghsa-accent);
}

.ghsa-status-in-progress::before {
    background: #22c55e;
    animation: ghsa-blink 1.2s step-end infinite;
}

@keyframes ghsa-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

.ghsa-status-postponed::before { background: #f59e0b; }
.ghsa-status-cancelled::before  { background: #ef4444; }

/* ── Game Meta Row ────────────────────────────────────────── */
.ghsa-game-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.ghsa-classification,
.ghsa-gender {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255,255,255,0.07);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--ghsa-muted);
}

.ghsa-game-time {
    font-size: 10px;
    color: var(--ghsa-muted);
    margin-left: auto;
}

.ghsa-status-badge {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(232,93,4,0.15);
    color: var(--ghsa-accent-2);
}

.ghsa-status-final    .ghsa-status-badge,
.ghsa-status-final-\(ot\) .ghsa-status-badge {
    background: rgba(232,93,4,0.2);
    color: var(--ghsa-accent);
}

.ghsa-status-in-progress .ghsa-status-badge {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.ghsa-status-postponed .ghsa-status-badge { background: rgba(245,158,11,0.15); color: #f59e0b; }
.ghsa-status-cancelled  .ghsa-status-badge { background: rgba(239,68,68,0.15);  color: #ef4444; }

/* ── Teams ────────────────────────────────────────────────── */
.ghsa-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

.ghsa-team {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ghsa-teams .ghsa-team:last-child {
    flex-direction: row-reverse;
    text-align: right;
}

.ghsa-team-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--ghsa-text);
    line-height: 1.2;
}

.ghsa-team-score {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 26px;
    line-height: 1;
    color: var(--ghsa-muted);
    min-width: 34px;
    text-align: center;
}

.ghsa-team-winner .ghsa-team-score {
    color: var(--ghsa-winner);
    text-shadow: 0 0 10px rgba(255,214,10,0.4);
}

.ghsa-team-winner .ghsa-team-name {
    color: #fff;
}

.ghsa-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ghsa-vs-label,
.ghsa-final-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--ghsa-muted);
    text-transform: uppercase;
}

.ghsa-final-label {
    color: var(--ghsa-accent);
}

/* ── Game Link ────────────────────────────────────────────── */
.ghsa-game-link {
    display: block;
    margin-top: 8px;
    text-align: right;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ghsa-accent-2);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.ghsa-game-link:hover {
    opacity: 1;
    color: var(--ghsa-accent-2);
    text-decoration: none;
}

/* ── States ───────────────────────────────────────────────── */
.ghsa-scores-error,
.ghsa-scores-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--ghsa-muted);
    font-size: 13px;
}

.ghsa-scores-error {
    color: #ef4444;
}

/* ── Footer ───────────────────────────────────────────────── */
.ghsa-scores-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 16px;
    font-size: 10px;
    color: var(--ghsa-muted);
    background: rgba(0,0,0,0.25);
    border-top: 1px solid var(--ghsa-border);
    flex-wrap: wrap;
}

.ghsa-scores-footer a {
    color: var(--ghsa-accent-2);
    text-decoration: none;
    font-weight: 600;
}

.ghsa-scores-footer a:hover {
    text-decoration: underline;
}

.ghsa-refresh-note {
    opacity: 0.6;
}

/* ── Light-mode override (if WordPress theme is light) ─────── */
@media (prefers-color-scheme: light) {
    .ghsa-scores-wrap.ghsa-light {
        --ghsa-bg:       #f5f5f5;
        --ghsa-surface:  #ffffff;
        --ghsa-border:   #e0e0e0;
        --ghsa-text:     #111;
        --ghsa-muted:    #666;
        --ghsa-final-bg: #fff8f0;
    }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 400px) {
    .ghsa-team-name  { font-size: 13px; }
    .ghsa-team-score { font-size: 22px; }
    .ghsa-scores-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .ghsa-scores-date { align-items: flex-start; }
}
