/**
 * =====================================================
 * SYSTÈME DE RANGS - STYLES CSS
 * =====================================================
 * Styles pour la personnalisation des noms d'utilisateurs
 * selon leur rang
 * =====================================================
 */

/* ============================================
   IMPORT DES POLICES GOOGLE
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Cinzel:wght@400;700&family=Cormorant+Garamond:wght@400;700&family=Dancing+Script:wght@400;700&family=IM+Fell+English:ital@0;1&family=MedievalSharp&family=Oswald:wght@400;700&family=Playfair+Display:wght@400;700&family=UnifrakturMaguntia&display=swap');

/* ============================================
   COULEURS DES RANGS
   ============================================ */
:root {
    --rank-gueux-color: #9e9e9e;
    --rank-ecuyer-color: #4caf50;
    --rank-chevalier-color: #2196f3;
    --rank-seigneur-color: #ffc107;
}

/* ============================================
   STYLES DE BASE DES NOMS
   ============================================ */
.styled-username {
    display: inline;
    transition: all 0.3s ease;
}

/* Styles de texte */
.name-bold {
    font-weight: bold !important;
}

.name-italic {
    font-style: italic !important;
}

.name-underline {
    text-decoration: underline !important;
}

/* ============================================
   POLICES D'ÉCRITURE
   ============================================ */
.font-default {
    font-family: inherit;
}

.font-medieval {
    font-family: 'MedievalSharp', cursive;
}

.font-fantasy {
    font-family: 'Cinzel', serif;
}

.font-elegant {
    font-family: 'Playfair Display', serif;
}

.font-bold {
    font-family: 'Oswald', sans-serif;
}

.font-script {
    font-family: 'Dancing Script', cursive;
}

.font-gothic {
    font-family: 'UnifrakturMaguntia', cursive;
}

.font-royal {
    font-family: 'Cormorant Garamond', serif;
}

.font-ancient {
    font-family: 'IM Fell English', serif;
}

.font-mystic {
    font-family: 'Amatic SC', cursive;
    font-size: 1.2em;
}

/* ============================================
   BADGES DE RANG
   ============================================ */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
    margin-right: 0.3em;
    vertical-align: middle;
}

.rank-badge-gueux {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: #fff;
}

.rank-badge-ecuyer {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: #fff;
}

.rank-badge-chevalier {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: #fff;
}

.rank-badge-seigneur {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Brillance */
.anim-glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
    }
    50% {
        text-shadow: 0 0 20px currentColor, 0 0 30px currentColor, 0 0 40px currentColor;
    }
}

/* Pulsation */
.anim-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Arc-en-ciel */
.anim-rainbow {
    animation: rainbow 3s linear infinite;
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 400% 50%;
    }
}

/* Tremblement */
.anim-shake {
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

/* Flottement */
.anim-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Étincelles */
.anim-sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
    position: relative;
}

.anim-sparkle::before,
.anim-sparkle::after {
    content: '✨';
    position: absolute;
    animation: sparkle-move 1.5s ease-in-out infinite;
    font-size: 0.6em;
}

.anim-sparkle::before {
    left: -1em;
    top: -0.5em;
}

.anim-sparkle::after {
    right: -1em;
    bottom: -0.5em;
    animation-delay: 0.75s;
}

