/* Styles pour l'interface utilisateur et les contrôles */

/* ===== MODE TOGGLE ===== */
.mode-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.mode-toggle-label {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #4a4a4a;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.mode-text {
    min-width: 80px;
    text-align: center;
    font-weight: 500;
    transition: color 0.3s ease;
}

.mode-text[data-mode="classic"] {
    color: #666;
}

.mode-text[data-mode="modern"] {
    color: #007bff;
}

/* État actif des textes selon le mode */
.tier-list-board.classic + * .mode-text[data-mode="classic"],
.tier-list-board:not(.classic) + * .mode-text[data-mode="modern"] {
    color: #007bff;
    font-weight: 600;
}

.toggle-switch-wrapper {
    position: relative;
    display: inline-block;
}

.toggle-switch {
    position: relative;
    width: 54px;
    height: 28px;
    appearance: none;
    background-color: #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    outline: none;
    border: none;
}

.toggle-switch:checked {
    background-color: #007bff;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.toggle-switch:checked + .toggle-slider {
    transform: translateX(26px);
}

.toggle-switch:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* ===== STYLES POUR LES MODES ===== */

/* Mode moderne (existant) - utilise les styles par défaut existants */

/* Mode classique basé sur inspi.html */
.tier-list-board.classic {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.tier-list-board.classic .tier-row {
    display: flex;
    margin-bottom: 10px;
    min-height: 100px;
    border-radius: 4px;
    overflow: hidden;
}

.tier-list-board.classic .tier-label {
    width: 100px;
    background-color: #333;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 4px 0 0 4px;
    text-transform: uppercase;
    font-size: 1.2rem;
}

.tier-list-board.classic .tier-items {
    flex-grow: 1;
    background-color: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 0 4px 4px 0;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 5px;
    min-height: 100px;
}

/* Couleurs spécifiques des tiers en mode classique */
.tier-list-board.classic .tier-row[data-tier="S"] .tier-label { 
    background-color: #ff4d4d !important; 
    background: #ff4d4d !important;
}
.tier-list-board.classic .tier-row[data-tier="A"] .tier-label { 
    background-color: #ff9933 !important; 
    background: #ff9933 !important;
}
.tier-list-board.classic .tier-row[data-tier="B"] .tier-label { 
    background-color: #33cc33 !important; 
    background: #33cc33 !important;
}
.tier-list-board.classic .tier-row[data-tier="C"] .tier-label { 
    background-color: #3399ff !important; 
    background: #3399ff !important;
}
.tier-list-board.classic .tier-row[data-tier="D"] .tier-label { 
    background-color: #9933ff !important; 
    background: #9933ff !important;
}

/* Items en mode classique */
.tier-list-board.classic .tier-item {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: move;
    user-select: none;
    margin: 2px;
}

/* Effet de highlight pour les zones de drop en mode classique */
.tier-list-board.classic .tier-items.sortable-chosen,
.tier-list-board.classic .tier-items.sortable-over {
    background-color: #d0d0d0;
}

/* Section unranked en mode classique */
.unranked-section.classic .unranked-container {
    background-color: #e0e0e0;
    padding: 10px;
    border-radius: 4px;
    margin-top: 20px;
}

.unranked-section.classic #unranked-items {
    background-color: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.unranked-section.classic .tier-item {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: move;
    user-select: none;
}

.share-zone-top {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.share-controls-horizontal {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-buttons-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: stretch;
}

.share-buttons-horizontal .button {
    flex: 1 1 auto;
    min-width: 140px;
    max-width: 220px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* Forcer la priorité des styles responsive pour les boutons */
.share-zone-top .share-controls-horizontal .share-buttons-horizontal {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
    justify-content: center !important;
    align-items: stretch !important;
}

.share-zone-top .share-controls-horizontal .share-buttons-horizontal .button {
    flex: 1 1 auto !important;
    min-width: 140px !important;
    max-width: 220px !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
}

/* Style spécial pour le bouton de suppression */
.share-buttons-horizontal #reset-btn {
    border-color: #ff3860 !important;
    color: #ff3860 !important;
    background-color: white !important;
    font-weight: 500 !important;
}

.share-buttons-horizontal #reset-btn:hover {
    background-color: #ff3860 !important;
    color: white !important;
    border-color: #ff3860 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(255, 56, 96, 0.3) !important;
}

.share-buttons-horizontal #reset-btn:focus {
    box-shadow: 0 0 0 0.125em rgba(255, 56, 96, 0.25) !important;
}

.unranked-section {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-top: 1rem; /* Réduire la marge de 1.5rem */
}

/* Layout par défaut - MOBILE FIRST */
.tierlist-main-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tierlist-with-unranked {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    order: 1;
}

.tierlist-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    order: 2;
}

/* Layout DESKTOP - PRIORITÉ ABSOLUE */
@media screen and (min-width: 1024px) {
    .tierlist-main-content {
        display: grid !important;
        grid-template-columns: 1fr 300px !important;
        gap: 1.5rem !important;
        align-items: start !important;
    }
    
    .tierlist-with-unranked {
        grid-column: 1 !important;
        order: unset !important;
    }
    
    .tierlist-sidebar {
        grid-column: 2 !important;
        order: unset !important;
    }
}

/* ===== RESPONSIVE POUR LE MODE TOGGLE ===== */
@media (max-width: 768px) {
    .mode-toggle-container {
        margin-bottom: 1.5rem;
    }
    
    .mode-toggle-label {
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .mode-text {
        min-width: 70px;
        font-size: 0.85rem;
    }
    
    .toggle-switch {
        width: 48px;
        height: 26px;
    }
    
    .toggle-slider {
        width: 22px;
        height: 22px;
    }
    
    .toggle-switch:checked + .toggle-slider {
        transform: translateX(22px);
    }
    
    /* Ajustements pour le mode classique sur mobile */
    .tier-list-board.classic .tier-label {
        width: 80px;
        font-size: 1rem;
    }
    
    .tier-list-board.classic .tier-item,
    .unranked-section.classic .tier-item {
        width: 70px;
        height: 70px;
    }
}

.upload-sidebar,
.instructions-sidebar {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.trash-zone {
    background-color: #ffe6e6;
    border: 2px dashed #ff6b6b;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.trash-zone:hover {
    background-color: #ffcccc;
    border-color: #ff4757;
}

.export-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 300px;
}

.export-progress-content {
    text-align: center;
}

.unranked-container {
    min-height: 100px;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    background-color: #f8f9fa;
    position: relative;
}

#unranked-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 80px;
    padding: 5px;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 2rem;
    font-style: italic;
}

.empty-state.is-hidden {
    display: none !important;
}
