/**
 * Estilos para visualización de cuadros/brackets
 * Versión: 1.8.1
 * Fecha: 2025-11-28
 */

/* Contenedor principal */
.padel-bracket-display {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Encabezado del bracket */
.bracket-header {
    text-align: center;
    margin-bottom: 30px;
}

.bracket-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.bracket-format {
    background: #4CAF50;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    font-size: 14px;
}

/* Formato Knockout */
.bracket-format.knockout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Rondas */
.bracket-round {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.round-title {
    background: #2196F3;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

/* Partidos */
.round-matches {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.match-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    min-width: 300px;
    flex: 1;
    transition: all 0.3s ease;
}

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

/* Estados del partido */
.match-card.completed {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.match-card.bye {
    border-color: #FF9800;
    background: #fff3e0;
}

.match-card.pending {
    border-color: #9E9E9E;
    background: #fafafa;
}

/* Equipos */
.match-teams {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team {
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

/* ===== GANADOR CON FONDO VERDE ===== */
.team.winner {
    background: #4CAF50 !important;
    color: white !important;
    font-weight: bold !important;
    border: 2px solid #2E7D32 !important;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4) !important;
}

.team.winner .team-name {
    color: white !important;
    font-weight: bold !important;
}

.team.winner .match-score-display {
    color: white !important;
    font-weight: bold !important;
}

/* Nombre del equipo */
.team-name {
    font-weight: 500;
    font-size: 16px;
    color: #333;
    flex: 1;
}

/* Scores visuales */
.match-score-display {
    display: flex;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #666;
    margin-left: 10px;
}

.set-score {
    background: #e0e0e0;
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 35px;
    text-align: center;
}

.team.winner .set-score {
    background: #2E7D32;
    color: white;
}

/* Divisor VS */
.match-vs {
    text-align: center;
    color: #999;
    font-weight: bold;
    font-size: 14px;
    margin: 5px 0;
}

/* Info adicional del partido */
.match-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.match-court {
    color: #2196F3;
    font-weight: 500;
}

.match-date {
    color: #666;
}

/* Mensaje de BYE */
.bye-notice {
    background: #fff3e0;
    color: #f57c00;
    padding: 8px 12px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

/* Timestamp de finalización */
.match-completed-time {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    margin-top: 5px;
}

/* Botón exportar PDF */
.export-pdf-btn {
    background: #9C27B0;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 20px auto;
    transition: all 0.3s ease;
}

.export-pdf-btn:hover {
    background: #7B1FA2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .round-matches {
        flex-direction: column;
    }
    
    .match-card {
        min-width: 100%;
    }
    
    .bracket-title {
        font-size: 22px;
    }
    
    .round-title {
        font-size: 16px;
    }
}
