/**
 * VolleyXP Animations CSS - Module M12
 * Styles, keyframes et variables
 * 
 * @version 1.0.0
 */

/* ========== VARIABLES CSS ========== */
:root {
    --vx-color-primary: #FF6B35;
    --vx-color-secondary: #4ECDC4;
    --vx-color-success: #4CAF50;
    --vx-color-warning: #FFC107;
    --vx-color-danger: #F44336;
    --vx-color-gold: #FFD700;
    --vx-color-dark: #1A1A2E;
    
    --vx-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --vx-shadow-md: 0 4px 15px rgba(0, 0, 0, 0.15);
    --vx-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.2);
    
    --vx-radius-sm: 4px;
    --vx-radius-md: 8px;
    --vx-radius-lg: 16px;
    --vx-radius-full: 50%;
    
    --vx-transition-fast: 150ms ease;
    --vx-transition-normal: 300ms ease;
    --vx-transition-slow: 500ms ease;
    
    --vx-z-toast: 10001;
    --vx-z-overlay: 10000;
    --vx-z-particles: 10002;
}

/* ========== XP FLOTTANT ========== */
.vx-xp-float {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 24px;
    font-weight: 700;
    color: var(--vx-color-success);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(76, 175, 80, 0.5);
    pointer-events: none;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.vx-xp-float.bonus {
    color: var(--vx-color-gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 215, 0, 0.6);
}

.vx-xp-icon {
    font-size: 20px;
}

/* ========== LEVEL UP OVERLAY ========== */
.vx-level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--vx-z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.vx-level-up-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.vx-level-up-content {
    text-align: center;
    color: white;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vx-level-up-overlay.visible .vx-level-up-content {
    transform: scale(1);
}

.vx-level-up-label {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.vx-level-up-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--vx-color-gold), #FFA500);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.6), 0 0 100px rgba(255, 165, 0, 0.4);
    animation: levelup-glow 2s ease-in-out infinite;
}

.vx-level-up-number {
    font-size: 72px;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.vx-level-up-name {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--vx-color-gold);
}

.vx-level-up-btn {
    background: linear-gradient(135deg, var(--vx-color-primary), #FF8C5A);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vx-level-up-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
}

@keyframes levelup-glow {
    0%, 100% { box-shadow: 0 0 60px rgba(255, 215, 0, 0.6), 0 0 100px rgba(255, 165, 0, 0.4); }
    50% { box-shadow: 0 0 80px rgba(255, 215, 0, 0.8), 0 0 120px rgba(255, 165, 0, 0.6); }
}

/* ========== BADGE UNLOCK OVERLAY ========== */
.vx-badge-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--vx-z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.vx-badge-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.vx-badge-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 40px;
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vx-badge-overlay.visible .vx-badge-content {
    transform: scale(1);
}

.vx-badge-header {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.vx-badge-icon-wrapper {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    box-shadow: 0 0 40px var(--glow-color, #9E9E9E);
    animation: badge-pulse 2s ease-in-out infinite;
}

.vx-badge-icon {
    font-size: 80px;
    animation: badge-spin 0.8s ease-out;
}

.vx-badge-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.vx-badge-rarity {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.vx-badge-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    line-height: 1.5;
}

.vx-badge-reward {
    font-size: 20px;
    font-weight: 700;
    color: var(--vx-color-success);
    margin-bottom: 25px;
}

.vx-badge-btn {
    background: white;
    color: var(--vx-color-dark);
    border: none;
    padding: 12px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.vx-badge-btn:hover {
    transform: scale(1.05);
}

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

@keyframes badge-spin {
    0% { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Raretés */
.vx-badge-overlay.rarity-common .vx-badge-icon-wrapper { --glow-color: #9E9E9E; }
.vx-badge-overlay.rarity-uncommon .vx-badge-icon-wrapper { --glow-color: #4CAF50; }
.vx-badge-overlay.rarity-rare .vx-badge-icon-wrapper { --glow-color: #2196F3; }
.vx-badge-overlay.rarity-epic .vx-badge-icon-wrapper { --glow-color: #9C27B0; }
.vx-badge-overlay.rarity-legendary .vx-badge-icon-wrapper { --glow-color: #FF9800; }

/* ========== STREAK BONUS ========== */
.vx-streak-bonus {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #FF6B35, #FF8C5A);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: var(--vx-shadow-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: var(--vx-z-toast);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.vx-streak-bonus.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.vx-streak-flame {
    font-size: 32px;
    animation: flame-dance 0.5s ease-in-out infinite alternate;
}

.vx-streak-text {
    font-size: 16px;
    font-weight: 500;
}

.vx-streak-multiplier {
    font-size: 20px;
    font-weight: 800;
    color: var(--vx-color-gold);
}

@keyframes flame-dance {
    0% { transform: scale(1) rotate(-5deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

/* ========== MATCH RESULT ========== */
.vx-match-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    text-align: center;
    z-index: var(--vx-z-overlay);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.vx-match-result.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.vx-result-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: result-bounce 0.6s ease;
}

.vx-result-text {
    font-size: 48px;
    font-weight: 900;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.vx-match-result.victory .vx-result-text {
    color: var(--vx-color-gold);
}

.vx-match-result.defeat .vx-result-text {
    color: white;
    font-size: 36px;
}

.vx-result-sub {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
}

@keyframes result-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ========== NEW RECORD ========== */
.vx-new-record {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    text-align: center;
    z-index: var(--vx-z-overlay);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.vx-new-record.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.vx-record-star {
    font-size: 60px;
    animation: star-spin 1s ease;
}

.vx-record-label {
    font-size: 24px;
    font-weight: 800;
    color: var(--vx-color-gold);
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 2px;
}

.vx-record-value {
    font-size: 48px;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

@keyframes star-spin {
    0% { transform: rotate(0deg) scale(0); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ========== CONTRACT COMPLETE ========== */
.vx-contract-complete {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: white;
    padding: 20px 40px;
    border-radius: var(--vx-radius-lg);
    box-shadow: var(--vx-shadow-lg);
    text-align: center;
    z-index: var(--vx-z-toast);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.vx-contract-complete.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.vx-contract-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.vx-contract-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--vx-color-success);
    margin-bottom: 5px;
}

.vx-contract-name {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.vx-contract-reward {
    font-size: 20px;
    font-weight: 700;
    color: var(--vx-color-success);
}

/* ========== TOAST NOTIFICATIONS ========== */
.vx-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--vx-z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.vx-toast {
    background: white;
    padding: 15px 20px;
    border-radius: var(--vx-radius-md);
    box-shadow: var(--vx-shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-slide-in 0.3s ease;
}

.vx-toast.xp {
    border-left: 4px solid var(--vx-color-success);
}

.vx-toast.badge {
    border-left: 4px solid var(--vx-color-gold);
}

.vx-toast.exit {
    animation: toast-slide-out 0.3s ease forwards;
}

.vx-toast-icon {
    font-size: 24px;
}

.vx-toast-content {
    display: flex;
    flex-direction: column;
}

.vx-toast-content strong {
    font-size: 16px;
    color: #333;
}

.vx-toast-content small {
    font-size: 13px;
    color: #666;
}

@keyframes toast-slide-in {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes toast-slide-out {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* ========== PROGRESS BAR ========== */
.vx-progress-glow {
    box-shadow: 0 0 15px var(--vx-color-primary);
}

.vx-progress-pulse {
    animation: progress-pulse 0.5s ease 2;
}

@keyframes progress-pulse {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.02); }
}

/* ========== RANK CHANGE ========== */
.vx-rank-change {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    margin-left: 8px;
}

.vx-rank-change.up {
    color: var(--vx-color-success);
}

.vx-rank-change.down {
    color: var(--vx-color-danger);
}

/* ========== MICRO-INTERACTIONS ========== */

/* Ripple effect */
.vx-ripple-effect {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Spinner */
.vx-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip */
.vx-tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: var(--vx-radius-sm);
    font-size: 14px;
    transform: translate(-50%, -100%);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 10003;
    white-space: nowrap;
    max-width: 300px;
}

.vx-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(-8px);
}

/* Card hover */
.card, .vx-card, .vx-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Input states */
.vx-input-success input,
.vx-input-success textarea,
.vx-input-success select {
    border-color: var(--vx-color-success) !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2) !important;
}

.vx-input-error input,
.vx-input-error textarea,
.vx-input-error select {
    border-color: var(--vx-color-danger) !important;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2) !important;
}

/* Focus ring accessible */
.vx-focus-ring {
    outline: 2px solid var(--vx-color-primary);
    outline-offset: 2px;
}

/* Skeleton loading */
.vx-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Glitch effect */
.vx-glitch {
    animation: glitch 0.3s ease infinite;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* Animate on scroll */
.vx-animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.vx-animate-on-scroll.vx-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .vx-animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .vx-level-up-circle {
        width: 150px;
        height: 150px;
    }
    
    .vx-level-up-number {
        font-size: 56px;
    }
    
    .vx-level-up-name {
        font-size: 24px;
    }
    
    .vx-badge-icon-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .vx-badge-icon {
        font-size: 60px;
    }
    
    .vx-badge-name {
        font-size: 22px;
    }
    
    .vx-toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .vx-result-text {
        font-size: 36px;
    }
    
    .vx-result-icon {
        font-size: 60px;
    }
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
    .vx-toast {
        background: #2d2d2d;
    }
    
    .vx-toast-content strong {
        color: #fff;
    }
    
    .vx-toast-content small {
        color: #aaa;
    }
    
    .vx-contract-complete {
        background: #2d2d2d;
    }
    
    .vx-contract-name {
        color: #ddd;
    }
    
    .vx-tooltip {
        background: #444;
    }
}