@keyframes sparkle {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

@keyframes sparkle-move {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Flammes */
.anim-fire {
    animation: fire 0.8s ease-in-out infinite;
    text-shadow: 
        0 0 5px #ff4500,
        0 -5px 10px #ff6600,
        0 -10px 15px #ff9900;
}

@keyframes fire {
    0%, 100% {
        text-shadow: 
            0 0 5px #ff4500,
            0 -5px 10px #ff6600,
            0 -10px 15px #ff9900;
    }
    50% {
        text-shadow: 
            0 0 10px #ff4500,
            0 -8px 15px #ff6600,
            0 -15px 20px #ff9900,
            0 -20px 25px #ffcc00;
    }
}

/* Glace */
.anim-ice {
    animation: ice 2s ease-in-out infinite;
    text-shadow: 
        0 0 5px #00ffff,
        0 0 10px #00ccff;
    color: #b3e5fc !important;
}

@keyframes ice {
    0%, 100% {
        text-shadow: 
            0 0 5px #00ffff,
            0 0 10px #00ccff;
        filter: brightness(1);
    }
    50% {
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ccff,
            0 0 30px #0099ff;
        filter: brightness(1.2);
    }
}

/* Ombre mouvante */
.anim-shadow {
    animation: shadow-move 2s ease-in-out infinite;
}

@keyframes shadow-move {
    0%, 100% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    25% {
        text-shadow: -2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow: -2px -2px 4px rgba(0, 0, 0, 0.8);
    }
    75% {
        text-shadow: 2px -2px 4px rgba(0, 0, 0, 0.8);
    }
}

/* Néon */
.anim-neon {
    animation: neon 1.5s ease-in-out infinite alternate;
}

@keyframes neon {
    0% {
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 15px currentColor,
            0 0 20px currentColor,
            0 0 25px currentColor;
    }
    100% {
        text-shadow: 
            0 0 2px #fff,
            0 0 5px #fff,
            0 0 8px currentColor,
            0 0 10px currentColor,
            0 0 12px currentColor;
    }
}

/* ============================================
   EFFETS SPÉCIAUX
   ============================================ */

/* Dégradé */
.effect-gradient {
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Contour lumineux */
.effect-outline {
    -webkit-text-stroke: 1px currentColor;
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor;
}

/* Ombre 3D */
.effect-shadow_3d {
    text-shadow: 
        1px 1px 0 rgba(0, 0, 0, 0.8),
        2px 2px 0 rgba(0, 0, 0, 0.6),
        3px 3px 0 rgba(0, 0, 0, 0.4),
        4px 4px 0 rgba(0, 0, 0, 0.2);
}

/* Métallique */
.effect-metallic {
    background: linear-gradient(180deg, 
        #fff 0%, 
        #ccc 25%, 
        #888 50%, 
        #ccc 75%, 
        #fff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Effet verre */
.effect-glass {
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 5px rgba(255, 255, 255, 0.5);
}

/* Relief */
.effect-emboss {
    text-shadow: 
        -1px -1px 0 rgba(255, 255, 255, 0.3),
        1px 1px 0 rgba(0, 0, 0, 0.5);
}

/* Particules */
.effect-particles {
    position: relative;
}

.effect-particles::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    transform: translate(-50%, -50%);
    background-image: 
        radial-gradient(circle, currentColor 1px, transparent 1px);
    background-size: 10px 10px;
    opacity: 0.3;
    animation: particles-float 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes particles-float {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) translateY(-10px);
        opacity: 0.5;
    }
}

/* ============================================
   STYLES SPÉCIFIQUES PAR RANG
   ============================================ */

/* Gueux - Pas de style spécial */
.rank-gueux {
    color: inherit;
}

/* Écuyer - Léger highlight vert */
.rank-ecuyer {
    /* Les styles sont appliqués via les classes individuelles */
}

/* Chevalier - Léger highlight bleu */
.rank-chevalier {
    /* Les styles sont appliqués via les classes individuelles */
}

/* Seigneur - Highlight doré par défaut */
.rank-seigneur {
    /* Les styles sont appliqués via les classes individuelles */
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .rank-badge {
        font-size: 0.75em;
        padding: 0.1em 0.3em;
    }
    
    .styled-username {
        font-size: 0.95em;
    }
    
    /* Réduire les animations sur mobile */
    .anim-sparkle::before,
    .anim-sparkle::after {
        display: none;
    }
    
    .effect-particles::before {
        display: none;
    }
}

/* ============================================
   MODE SOMBRE / CLAIR AUTOMATIQUE
   ============================================ */
@media (prefers-color-scheme: light) {
    .rank-badge-gueux {
        color: #333;
    }
    
    .effect-shadow_3d {
        text-shadow: 
            1px 1px 0 rgba(0, 0, 0, 0.3),
            2px 2px 0 rgba(0, 0, 0, 0.2),
            3px 3px 0 rgba(0, 0, 0, 0.1);
    }
}

/* ============================================
   UTILITAIRES
   ============================================ */

/* Pour désactiver temporairement les animations */
.no-animation * {
    animation: none !important;
    transition: none !important;
}

/* Pour le mode accessibilité - réduire les mouvements */
@media (prefers-reduced-motion: reduce) {
    .styled-username,
    .styled-username * {
        animation: none !important;
        transition: none !important;
    }
}
