/* ESPN Football Live - Styles */

.efl-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Header */
.efl-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.efl-header h3 { margin: 0; font-size: 17px; }
.efl-header-right { display: flex; align-items: center; gap: 8px; }
.efl-update-time { font-size: 11px; opacity: 0.7; }
.efl-live-dot {
    width: 8px; height: 8px; background: #e74c3c; border-radius: 50%;
    animation: efl-pulse 1.5s infinite;
}
@keyframes efl-pulse {
    0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.7); }
    70% { box-shadow: 0 0 0 8px rgba(231,76,60,0); }
}

/* Match Card */
.efl-match-card {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    gap: 10px;
}
.efl-match-card:hover { background: #f8f9fa; }
.efl-match-card:last-child { border-bottom: none; }

/* Teams */
.efl-team { display: flex; align-items: center; gap: 10px; }
.efl-team-home { justify-content: flex-end; text-align: right; flex-direction: row-reverse; }
.efl-team-home .efl-scorers { text-align: right; }
.efl-team-away { text-align: left; }

.efl-team-logo { width: 32px; height: 32px; object-fit: contain; }
.efl-team-logo-sm { width: 20px; height: 20px; object-fit: contain; }
.efl-team-name { font-weight: 600; font-size: 14px; color: #333; }
.efl-scorers { display: flex; flex-direction: column; gap: 2px; }
.efl-scorer { font-size: 10px; color: #27ae60; }

/* Score */
.efl-score-area { text-align: center; min-width: 80px; }
.efl-score { display: flex; align-items: center; justify-content: center; gap: 8px; }
.efl-score-num { font-size: 24px; font-weight: 800; color: #1a1a2e; }
.efl-score-x { color: #999; font-weight: 400; }

/* Status */
.efl-status {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    margin-top: 4px; padding: 2px 8px; border-radius: 10px; display: inline-block;
}
.efl-live .efl-status, .efl-status.efl-live {
    background: #e74c3c; color: #fff; animation: efl-blink 1s infinite;
}
@keyframes efl-blink { 50% { opacity: 0.7; } }
.efl-finished .efl-status, .efl-status.efl-finished { background: #eee; color: #666; }
.efl-pre .efl-status, .efl-status.efl-pre { background: #e8f5e9; color: #2e7d32; font-size: 14px; font-weight: 700; }

.efl-no-matches, .efl-no-data { padding: 40px 20px; text-align: center; color: #999; }
.efl-error { padding: 15px; background: #ffeaa7; color: #6c5200; border-radius: 8px; margin: 10px; border-left: 4px solid #fdcb6e; }

/* Detail Header */
.efl-detail-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #fff; padding: 25px 20px; text-align: center;
}
.efl-detail-league { font-size: 13px; opacity: 0.7; margin-bottom: 15px; }
.efl-detail-scoreboard { display: flex; align-items: center; justify-content: center; gap: 25px; }
.efl-detail-team { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 90px; font-weight: 600; }
.efl-detail-logo { width: 56px; height: 56px; object-fit: contain; }
.efl-detail-score { display: flex; align-items: center; gap: 10px; }
.efl-big-num { font-size: 44px; font-weight: 900; line-height: 1; }
.efl-big-x { font-size: 20px; opacity: 0.5; }
.efl-detail-status { margin-top: 12px; font-size: 14px; font-weight: 600; background: rgba(255,255,255,0.1); padding: 6px 15px; border-radius: 20px; display: inline-block; }
.efl-detail-note { font-size: 12px; opacity: 0.7; margin-top: 8px; }

/* Tabs */
.efl-tabs { display: flex; border-bottom: 2px solid #eee; background: #f8f9fa; }
.efl-tab {
    flex: 1; padding: 12px; border: none; background: none; font-size: 13px; font-weight: 600;
    cursor: pointer; color: #666; border-bottom: 3px solid transparent; transition: all 0.2s;
}
.efl-tab:hover { background: #eee; }
.efl-tab.active { color: #0f3460; border-bottom-color: #0f3460; background: #fff; }
.efl-tab-panel { display: none; padding: 20px; }
.efl-tab-panel.active { display: block; }

/* Events */
.efl-events-list { padding: 10px 0; }
.efl-event-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 15px; border-bottom: 1px solid #f5f5f5;
}
.efl-event-time { font-size: 12px; font-weight: 700; color: #0f3460; background: #e8edf5; padding: 3px 8px; border-radius: 12px; min-width: 40px; text-align: center; }
.efl-event-icon { font-size: 16px; min-width: 25px; text-align: center; }
.efl-event-info { display: flex; flex-direction: column; }
.efl-event-info strong { font-size: 13px; color: #333; }
.efl-event-info small { font-size: 11px; color: #888; }
.efl-evt-goal { background: #e8f5e9; }
.efl-evt-red { background: #ffebee; }

/* Statistics */
.efl-stats-container { padding: 15px; }
.efl-stats-header { display: flex; justify-content: space-between; font-weight: 700; padding: 10px 0; border-bottom: 2px solid #eee; margin-bottom: 15px; color: #333; }
.efl-stat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.efl-stat-val-l, .efl-stat-val-r { font-weight: 700; font-size: 14px; min-width: 40px; color: #333; }
.efl-stat-val-l { text-align: right; }
.efl-stat-mid { flex: 1; }
.efl-stat-label { text-align: center; font-size: 11px; color: #666; margin-bottom: 4px; }
.efl-stat-bar { display: flex; height: 6px; border-radius: 3px; background: #f0f0f0; }
.efl-bar-home { background: linear-gradient(90deg, #0f3460, #3a7bd5); border-radius: 3px 0 0 3px; transition: width 0.5s; }
.efl-bar-away { background: linear-gradient(90deg, #e74c3c, #c0392b); border-radius: 0 3px 3px 0; margin-left: auto; transition: width 0.5s; }

/* Standings */
.efl-table-wrapper { overflow-x: auto; }
.efl-group-name { padding: 10px 20px; margin: 0; background: #f0f0f0; font-size: 14px; }
.efl-standings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.efl-standings-table thead th { background: #f8f9fa; padding: 10px 6px; text-align: center; font-weight: 700; color: #555; border-bottom: 2px solid #ddd; font-size: 12px; }
.efl-standings-table thead th:nth-child(2) { text-align: left; }
.efl-standings-table tbody td { padding: 10px 6px; text-align: center; border-bottom: 1px solid #f0f0f0; }
.efl-standings-table tbody tr:hover { background: #f8f9fa; }
.efl-team-cell { display: flex; align-items: center; gap: 8px; text-align: left !important; white-space: nowrap; }
.efl-zone-libertadores { border-left: 3px solid #27ae60; }
.efl-zone-sula { border-left: 3px solid #3498db; }
.efl-zone-rebaixamento { border-left: 3px solid #e74c3c; }

/* Lineups */
.efl-lineups-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.efl-lineup-team { border: 1px solid #eee; border-radius: 8px; overflow: hidden; }
.efl-lineup-header { background: #f8f9fa; padding: 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #eee; }
.efl-lineup-team h5 { margin: 10px 12px 5px; font-size: 12px; color: #666; text-transform: uppercase; }
.efl-player-list { list-style: none; padding: 0; margin: 0; }
.efl-player-list li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.efl-p-number { background: #0f3460; color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.efl-p-number.sub { background: #95a5a6; }
.efl-p-pos { margin-left: auto; font-size: 10px; font-weight: 700; color: #666; }

/* Commentary */
.efl-commentary { max-height: 400px; overflow-y: auto; }
.efl-comment-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.efl-comment-time { font-weight: 700; color: #0f3460; min-width: 40px; font-size: 12px; }
.efl-comment-text { color: #555; }

/* Modal */
.efl-modal { display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.6);z-index:99999;justify-content:center;align-items:center; }
.efl-modal-content { background:#fff;border-radius:12px;max-width:700px;width:95%;max-height:85vh;overflow-y:auto;position:relative; }
.efl-modal-close { position:absolute;top:10px;right:15px;background:none;border:none;font-size:28px;cursor:pointer;color:#666;z-index:10; }

/* Responsive */
@media (max-width: 768px) {
    .efl-match-card { padding: 12px 10px; gap: 5px; }
    .efl-team-name { font-size: 12px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .efl-team-logo { width: 24px; height: 24px; }
    .efl-score-num { font-size: 18px; }
    .efl-hide-mobile { display: none !important; }
    .efl-lineups-grid { grid-template-columns: 1fr; }
    .efl-detail-scoreboard { gap: 12px; }
    .efl-big-num { font-size: 32px; }
    .efl-detail-logo { width: 40px; height: 40px; }
    .efl-detail-team { min-width: 60px; font-size: 12px; }
    .efl-standings-table { font-size: 11px; }
    .efl-standings-table thead th, .efl-standings-table tbody td { padding: 8px 3px; }
}
@media (max-width: 480px) {
    .efl-team-name { max-width: 55px; font-size: 11px; }
}

/* ===== NARRAÇÃO / COMMENTARY ===== */
.efl-commentary {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.efl-commentary::-webkit-scrollbar { width: 6px; }
.efl-commentary::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.efl-comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    line-height: 1.5;
    border-left: 4px solid transparent;
    transition: background 0.2s;
}
.efl-comment-item:hover { background: #f8f9fa; }

.efl-comment-time {
    font-weight: 700;
    color: #0f3460;
    min-width: 45px;
    font-size: 12px;
    background: #e8edf5;
    padding: 2px 6px;
    border-radius: 8px;
    text-align: center;
    height: fit-content;
    flex-shrink: 0;
}

.efl-comment-text {
    color: #444;
    flex: 1;
}

/* Tipos de evento */
.efl-comment-goal {
    background: linear-gradient(to right, #e8f5e9, #fff);
    border-left: 4px solid #27ae60;
    font-weight: 600;
    font-size: 14px;
}

.efl-comment-red {
    background: linear-gradient(to right, #ffebee, #fff);
    border-left: 4px solid #e74c3c;
    font-weight: 600;
}

.efl-comment-yellow {
    background: linear-gradient(to right, #fff8e1, #fff);
    border-left: 4px solid #f39c12;
}

.efl-comment-sub {
    background: linear-gradient(to right, #e3f2fd, #fff);
    border-left: 4px solid #2196f3;
}

.efl-comment-period {
    background: linear-gradient(to right, #f3e5f5, #fff);
    border-left: 4px solid #9c27b0;
    font-weight: 700;
    font-size: 14px;
    justify-content: center;
    text-align: center;
}

.efl-comment-var {
    background: linear-gradient(to right, #e0f7fa, #fff);
    border-left: 4px solid #00bcd4;
    font-weight: 600;
}

.efl-comment-penalty {
    background: linear-gradient(to right, #fce4ec, #fff);
    border-left: 4px solid #e91e63;
    font-weight: 600;
}

.efl-comment-save {
    background: linear-gradient(to right, #fff3e0, #fff);
    border-left: 4px solid #ff9800;
}

.efl-comment-info {
    background: linear-gradient(to right, #eceff1, #fff);
    border-left: 4px solid #607d8b;
    font-style: italic;
    color: #666;
}
/* ===== BOTÃO REFRESH ===== */
.efl-btn-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
    line-height: 1;
}

.efl-btn-refresh:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.efl-btn-refresh:active {
    transform: scale(0.95);
}

.efl-btn-refresh.efl-spinning {
    animation: efl-spin 0.8s linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes efl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal top bar */
.efl-modal-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.efl-modal-refresh {
    background: #0f3460;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.efl-modal-refresh:hover {
    background: #1a4a8a;
    transform: scale(1.1);
}

.efl-modal-refresh.efl-spinning {
    animation: efl-spin 0.8s linear infinite;
}

.efl-modal-close {
    background: #e74c3c;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.efl-modal-close:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Modal melhorado */
.efl-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.efl-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Loading */
.efl-loading {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.efl-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #eee;
    border-top-color: #0f3460;
    border-radius: 50%;
    animation: efl-spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

/* Status indicator - pisca quando tem jogo ao vivo */
.efl-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Auto-refresh indicator */
.efl-container::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, #0f3460, #3a7bd5, #0f3460);
    background-size: 200% 100%;
    animation: efl-progress 2s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.efl-container.efl-refreshing::after {
    opacity: 1;
}

@keyframes efl-progress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Intervalo */
.efl-halftime .efl-status,
.efl-status.efl-halftime {
    background: #f39c12;
    color: #fff;
    animation: none;
}

.efl-match-card.efl-halftime {
    border-left: 3px solid #f39c12;
}

/* ===== DATE GROUPS (jogos por data) ===== */
.efl-date-group {
    border-bottom: 2px solid #eee;
}

.efl-date-group:last-child {
    border-bottom: none;
}

.efl-date-header {
    background: linear-gradient(to right, #f0f4f8, #f8f9fa);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.efl-date-title {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a2e;
}

.efl-date-count {
    font-size: 12px;
    color: #666;
    background: #e8edf5;
    padding: 3px 10px;
    border-radius: 12px;
}