/* ─────────────────────────────────────
   NFL Scores Plugin — Scoreboard Styles
   Version: 1.2.0
   ───────────────────────────────────── */

/* Reset box model for plugin */
.nflscores-wrap,
.nflscores-wrap * {
    box-sizing: border-box;
}

/* ── Wrapper ── */
.nflscores-wrap {
    max-width: 1100px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a2e;
    line-height: 1.4;
}

/* ── Header ── */
.nflscores-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.nflscores-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
}

.nflscores-icon {
    width: 28px;
    height: 28px;
    color: #013369; /* NFL blue */
    flex-shrink: 0;
}

/* ── Navigation ── */
.nflscores-nav {
    display: flex;
    align-items: center;
}

.nflscores-week-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nflscores-nav-btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #013369;
    background: #f0f4f8;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.nflscores-nav-btn:hover {
    background: #013369;
    color: #fff;
    border-color: #013369;
    text-decoration: none;
}

.nflscores-seasontype-nav {
    display: flex;
    gap: 0;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    overflow: hidden;
}

.nflscores-type-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: #555;
    background: #f8f9fb;
    border-right: 1px solid #d1d9e6;
    transition: all 0.15s ease;
}
.nflscores-type-btn:last-child {
    border-right: none;
}
.nflscores-type-btn:hover {
    background: #e8edf3;
    color: #013369;
    text-decoration: none;
}
.nflscores-type-btn.nflscores-active {
    background: #013369;
    color: #fff;
}

/* ── Date Group ── */
.nflscores-date-group {
    margin-bottom: 1.75rem;
}

.nflscores-date-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* ── Card Grid ── */
.nflscores-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ── Game Card ── */
.nflscores-card {
    background: #fff;
    border: 1px solid #e2e6ec;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    position: relative;
    overflow: hidden;
}
.nflscores-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Highlighted team card */
.nflscores-card.nflscores-highlighted {
    border-left: 4px solid #d50a0a;
    box-shadow: 0 2px 12px rgba(213, 10, 10, 0.12);
}

/* Live game pulse */
.nflscores-card.nflscores-state-in {
    border-left: 4px solid #16a34a;
}
.nflscores-card.nflscores-state-in::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #16a34a;
    animation: nflscores-pulse 2s ease-in-out infinite;
}
@keyframes nflscores-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Card Status Bar ── */
.nflscores-card-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.nflscores-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

.nflscores-live {
    background: #dcfce7;
    color: #15803d;
}
.nflscores-final {
    background: #f1f5f9;
    color: #475569;
}
.nflscores-pregame {
    background: #eff6ff;
    color: #1d4ed8;
}

.nflscores-broadcast {
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 500;
}

/* ── Team Row ── */
.nflscores-team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.nflscores-team-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.nflscores-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.nflscores-team-name {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 0;
}

.nflscores-abbr {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a1a2e;
}

.nflscores-fullname {
    font-size: 0.82rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nflscores-record {
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 500;
}

.nflscores-home-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Score ── */
.nflscores-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1a2e;
    min-width: 45px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Winner / Loser styling */
.nflscores-winner .nflscores-score {
    color: #1a1a2e;
}
.nflscores-winner .nflscores-abbr {
    color: #1a1a2e;
}

.nflscores-loser .nflscores-score {
    color: #b0b8c4;
}
.nflscores-loser .nflscores-abbr {
    color: #8b95a5;
}
.nflscores-loser .nflscores-logo {
    opacity: 0.55;
}

/* ── Divider ── */
.nflscores-divider {
    height: 1px;
    background: #eef0f4;
    margin: 0;
}

/* ── Venue ── */
.nflscores-venue {
    margin-top: 0.6rem;
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: center;
}

/* ── Footer ── */
.nflscores-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ── Error ── */
.nflscores-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    color: #991b1b;
    font-weight: 500;
}

/* ── Empty ── */
.nflscores-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    font-size: 1rem;
}

/* ─────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────── */
@media (max-width: 768px) {
    .nflscores-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nflscores-cards {
        grid-template-columns: 1fr;
    }

    .nflscores-week-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nflscores-fullname {
        display: none;
    }

    .nflscores-logo {
        width: 30px;
        height: 30px;
    }

    .nflscores-score {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .nflscores-wrap {
        margin: 1rem 0;
    }

    .nflscores-card {
        padding: 0.85rem;
        border-radius: 8px;
    }

    .nflscores-seasontype-nav {
        width: 100%;
    }

    .nflscores-type-btn {
        flex: 1;
        text-align: center;
        padding: 0.35rem 0.5rem;
        font-size: 0.72rem;
    }
}

/* ═══════════════════════════════════════
   CLICKABLE CARDS & DETAIL PANEL
   ═══════════════════════════════════════ */

/* ── Clickable card cursor & hover ── */
.nflscores-clickable {
    cursor: pointer;
}

.nflscores-clickable:hover {
    border-color: #013369;
}

.nflscores-clickable.nflscores-expanded {
    border-color: #013369;
    box-shadow: 0 4px 20px rgba(1, 51, 105, 0.15);
    transform: none;
}

/* ── Detail toggle bar ── */
.nflscores-detail-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0 0.15rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    border-top: 1px solid #eef0f4;
    margin-top: 0.5rem;
    transition: color 0.15s;
}

.nflscores-clickable:hover .nflscores-detail-toggle {
    color: #013369;
}

