/**
 * CSS para o plugin Placar Final API
 */

/* Containers principais */
.placar-final-live-matches,
.placar-final-upcoming-matches,
.placar-final-championship-table {
    margin: 20px 0;
}

/* Cards de partida */
.match-card {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
    color: #fff;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.match-time {
    color: #ccc;
}

.match-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.match-status.live {
    background-color: #f44336;
    color: #fff;
    animation: pulse 2s infinite;
}

.match-status.finished {
    background-color: #666;
    color: #fff;
}

.match-status.upcoming {
    background-color: #2196F3;
    color: #fff;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Times e placar */
.match-card-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

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

.team.team-away {
    flex-direction: row-reverse;
    text-align: right;
}

.team img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.team-name {
    font-weight: bold;
    font-size: 1rem;
}

.match-score {
    text-align: center;
    margin: 0 20px;
}

.score {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4CAF50;
}

/* Ações do card */
.match-card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    border-top: 1px solid #444;
    padding-top: 10px;
}

.match-details-btn,
.favorite-team-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.match-details-btn:hover {
    background: #66BB6A;
}

.favorite-team-btn {
    background: transparent;
    border: 1px solid #666;
    padding: 6px 10px;
    font-size: 1rem;
}

.favorite-team-btn.favorited {
    background: #FFD700;
    border-color: #FFD700;
    color: #000;
}

.favorite-team-btn:hover {
    background: #666;
}

/* Modal de detalhes */
#match-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
}

.modal-content {
    background: #2d2d2d;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    color: #fff;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.modal-close:hover {
    color: #4CAF50;
}

/* Detalhes da partida */
.match-details-full {
    padding: 20px 0;
}

.match-header h3 {
    color: #4CAF50;
    margin-bottom: 10px;
}

.match-date {
    color: #ccc;
    font-size: 0.9rem;
}

.match-teams-detailed {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    text-align: center;
}

.team-home,
.team-away {
    flex: 1;
}

.team-home img,
.team-away img {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.team-home h4,
.team-away h4 {
    margin: 0;
    font-size: 1.2rem;
}

.match-score-detailed {
    flex: 1;
    text-align: center;
}

.score-main {
    font-size: 3rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 10px;
}

.match-status {
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

/* Gols e cartões */
.match-goals,
.match-cards {
    margin: 30px 0;
}

.match-goals h4,
.match-cards h4 {
    color: #4CAF50;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.match-goals ul,
.match-cards ul {
    list-style: none;
    padding: 0;
}

.match-goals li,
.match-cards li {
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.goal-time,
.card-time {
    color: #4CAF50;
    font-weight: bold;
    margin-right: 10px;
}

.goal-player,
.card-player {
    font-weight: bold;
}

.goal-team {
    color: #ccc;
}

.card-type {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-right: 10px;
}

.card-yellow {
    background: #FFD700;
    color: #000;
}

.card-red {
    background: #f44336;
    color: #fff;
}

/* Estádio */
.match-stadium {
    margin: 20px 0;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 6px;
}

.match-stadium h4 {
    color: #4CAF50;
    margin-bottom: 10px;
}

/* Tabela de campeonato */
.championship-table {
    overflow-x: auto;
    margin: 20px 0;
}

.championship-table table {
    width: 100%;
    border-collapse: collapse;
    background: #2d2d2d;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.championship-table th,
.championship-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #444;
}

.championship-table th {
    background: #4CAF50;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
}

.championship-table td:nth-child(2) {
    text-align: left;
}

.team-logo-small {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.championship-table tr:hover {
    background: #333;
}

/* Seções de campeonato */
.championship-section {
    margin-bottom: 30px;
}

.championship-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #333;
    border-radius: 6px;
    margin-bottom: 15px;
}

.championship-header h3 {
    color: #4CAF50;
    margin: 0;
    font-size: 1.2rem;
}

.match-count {
    background: #4CAF50;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #ccc;
    font-style: italic;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #4CAF50;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filtros e controles */
.matches-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.championship-filter,
.team-search {
    padding: 8px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #333;
    color: #fff;
    font-size: 0.9rem;
}

.championship-filter:focus,
.team-search:focus {
    outline: none;
    border-color: #4CAF50;
}

.refresh-matches-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.refresh-matches-btn:hover {
    background: #66BB6A;
}

.refresh-matches-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

.last-refresh {
    color: #ccc;
    font-size: 0.8rem;
    margin-left: auto;
}

/* Responsividade */
@media (max-width: 768px) {
    .match-card-teams {
        flex-direction: column;
        gap: 15px;
    }
    
    .team.team-away {
        flex-direction: row;
        text-align: left;
    }
    
    .match-score {
        margin: 0;
    }
    
    .match-teams-detailed {
        flex-direction: column;
        gap: 20px;
    }
    
    .score-main {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .championship-table {
        font-size: 0.8rem;
    }
    
    .championship-table th,
    .championship-table td {
        padding: 8px 4px;
    }
    
    .matches-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .last-refresh {
        margin-left: 0;
        text-align: center;
    }
}

/* Animações */
.match-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados especiais */
.match-card.highlighted {
    border-left-color: #FFD700;
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
}

.team.favorite {
    background: rgba(255, 215, 0, 0.1);
    border-radius: 4px;
    padding: 5px;
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: slideInRight 0.3s ease-out;
}

.notification.error {
    background: #f44336;
}

.notification.warning {
    background: #FF9800;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Acessibilidade */
.match-details-btn:focus,
.favorite-team-btn:focus,
.refresh-matches-btn:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

