/* Tier List - Styles responsifs et corrections visuelles */

/* Styles de base pour les titres */
.tier-heading {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    margin-bottom: 1rem !important;
    letter-spacing: 0.5px !important;
}

.tier-subtitle {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 400 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    margin-bottom: 0.5rem !important;
}

/* Styles pour les héros - garantir la visibilité */
.hero.is-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    color: white !important;
}

.hero.is-primary .title,
.hero.is-primary .subtitle {
    color: white !important;
}

/* MOBILE ONLY - Tablettes et mobile (max-width: 1023px) */
@media screen and (max-width: 1023px) {
    .tierlist-main-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .tierlist-with-unranked {
        order: 1 !important;
        gap: 0.75rem !important;
    }
    
    .tierlist-sidebar {
        order: 2 !important;
    }
}

/* Mobile large et tablettes (481px-1023px) */
@media screen and (min-width: 481px) and (max-width: 1023px) {
    .tier-list-container {
        padding: 1rem !important;
    }
    
    .unranked-section {
        margin-top: 1rem !important;
        padding: 1.25rem !important;
    }
    
    .upload-sidebar,
    .instructions-sidebar {
        padding: 1.25rem !important;
    }
    
    .tier-item {
        width: 85px !important;
        height: 85px !important;
        margin: 0.3rem !important;
    }
}

/* Tablettes spécifiquement (769px-1023px) */
@media screen and (min-width: 769px) and (max-width: 1023px) {
    .tierlist-main-content {
        display: grid !important;
        grid-template-columns: 1fr 280px !important;
        gap: 1.25rem !important;
    }
    
    .tierlist-with-unranked {
        order: unset !important;
    }
    
    .tierlist-sidebar {
        order: unset !important;
    }
}

/* Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    .tier-list-container {
        padding: 0.75rem !important;
    }
    
    .tier-row {
        margin-bottom: 0.75rem !important;
        min-height: 70px !important;
        margin-bottom: 6px !important;
    }
    
    .tier-items {
        padding: 0.5rem !important;
        min-height: 68px !important;
        gap: 2px !important;
    }
    
    .tier-item {
        width: 80px !important;
        height: 80px !important;
        margin: 0.25rem !important;
    }
    
    .tier-label {
        min-width: 60px !important;
        width: 60px !important;
        font-size: 1.3rem !important;
        flex-shrink: 0 !important;
    }
    
    .tier-heading {
        font-size: 1.75rem !important;
    }
    
    .tier-subtitle {
        font-size: 1rem !important;
    }
    
    .tier-list-board {
        padding: 8px !important;
        margin-bottom: 15px !important;
    }
    
    .unranked-section {
        margin-top: 0.75rem !important;
        padding: 1rem !important;
    }
    
    .upload-sidebar,
    .instructions-sidebar {
        padding: 1rem !important;
    }
    
    .upload-drop-zone {
        padding: 1rem !important;
        margin: 0.5rem 0 !important;
    }
}

/* Très petits écrans (max-width: 480px) */
@media screen and (max-width: 480px) {
    .tier-item {
        width: 60px !important;
        height: 60px !important;
        margin: 0.2rem !important;
    }
    
    .tier-heading {
        font-size: 1.5rem !important;
    }
    
    .tier-subtitle {
        font-size: 0.95rem !important;
        padding: 0 0.5rem !important;
    }
    
    .tier-label {
        width: 40px !important;
        font-size: 1.2rem !important;
    }
    
    .tier-list-board {
        padding: 6px !important;
        margin-bottom: 12px !important;
    }
    
    .tier-row {
        min-height: 60px !important;
        margin-bottom: 4px !important;
    }
    
    .tier-items {
        padding: 3px !important;
        min-height: 58px !important;
    }
    
    .unranked-section {
        margin-top: 0.5rem !important;
        padding: 0.75rem !important;
    }
    
    .tierlist-main-content {
        gap: 0.75rem !important;
    }
    
    .tierlist-with-unranked {
        gap: 0.5rem !important;
    }
    
    .upload-sidebar,
    .instructions-sidebar {
        padding: 0.75rem !important;
    }
    
    .trash-zone {
        padding: 0.75rem !important;
        margin-top: 1rem !important;
    }
    
    .upload-trigger {
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
    }
}

