/* ================================================================
   STYLES POUR LA SAISIE DES MANCHES EN FORMAT BRACKET
   Thème harmonisé avec le design JCUP
   ================================================================ */

/* --- Variables de couleur --- */
:root {
    --primary: #0066ff;
    --primary-dark: #0052cc;
    --accent-gold: #d4af37;
    --accent-blue: #0066ff;
    --success: #4CAF50;
    --danger: #f44336;
    --dark-bg: #1a1f3a;
    --light-text: #e6e6e6;
    --border-light: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.2);
}

/* ================================================================
   SECTION PRINCIPALE
   ================================================================ */

.bracket-match-section {
    padding: 30px;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.5), rgba(26, 31, 58, 0.5));
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.bracket-match-section h2 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 26px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    background: var(--accent-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================================================
   COLONNES FLEX LAYOUT
   ================================================================ */

.bracket-match-section > div {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* ================================================================
   COLONNE SCORES (GAUCHE)
   ================================================================ */

.classement-column.classement-slots {
    background: rgba(26, 31, 58, 0.8);
    border: 2px solid var(--border-light);
    border-left: 4px solid var(--accent-gold);
    border-radius: 12px;
    padding: 25px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    max-height: 70vh;
    overflow-x: auto;
}

.classement-slots h3 {
    color: var(--accent-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 16px;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ================================================================
   SLOTS VIDES (DRAG ZONES)
   ================================================================ */

#bracket-teams-slots {
    background: rgba(10, 14, 39, 0.6);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}

#bracket-teams-slots:hover {
    background: rgba(0, 102, 255, 0.08);
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.15);
}

/* ================================================================
   MANCHES (ROWS)
   ================================================================ */

.bracket-manche-row {
    background: rgba(255, 255, 255, 0.06);
    border-left: 4px solid var(--accent-blue);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bracket-manche-row:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.2);
    transform: translateX(4px);
}

.bracket-manche-row > div:first-child {
    font-size: 14px;
    color: var(--accent-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ================================================================
   ÉQUIPES/JOUEURS DANS LES MANCHES
   ================================================================ */

.bracket-manche-team {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    height: 37px;
}

.bracket-manche-team:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(255, 221, 0, 0.621);
    transform: translateX(2px);
}

.bracket-manche-team img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    transition: border-color 0.2s;
}

.bracket-manche-team:hover img {
    border-color: var(--accent-gold);
}

/* ================================================================
   CASES BO (SCORE BOXES)
   ================================================================ */

.bo-case {
    width: 40px;
    height: 40px;
    border: 2px solid #ccc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f0f0f0;
    font-weight: 700;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bo-case:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.bo-case[data-color="white"] {
    background: #f0f0f0;
    border-color: #d0d0d0;
    color: #333;
}

.bo-case[data-color="green"] {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    border-color: #2E7D32;
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.bo-case[data-color="green"]:hover {
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.6);
}

.bo-case[data-color="red"] {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border-color: #c62828;
    color: white;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
}

.bo-case[data-color="red"]:hover {
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.6);
}

.bo-case[data-color="gray"] {
    background: #9E9E9E;
    border-color: #757575;
    color: white;
    box-shadow: 0 2px 8px rgba(158, 158, 158, 0.3);
}

/* ================================================================
   DURÉE (DROPDOWNS)
   ================================================================ */

.manche-duration-minutes,
.manche-duration-seconds {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--accent-blue);
    color: #1a1f3a;
    
    padding: 8px 12px;
    border-radius: 6px;
    
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 102, 255, 0.2);
}

.manche-duration-minutes:hover,
.manche-duration-seconds:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.manche-duration-minutes:focus,
.manche-duration-seconds:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
    background: white;
}

/* Flèche personnalisée */
.manche-duration-minutes,
.manche-duration-seconds {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='16' height='16' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%230066ff' d='M5 7l5 5 5-5H5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 50%;
    background-size: 12px;
    padding-right: 30px;
}

/* ================================================================
   COLONNE ÉQUIPES/JOUEURS (DROITE)
   ================================================================ */

.classement-column.classement-joueurs {
    background: rgba(26, 31, 58, 0.8);
    border: 2px solid var(--border-light);
    border-left: 4px solid var(--accent-blue);
    border-radius: 12px;
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.classement-joueurs h3 {
    color: var(--accent-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 16px;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Scrollbar personnalisée */
.classement-joueurs::-webkit-scrollbar {
    width: 6px;
}

.classement-joueurs::-webkit-scrollbar-track {
    background: transparent;
}

.classement-joueurs::-webkit-scrollbar-thumb {
    background: rgba(0, 102, 255, 0.4);
    border-radius: 3px;
}

.classement-joueurs::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 102, 255, 0.6);
}

/* ================================================================
   SLOT JOUEUR DISPONIBLE (DRAGGABLE)
   ================================================================ */

.slot-joueur-dispo {
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.slot-joueur-dispo .joueur {
    cursor: move;
    transition: all 0.2s ease;
}

.slot-joueur-dispo .joueur:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.3);
}

/* ================================================================
   JOUEUR (STYLE UNIVERSEL)
   ================================================================ */

.joueur {
    background: color-mix(in srgb, var(--team-color) 25%, transparent);
    border: 1px solid color-mix(in srgb, var(--team-color) 40%, transparent);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.joueur:hover {
    border-color: color-mix(in srgb, var(--team-color) 70%, transparent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.joueur-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: border-color 0.2s;
}

.joueur:hover .joueur-avatar {
    border-color: rgba(255, 255, 255, 0.8);
}

.joueur-text {
    display: flex;
    flex-direction: column;
}

.joueur-pseudo {
    font-weight: 700;
    color: #fff;
    font-size: 14px;
}

.joueur-team {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* ================================================================
   BOUTONS D'ACTION
   ================================================================ */

.classement-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.classement-actions button {
    padding: 12px 24px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #0066ff, #0052cc);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0052cc, #003d99);
    box-shadow: 0 6px 25px rgba(0, 102, 255, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f, #c62828);
    box-shadow: 0 6px 25px rgba(244, 67, 54, 0.5);
    transform: translateY(-2px);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #388E3C, #2E7D32);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
    transform: translateY(-2px);
}

.btn-success:active {
    transform: translateY(0);
}

/* ================================================================
   STATUT DE SAUVEGARDE
   ================================================================ */

#bracket-save-status {
    background: rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--success);
    border-radius: 8px;
    padding: 14px;
    color: #fff;
    font-weight: 600;
    text-align: center;
    display: none;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================================
   DRAG & DROP STATES
   ================================================================ */

.joueur.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

#bracket-teams-slots.drag-over {
    background: rgba(0, 102, 255, 0.15);
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(0, 102, 255, 0.3);
}

/* ================================================================
   RESPONSIVE DESIGN
   ================================================================ */

@media (max-width: 1024px) {
    .bracket-match-section > div {
        flex-direction: column;
    }
    
    .classement-column {
        max-width: 100%;
    }
    
    .bo-case {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .bracket-match-section {
        padding: 15px;
    }
    
    .bracket-match-section h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .classement-joueurs {
        max-height: 400px;
    }
    
    .bo-case {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    
    .joueur {
        padding: 10px;
        gap: 10px;
    }
    
    .joueur-pseudo {
        font-size: 13px;
    }
    
    .joueur-team {
        font-size: 11px;
    }
}
