/* ============================================
   Football Liv Scores - Frontend Styles v3.0.0
   ============================================ */

/* CSS Variables - Controlled from Admin Panel */
:root {
    --fls-primary: #38bdf8;
    --fls-secondary: #3b82f6;
    --fls-bg: rgba(18, 25, 41, 0.85);
    --fls-card-bg: rgba(255, 255, 255, 0.03);
    --fls-card-border: rgba(255, 255, 255, 0.07);
    --fls-text: #f3f4f6;
    --fls-text-muted: #9ca3af;
    --fls-blur: 14px;
    --fls-radius: 20px;
    --fls-radius-card: 16px;
    --fls-live-color: #ef4444;
}

/* ====== CONTAINER ====== */
.fls-scores-container {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1000px;
    margin: 20px auto;
    padding: 18px;
    background: var(--fls-bg);
    backdrop-filter: blur(var(--fls-blur));
    -webkit-backdrop-filter: blur(var(--fls-blur));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--fls-radius);
    color: var(--fls-text);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* ====== HEADER ====== */
.fls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.fls-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--fls-primary) 0%, var(--fls-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fls-title-icon {
    -webkit-text-fill-color: initial;
    font-size: 1.3rem;
}

.fls-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ====== FILTER BUTTONS ====== */
.fls-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fls-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fls-text-muted);
    padding: 5px 12px;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.fls-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fls-text);
}

.fls-filter-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--fls-primary);
    color: var(--fls-primary);
}

.fls-filter-btn.active-live {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--fls-live-color);
    color: var(--fls-live-color);
}

/* ====== REFRESH BUTTON ====== */
.fls-refresh-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fls-text-muted);
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fls-refresh-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--fls-primary);
}

.fls-refresh-btn.loading svg {
    animation: spin 0.8s linear infinite;
}

/* ====== MATCHES GRID ====== */
.fls-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
}

/* ====== MATCH CARD ====== */
.fls-match-card {
    background: var(--fls-card-bg);
    border: 1px solid var(--fls-card-border);
    border-radius: var(--fls-radius-card);
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.fls-match-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fls-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fls-match-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.08);
}

.fls-match-card:hover::before {
    opacity: 1;
}

.fls-match-card.live {
    border-color: rgba(239, 68, 68, 0.25);
    animation: liveGlow 3s ease-in-out infinite;
}

@keyframes liveGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 18px rgba(239, 68, 68, 0.12); }
}

/* ====== MATCH META ====== */
.fls-match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 0.73rem;
    color: var(--fls-text-muted);
}

.fls-league-tag {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====== BADGES ====== */
.fls-badge {
    padding: 3px 9px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fls-badge-live {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.fls-badge-live::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    background-color: var(--fls-live-color);
    border-radius: 50%;
    animation: pulse 1.4s infinite;
}

.fls-badge-upcoming {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.fls-badge-finished {
    background: rgba(107, 114, 128, 0.12);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ====== TEAMS & SCORES ====== */
.fls-match-teams { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.fls-team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fls-team-info { display: flex; align-items: center; gap: 9px; }

.fls-team-flag {
    width: 26px; height: 26px;
    border-radius: 6px;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
}

.fls-team-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: #e5e7eb;
}

.fls-team-score {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--fls-text);
    min-width: 28px;
    text-align: right;
    transition: color 0.3s ease;
}

.fls-match-card.live .fls-team-score {
    color: var(--fls-primary);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* ====== MATCH FOOTER ====== */
.fls-match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    font-size: 0.73rem;
    color: var(--fls-text-muted);
}

.fls-match-time { display: flex; align-items: center; gap: 4px; }
.fls-match-clock { font-weight: 700; color: var(--fls-primary); }

.fls-venue {
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.fls-details-hint {
    color: rgba(56, 189, 248, 0.5);
    font-size: 0.7rem;
    transition: color 0.2s;
}
.fls-match-card:hover .fls-details-hint {
    color: var(--fls-primary);
}

/* ====== EMPTY STATE ====== */
.fls-no-matches {
    text-align: center;
    padding: 40px 20px;
    color: var(--fls-text-muted);
    grid-column: 1 / -1;
}

.fls-no-matches-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* ====== MATCH DETAILS MODAL ====== */
.fls-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fls-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.fls-modal {
    background: rgba(18, 25, 41, 0.97);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    padding: 28px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(56, 189, 248, 0.07);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--fls-text);
    font-family: 'Outfit', 'Inter', sans-serif;
}

.fls-modal-overlay.active .fls-modal {
    transform: scale(1) translateY(0);
}

.fls-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    gap: 12px;
}

.fls-modal-league {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--fls-text-muted);
    margin-bottom: 4px;
}

.fls-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fls-text-muted);
    width: 32px; height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.fls-modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Modal Scoreboard */
.fls-modal-scoreboard {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.fls-modal-team { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fls-modal-team-flag { font-size: 2rem; }
.fls-modal-team-name { font-weight: 700; font-size: 1rem; }
.fls-modal-score-block { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fls-modal-score {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--fls-primary), var(--fls-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

/* Stats Bars */
.fls-modal-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--fls-text-muted);
    margin-bottom: 12px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fls-stat-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.fls-stat-bar-wrap {
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 9999px;
    overflow: hidden;
}

.fls-stat-bar-home { display: flex; justify-content: flex-end; }
.fls-stat-bar-away { display: flex; justify-content: flex-start; }

.fls-stat-bar {
    height: 5px;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--fls-secondary), var(--fls-primary));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fls-stat-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; color: var(--fls-text-muted); }
.fls-stat-val-home { text-align: right; font-weight: 700; color: var(--fls-text); }
.fls-stat-val-away { text-align: left; font-weight: 700; color: var(--fls-text); }

/* Match Events */
.fls-events-list { display: flex; flex-direction: column; gap: 8px; }

.fls-event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 0.83rem;
}

.fls-event-icon { font-size: 1rem; width: 22px; text-align: center; }
.fls-event-minute {
    font-size: 0.75rem; font-weight: 700;
    color: var(--fls-primary);
    min-width: 30px;
}
.fls-event-player { font-weight: 500; flex: 1; }
.fls-event-team { font-size: 0.72rem; color: var(--fls-text-muted); }

/* ====== ANIMATIONS ====== */
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 640px) {
    .fls-matches-grid { grid-template-columns: 1fr; }
    .fls-scores-container { border-radius: 14px; margin: 10px; padding: 12px; }
    .fls-modal { padding: 18px; border-radius: 16px; }
    .fls-modal-scoreboard { padding: 14px; }
    .fls-modal-score { font-size: 2rem; }
}
