/* ============================================
   ERA RAID - Effects & Animations
   Floating numbers, transitions, visual effects
   ============================================ */

/* ============================================
   FLOATING DAMAGE/HEAL NUMBERS (DOM-based)
   ============================================ */

.floating-number {
    position: fixed;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8),
                 -1px -1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: var(--z-tooltip);
    animation: float-up 1.5s ease-out forwards;
    will-change: transform, opacity;
}

/* Damage Numbers */
.floating-number.damage {
    color: var(--accent-red);
    font-size: var(--font-lg);
}

.floating-number.damage.crit {
    color: #ff0000;
    font-size: var(--font-xxl);
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.floating-number.damage.own {
    color: var(--accent-cyan);
    font-size: var(--font-xl);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.floating-number.damage.own.crit {
    color: #00ffff;
    font-size: var(--font-xxxl);
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.7),
                 0 0 30px rgba(0, 255, 255, 0.4),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Healing Numbers */
.floating-number.healing {
    color: var(--accent-green);
    font-size: var(--font-lg);
}

.floating-number.healing.own {
    color: #00ff88;
    font-size: var(--font-xl);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.floating-number.healing.crit {
    color: #00ff00;
    font-size: var(--font-xxl);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Boss Damage */
.floating-number.boss-damage {
    color: #ff6600;
    font-size: var(--font-xl);
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.5),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Float Up Animation */
@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    20% {
        transform: translateY(-20px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.8);
    }
}

/* Float Up with Bounce (for crits) */
@keyframes float-up-crit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5);
    }
    10% {
        transform: translateY(-10px) scale(1.3);
    }
    30% {
        transform: translateY(-30px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.7);
    }
}

.floating-number.crit {
    animation: float-up-crit 1.8s ease-out forwards;
}

/* ============================================
   BOSS ABILITY INDICATOR
   ============================================ */

.boss-ability-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--spacing-lg) var(--spacing-xxl);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--accent-orange);
    border-radius: var(--radius-lg);
    z-index: var(--z-modal);
    animation: ability-flash 2s ease-out forwards;
}

.boss-ability-indicator.enrage {
    border-color: var(--accent-red);
    background: rgba(40, 0, 0, 0.9);
}

.boss-ability-indicator .ability-name {
    font-size: var(--font-xxl);
    font-weight: 700;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.boss-ability-indicator.enrage .ability-name {
    color: var(--accent-red);
}

@keyframes ability-flash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    20% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* ============================================
   SCREEN FLASH EFFECTS
   ============================================ */

.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: var(--z-modal);
    animation: screen-flash 0.5s ease-out forwards;
}

.screen-flash.damage {
    background: radial-gradient(circle at center,
        rgba(255, 0, 0, 0.3) 0%,
        rgba(255, 0, 0, 0) 70%);
}

.screen-flash.heal {
    background: radial-gradient(circle at center,
        rgba(0, 255, 0, 0.2) 0%,
        rgba(0, 255, 0, 0) 70%);
}

.screen-flash.victory {
    background: radial-gradient(circle at center,
        rgba(255, 215, 0, 0.4) 0%,
        rgba(255, 215, 0, 0) 80%);
}

@keyframes screen-flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ============================================
   HEALTH BAR ANIMATIONS
   ============================================ */

.health-bar-fill {
    transition: width 0.3s ease;
}

.health-bar-fill.animating {
    transition: width 0.1s linear;
}

/* Damage Shake */
@keyframes damage-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

.health-bar.taking-damage {
    animation: damage-shake 0.3s ease;
}

/* Heal Pulse */
@keyframes heal-pulse {
    0% { box-shadow: 0 0 0 0 rgba(75, 255, 75, 0.5); }
    50% { box-shadow: 0 0 10px 5px rgba(75, 255, 75, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(75, 255, 75, 0); }
}

.health-bar.healing {
    animation: heal-pulse 0.5s ease;
}

/* ============================================
   ABILITY BUTTON EFFECTS
   ============================================ */

/* Cooldown Progress */
.cooldown-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: conic-gradient(
        transparent var(--progress, 0deg),
        rgba(0, 0, 0, 0.7) var(--progress, 0deg)
    );
    border-radius: var(--radius-md);
}

