/* ========================================
   MONSTER-RARITY-FIX.CSS - Corrections rareté et affichage mobile
   ======================================== */

/* Fix 1: Réorganisation du header mobile pour éviter le chevauchement */
@media (max-width: 768px) {
    /* Header du modal monstre */
    .mobile-monster-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Badge de rareté positionné sous le header */
    .header-rarity-badge {
        display: inline-block;
        margin: 0 auto 1rem;
        padding: 0.4rem 1.2rem;
        font-size: 0.8rem;
        text-align: center;
        position: relative !important;
        top: auto !important;
        right: auto !important;
    }
    
    /* Info rapide du monstre */
    .mobile-monster-quick-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    /* Nom du monstre */
    .mobile-monster-name {
        font-size: 1.5rem !important;
        margin: 0 !important;
        text-align: center;
    }
    
    /* Badge de rareté dans quick info - le cacher car on l'a déjà en haut */
    .mobile-monster-quick-info .mobile-monster-rarity {
        display: none !important;
    }
    
    /* Fix pour les cartes de monstres dans la liste */
    .monster-display {
        position: relative;
        padding-top: 0.5rem;
    }
    
    .monster-display .rarity-badge {
        position: absolute;
        top: 5px;
        right: 5px;
        font-size: 0.6rem !important;
        padding: 0.2rem 0.5rem !important;
        z-index: 10;
    }
    
    .monster-display .monster-name {
        margin-top: 0.5rem;
        font-size: 0.9rem !important;
    }
    
    /* Pour le desktop monster display */
    .monster-header-improved {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem !important;
    }
    
    .monster-basic-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .monster-name-large {
        font-size: 1.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .monster-rarity-badge {
        position: static !important;
        margin: 0 auto;
    }
}

/* Fix 2: Amélioration générale de l'affichage des badges de rareté */
.rarity-badge,
.monster-rarity-badge,
.header-rarity-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Couleurs cohérentes pour les raretés */
.common {
    background: linear-gradient(135deg, #6b7280, #9ca3af) !important;
    color: white !important;
}

.uncommon {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
    color: white !important;
}

.rare {
    background: linear-gradient(135deg, #3b82f6, #60a5fa) !important;
    color: white !important;
}

.epic {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa) !important;
    color: white !important;
    animation: pulse-epic 2s ease-in-out infinite;
}

.legendary {
    background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
    color: #000 !important;
    animation: pulse-legendary 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

/* Animations pour les raretés élevées */
@keyframes pulse-epic {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
    }
    50% {
        box-shadow: 0 2px 20px rgba(139, 92, 246, 0.8);
    }
}

@keyframes pulse-legendary {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.9);
        transform: scale(1.05);
    }
}

/* Fix 3: Espacement pour éviter les chevauchements sur toutes les tailles d'écran */
.monster-info {
    padding-top: 0.5rem;
}

.monster-card,
.egg-card {
    position: relative;
    overflow: visible; /* Permettre aux badges de dépasser si nécessaire */
}

/* Fix 4: Amélioration du score IV */
.mobile-iv-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.mobile-iv-value.legendary {
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
}

.mobile-iv-value.epic {
    color: #a78bfa;
    text-shadow: 0 0 15px rgba(167, 139, 250, 0.6);
}

.mobile-iv-value.rare {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.mobile-iv-value.uncommon {
    color: #34d399;
}

.mobile-iv-value.common {
    color: #9ca3af;
}

/* Fix 5: Stats parfaites plus visibles */
.mobile-stat-value.perfect {
    color: #fbbf24 !important;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.mobile-stat-value.high {
    color: #a78bfa !important;
    font-weight: 600;
}

/* Fix pour les petits écrans */
@media (max-width: 380px) {
    .mobile-monster-name {
        font-size: 1.2rem !important;
    }
    
    .header-rarity-badge {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.8rem !important;
    }
    
    .monster-display .rarity-badge {
        font-size: 0.55rem !important;
        padding: 0.15rem 0.4rem !important;
    }
}