.nflscores-expand-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.nflscores-expanded .nflscores-expand-icon {
    transform: rotate(180deg);
}

/* ── Detail panel ── */
.nflscores-detail-panel {
    border-top: 2px solid #013369;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    animation: nflscores-slideDown 0.3s ease;
}

@keyframes nflscores-slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading / Error ── */
.nflscores-detail-loading {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #6b7280;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nflscores-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e6ec;
    border-top-color: #013369;
    border-radius: 50%;
    animation: nflscores-spin 0.7s linear infinite;
}

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

.nflscores-detail-error {
    text-align: center;
    padding: 1.5rem;
    color: #991b1b;
    font-size: 0.82rem;
}

.nflscores-no-data {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
    font-size: 0.82rem;
}

/* ── Game info bar ── */
.nflscores-game-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    padding-bottom: 0.65rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid #eef0f4;
    font-size: 0.72rem;
    color: #6b7280;
}

.nflscores-gi-item {
    display: inline-flex;
    align-items: center;
}

/* ── Tabs ── */
.nflscores-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #e2e6ec;
}

.nflscores-tab {
    background: none;
    border: none;
    padding: 0.45rem 0.9rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.nflscores-tab:hover {
    color: #013369;
}

.nflscores-tab.nflscores-tab-active {
    color: #013369;
    border-bottom-color: #013369;
}

/* ═══════════════════════════════════════
   BOX SCORE TAB
   ═══════════════════════════════════════ */
.nflscores-bs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.nflscores-bs-table thead {
    background: #1a1a2e;
}

.nflscores-bs-table thead th {
    padding: 0.45rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffd54f;
    text-align: center;
    border-bottom: none;
}

.nflscores-bs-table thead .nflscores-bs-stat {
    text-align: left;
    color: #aaa;
    width: 40%;
}

.nflscores-bs-table thead .nflscores-bs-team {
    width: 30%;
}

.nflscores-bs-table thead .nflscores-bs-team span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.nflscores-bs-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}

.nflscores-bs-table tbody tr {
    border-bottom: 1px solid #eef0f4;
}

.nflscores-bs-table tbody tr:last-child {
    border-bottom: none;
}

.nflscores-bs-table tbody tr:hover {
    background: #f0f4ff;
}

.nflscores-bs-label {
    padding: 0.35rem 0.6rem;
    color: #555;
    font-weight: 600;
}

.nflscores-bs-val {
    padding: 0.35rem 0.6rem;
    text-align: center;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.nflscores-bs-val.nflscores-bs-better {
    color: #1a1a2e;
    font-weight: 700;
}

/* ═══════════════════════════════════════
   SCORING PLAYS TAB
   ═══════════════════════════════════════ */
.nflscores-scoring-qtr {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #013369;
    padding: 0.5rem 0 0.25rem;
    border-bottom: 1px solid #eef0f4;
    margin-bottom: 0.4rem;
}

.nflscores-scoring-qtr:first-child {
    padding-top: 0;
}

.nflscores-scoring-play {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f5f6f8;
}

.nflscores-scoring-play:last-child {
    border-bottom: none;
}

.nflscores-sp-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.15rem;
}

.nflscores-sp-team {
    font-weight: 800;
    font-size: 0.75rem;
    color: #1a1a2e;
    min-width: 30px;
}

.nflscores-sp-clock {
    font-size: 0.68rem;
    color: #9ca3af;
    font-weight: 500;
}

.nflscores-sp-score {
    font-size: 0.68rem;
    font-weight: 700;
    color: #555;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    background: #f0f1f4;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
}

.nflscores-sp-text {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ═══════════════════════════════════════
   LEADERS TAB
   ═══════════════════════════════════════ */
.nflscores-leaders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.nflscores-leaders-team-name {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a1a2e;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #013369;
    margin-bottom: 0.4rem;
}

.nflscores-leader-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f5f6f8;
}

.nflscores-leader-card:last-child {
    border-bottom: none;
}

.nflscores-leader-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef0f4;
    flex-shrink: 0;
}

.nflscores-leader-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nflscores-leader-cat {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.nflscores-leader-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

/* Player name links */
a.nflscores-player-link {
    color: #013369;
    text-decoration: none;
    transition: color 0.15s;
}

a.nflscores-player-link:hover {
    color: #d50a0a;
    text-decoration: underline;
}

/* Photo link wrapper */
a.nflscores-leader-photo-link {
    flex-shrink: 0;
    display: inline-flex;
    transition: transform 0.15s;
}

a.nflscores-leader-photo-link:hover {
    transform: scale(1.1);
}

a.nflscores-leader-photo-link:hover .nflscores-leader-photo {
    box-shadow: 0 0 0 2px #013369;
}

.nflscores-leader-stat {
    font-size: 0.68rem;
    color: #6b7280;
}

/* ═══════════════════════════════════════
   DETAIL PANEL RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .nflscores-leaders-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .nflscores-tab {
        padding: 0.35rem 0.6rem;
        font-size: 0.65rem;
    }

    .nflscores-bs-table {
        font-size: 0.74rem;
    }

    .nflscores-game-info {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .nflscores-tab {
        padding: 0.3rem 0.45rem;
        font-size: 0.6rem;
    }

    .nflscores-leader-photo {
        width: 26px;
        height: 26px;
    }

    .nflscores-detail-toggle {
        font-size: 0.62rem;
    }
}
