/**
 * Styles pour l'affichage des crédits et badges
 * TCF Writing Simulator
 */

/* Badge de crédits */
.credits-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    margin-left: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

/* Badge vert pour crédits suffisants */
.credits-badge-green {
    background-color: #10b981;
    color: white;
    border-color: #059669;
}

.credits-badge-green:hover {
    background-color: #059669;
    transform: scale(1.05);
}

/* Badge orange pour crédits faibles */
.credits-badge-orange {
    background-color: #f59e0b;
    color: white;
    border-color: #d97706;
}

.credits-badge-orange:hover {
    background-color: #d97706;
    transform: scale(1.05);
}

/* Badge rouge pour crédits épuisés */
.credits-badge-red {
    background-color: #ef4444;
    color: white;
    border-color: #dc2626;
}

.credits-badge-red:hover {
    background-color: #dc2626;
    transform: scale(1.05);
}

/* Bouton de correction désactivé */
.btn-correct.disabled,
#btn-correct.disabled,
#btn-correct-mobile.disabled,
#btn-correct-again.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.btn-correct.disabled::after,
#btn-correct.disabled::after,
#btn-correct-mobile.disabled::after,
#btn-correct-again.disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: inherit;
    pointer-events: none;
}

/* Animation pour les badges */
@keyframes badgePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.credits-badge.animate {
    animation: badgePulse 0.6s ease-in-out;
}

/* Responsive design */
@media (max-width: 768px) {
    .credits-badge {
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        font-size: 11px;
        margin-left: 6px;
    }
}

@media (max-width: 480px) {
    .credits-badge {
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: 10px;
        margin-left: 4px;
    }
}

/* Styles pour les boutons avec badges */
.btn-correct,
#btn-correct,
#btn-correct-mobile,
#btn-correct-again {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Amélioration de l'affichage des crédits dans le texte du bouton */
.button-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Style pour l'affichage des crédits entre parenthèses */
.credits-display {
    font-size: 0.9em;
    opacity: 0.8;
    margin-left: 4px;
}

/* Animation d'apparition des badges */
.credits-badge {
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hover effects pour les badges */
.credits-badge:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Focus states pour l'accessibilité */
.credits-badge:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .credits-badge-green {
        background-color: #059669;
        border-color: #047857;
    }
    
    .credits-badge-orange {
        background-color: #d97706;
        border-color: #b45309;
    }
    
    .credits-badge-red {
        background-color: #dc2626;
        border-color: #b91c1c;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .credits-badge {
        border-width: 3px;
        font-weight: 700;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .credits-badge,
    .credits-badge:hover,
    .credits-badge.animate {
        animation: none;
        transition: none;
        transform: none;
    }
}
