/**
 * jQuery Bracket CSS - Version simplifiée pour Tournoi École
 */

.jquery-bracket {
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
}

.bracket-container {
    display: flex;
    gap: 40px;
    padding: 20px;
    overflow-x: auto;
    min-height: 400px;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 200px;
}

.bracket-round-title {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 8px;
    background-color: #007cba;
    color: white;
    border-radius: 4px;
}

.bracket-match {
    display: flex;
    flex-direction: column;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.bracket-match::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 2px;
    background-color: #ddd;
}

.bracket-round:last-child .bracket-match::after {
    display: none;
}

.bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.bracket-team:last-child {
    border-bottom: none;
}

.bracket-team:hover {
    background-color: #f8f9fa;
}

.bracket-team.winner {
    background-color: #d4edda;
    font-weight: bold;
}

.team-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.team-score {
    font-weight: bold;
    font-size: 14px;
    color: #007cba;
    min-width: 30px;
    text-align: right;
}

/* États spéciaux */
.bracket-team .bye {
    color: #999;
    font-style: italic;
}

.bracket-team .tbd {
    color: #666;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .bracket-container {
        gap: 20px;
        padding: 10px;
    }
    
    .bracket-round {
        min-width: 150px;
    }
    
    .bracket-team {
        padding: 8px 10px;
    }
    
    .jquery-bracket {
        font-size: 11px;
    }
}

/* Animations */
.bracket-match {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Connexions entre les matchs */
.bracket-round:not(:last-child) .bracket-match {
    position: relative;
}

.bracket-round:not(:last-child) .bracket-match:nth-child(odd)::before {
    content: '';
    position: absolute;
    right: -40px;
    top: 50%;
    width: 20px;
    height: 2px;
    background-color: #ddd;
    z-index: 1;
}

.bracket-round:not(:last-child) .bracket-match:nth-child(even)::before {
    content: '';
    position: absolute;
    right: -40px;
    top: 50%;
    width: 20px;
    height: 2px;
    background-color: #ddd;
    z-index: 1;
}

/* Lignes verticales pour connecter les matchs */
.bracket-round:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ddd;
    z-index: 0;
}

/* Styles pour les finales */
.bracket-round:last-child {
    justify-content: center;
}

.bracket-round:last-child .bracket-round-title {
    background-color: #ffd700;
    color: #8b4513;
    font-size: 16px;
}

.bracket-round:last-child .bracket-match {
    border-color: #ffd700;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.bracket-round:last-child .bracket-team.winner {
    background-color: #fff3cd;
    color: #856404;
}