/* Garantir que la tier list board ne déborde pas */
@media screen and (max-width: 768px) {
    .tierlist-board-container {
        width: 100% !important;
        overflow-x: auto !important;
    }
    
    .tier-list-board {
        min-width: 300px !important;
        width: 100% !important;
    }
}

/* Améliorer la lisibilité et le contraste des boutons */
.button {
    font-weight: 500 !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease-in-out !important;
}

.button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Transitions plus fluides pour les éléments draggables */
.tier-item {
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out !important;
}

.tier-item:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    z-index: 2 !important;
}

/* État actif pour drag-and-drop */
.tier-item.is-dragging {
    transform: scale(1.1) !important;
    z-index: 999 !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Style pour les placeholders de drop */
.sortable-ghost {
    opacity: 0.3 !important;
}

.sortable-chosen {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
}

/* Responsive design pour les boutons de partage */
/* Tablettes et écrans moyens */
@media screen and (max-width: 1024px) {
    .share-buttons-horizontal {
        justify-content: stretch !important;
    }
    
    .share-buttons-horizontal .button {
        flex: 1 1 auto !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

/* Écrans mobiles */
@media screen and (max-width: 768px) {
    .share-zone-top {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .share-controls-horizontal {
        gap: 0.75rem !important;
    }
    
    .share-buttons-horizontal {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .share-buttons-horizontal .button {
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
        flex: none !important;
        justify-content: center !important;
        padding: 0.75rem 1rem !important;
    }
    
    .share-buttons-horizontal .button .icon {
        margin-right: 0.5rem !important;
    }
}

/* Petits écrans mobiles */
@media screen and (max-width: 480px) {
    .share-zone-top {
        padding: 0.75rem !important;
    }
    
    .share-buttons-horizontal {
        gap: 0.5rem !important;
    }
    
    .share-buttons-horizontal .button {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .share-buttons-horizontal .button .icon {
        margin-right: 0.35rem !important;
    }
    
    .share-buttons-horizontal .button span:not(.icon) {
        font-size: 0.85rem !important;
    }
}

/* Écrans intermédiaires - amélioration */
@media screen and (min-width: 769px) and (max-width: 1023px) {
    .share-buttons-horizontal {
        justify-content: space-between !important;
    }
    
    .share-buttons-horizontal .button {
        flex: 1 1 calc(50% - 0.375rem) !important;
        max-width: calc(50% - 0.375rem) !important;
    }
    
    .share-buttons-horizontal .button:nth-child(odd):last-child {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* Optimisations pour très grands écrans */
@media screen and (min-width: 1400px) {
    .tierlist-main-content {
        grid-template-columns: 1fr 320px !important;
        gap: 2rem !important;
    }
    
    .tier-list-container {
        max-width: 1200px !important;
        margin: 0 auto !important;
    }
    
    .share-buttons-horizontal {
        max-width: 800px !important;
        margin: 0 auto !important;
    }
    
    .share-buttons-horizontal .button {
        max-width: 180px !important;
    }
}

/* Styles améliorés pour le bouton de suppression */
.share-buttons-horizontal #reset-btn.button.is-danger.is-outlined {
    background-color: transparent !important;
    border: 2px solid #ff3860 !important;
    color: #ff3860 !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.share-buttons-horizontal #reset-btn.button.is-danger.is-outlined:hover,
.share-buttons-horizontal #reset-btn.button.is-danger.is-outlined:focus {
    background-color: #ff3860 !important;
    color: white !important;
    border-color: #ff3860 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(255, 56, 96, 0.4) !important;
}

.share-buttons-horizontal #reset-btn.button.is-danger.is-outlined:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(255, 56, 96, 0.3) !important;
}

/* Assurer la lisibilité sur tous les arrière-plans */
@media screen and (max-width: 768px) {
    .share-buttons-horizontal #reset-btn.button.is-danger.is-outlined {
        border-width: 2px !important;
        font-weight: 700 !important;
    }
}