/* Ability Ready Flash */
@keyframes ability-ready {
    0% { box-shadow: 0 0 0 0 rgba(255, 139, 75, 0.7); }
    50% { box-shadow: 0 0 15px 5px rgba(255, 139, 75, 0.5); }
    100% { box-shadow: 0 0 0 0 rgba(255, 139, 75, 0); }
}

.ability-button.ready {
    animation: ability-ready 0.5s ease;
}

/* Ability Use Flash */
@keyframes ability-use {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(0.95);
        filter: brightness(1.5);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.ability-button.using {
    animation: ability-use 0.2s ease;
}

/* ============================================
   PARTY MEMBER EFFECTS
   ============================================ */

/* Aggro Indicator */
@keyframes aggro-pulse {
    0%, 100% {
        border-color: var(--accent-red);
        box-shadow: 0 0 5px rgba(255, 75, 75, 0.5);
    }
    50% {
        border-color: #ff0000;
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.7);
    }
}

.party-member.aggro {
    border: 2px solid var(--accent-red);
    animation: aggro-pulse 1s infinite;
}

/* Death Animation */
@keyframes death-fade {
    0% { opacity: 1; filter: grayscale(0); }
    100% { opacity: 0.4; filter: grayscale(0.8); }
}

.party-member.dying {
    animation: death-fade 0.5s ease forwards;
}

/* Resurrection Flash */
@keyframes res-flash {
    0% { opacity: 0.4; filter: grayscale(0.8); }
    50% {
        opacity: 1;
        filter: grayscale(0) brightness(1.5);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    }
    100% { opacity: 1; filter: grayscale(0); }
}

.party-member.resurrecting {
    animation: res-flash 0.8s ease;
}

/* ============================================
   VIEW TRANSITIONS
   ============================================ */

.game-view {
    transition: opacity var(--transition-normal);
}

/* Fade In */
@keyframes view-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide In from Right */
@keyframes view-slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In from Bottom */
@keyframes view-slide-in-bottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale In */
@keyframes view-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-view.animate-fade-in {
    animation: view-fade-in 0.3s ease forwards;
}

.game-view.animate-slide-in {
    animation: view-slide-in-right 0.3s ease forwards;
}

.game-view.animate-scale-in {
    animation: view-scale-in 0.3s ease forwards;
}

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

/* Loading Bar Shimmer */
@keyframes loading-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

/* Loading Dots */
@keyframes loading-dots {
    0%, 20% { opacity: 0.3; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0.3; }
}

.loading-dots span {
    animation: loading-dots 1.4s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ============================================
   VICTORY/DEFEAT EFFECTS
   ============================================ */

/* Victory Celebration */
@keyframes victory-entrance {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        transform: scale(1.1) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.result-title.victory {
    animation: victory-entrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Victory Shine */
@keyframes victory-shine {
    0% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { text-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4); }
    100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
}

.result-title.victory::after {
    content: '';
    animation: victory-shine 2s infinite;
}

/* Defeat Entrance */
@keyframes defeat-entrance {
    0% {
        opacity: 0;
        transform: scale(1.5);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.result-title.defeat {
    animation: defeat-entrance 0.6s ease-out;
}

/* ============================================
   BUFF/DEBUFF INDICATORS
   ============================================ */

.buff-indicator {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.buff-indicator.buff {
    background: rgba(75, 159, 255, 0.3);
    border: 1px solid var(--accent-blue);
}

.buff-indicator.debuff {
    background: rgba(255, 75, 75, 0.3);
    border: 1px solid var(--accent-red);
}

.buff-timer {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 8px;
    font-weight: 700;
    color: white;
    background: rgba(0, 0, 0, 0.8);
    padding: 0 2px;
    border-radius: 2px;
}

/* Buff Apply Animation */
@keyframes buff-apply {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.buff-indicator.applying {
    animation: buff-apply 0.3s ease;
}

/* Buff Expire Animation */
@keyframes buff-expire {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.buff-indicator.expiring {
    animation: buff-expire 0.3s ease forwards;
}

/* ============================================
   MISC EFFECTS
   ============================================ */

/* Glow Effect */
.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 5px currentColor); }
    50% { filter: drop-shadow(0 0 15px currentColor); }
}

/* Hover Scale */
.hover-scale {
    transition: transform var(--transition-fast);
}

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

/* Click Ripple */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
}
