/* Animations CSS for RED SKULL Guild Website */

/* Flame Effect */
.flame-effect {
    filter: drop-shadow(0 0 5px var(--color-red-primary));
    animation: flameFlicker 3s infinite alternate;
}

@keyframes flameFlicker {
    0%, 100% {
        filter: drop-shadow(0 0 5px var(--color-red-primary));
    }
    25% {
        filter: drop-shadow(0 0 8px var(--color-red-bright));
    }
    50% {
        filter: drop-shadow(0 0 12px var(--color-red-primary));
    }
    75% {
        filter: drop-shadow(0 0 7px var(--color-red-secondary));
    }
}

/* Hover Flame Effects */
.nav-links a:hover, .footer-links a:hover, .social-link:hover {
    animation: textFlame 0.5s ease-in-out;
}

@keyframes textFlame {
    0% {
        text-shadow: 0 0 4px var(--color-red-primary);
    }
    50% {
        text-shadow: 0 0 10px var(--color-red-bright), 0 0 20px var(--color-red-primary);
    }
    100% {
        text-shadow: 0 0 4px var(--color-red-primary);
    }
}

/* Button Hover Effects */
.cta-button:hover, .view-more-button:hover, .discord-button:hover, .donate-button:hover, .event-join:hover {
    animation: buttonPulse 1s infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: var(--shadow-medium), 0 0 10px rgba(196, 18, 18, 0.5);
    }
    50% {
        box-shadow: var(--shadow-large), 0 0 20px rgba(196, 18, 18, 0.8);
    }
}

/* Logo Animation */
.logo img {
    animation: logoGlow 4s infinite alternate;
}

@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 0 2px var(--color-red-secondary));
    }
    100% {
        filter: drop-shadow(0 0 8px var(--color-red-primary));
    }
}

/* Parallax Effects */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: background-position 0.5s ease-out;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Reveal for Grid Items */
.stagger-reveal > * {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

.stagger-reveal > *:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-reveal > *:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-reveal > *:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-reveal > *:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-reveal > *:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-reveal.active > * {
    opacity: 1;
    transform: translateY(0);
}

/* Blood Drip Animation */
.blood-drip {
    position: relative;
    overflow: hidden;
}

.blood-drip::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 0;
    background-color: var(--color-red-primary);
    animation: bloodDrip 3s infinite;
}

@keyframes bloodDrip {
    0% {
        height: 0;
        top: -10px;
    }
    50% {
        height: 30px;
        top: -10px;
    }
    100% {
        height: 0;
        top: 20px;
    }
}

/* Smoke Effect */
.smoke-effect {
    position: relative;
}

.smoke-effect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to top, rgba(51, 51, 51, 0.3), transparent);
    opacity: 0;
    animation: smokeRise 5s infinite;
}

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

/* Glitch Effect for Text */
.glitch-text {
    position: relative;
    animation: glitchText 3s infinite;
}

@keyframes glitchText {
    0%, 100% {
        transform: translateX(0);
        text-shadow: -1px -1px 0 var(--color-red-secondary), 1px 1px 0 var(--color-red-bright);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
        text-shadow: 1px -1px 0 var(--color-red-secondary), -1px 1px 0 var(--color-red-bright);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
        text-shadow: -1px 1px 0 var(--color-red-secondary), 1px -1px 0 var(--color-red-bright);
    }
}

/* Heartbeat Animation */
.heartbeat {
    animation: heartbeat 1.5s infinite;
}

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

/* Sword Slash Animation */
.sword-slash {
    position: relative;
    overflow: hidden;
}

.sword-slash::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: swordSlash 2s infinite;
}

@keyframes swordSlash {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* Floating Animation */
.floating {
    animation: floating 3s infinite ease-in-out;
}

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

/* Rotating Animation */
.rotating {
    animation: rotating 10s infinite linear;
}

@keyframes rotating {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s infinite;
}

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

/* Fade In Animation */
.fade-in {
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade Out Animation */
.fade-out {
    animation: fadeOut 1s ease-in-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide In From Left */
.slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In From Right */
.slide-in-right {
    animation: slideInRight 0.5s ease-in-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In From Top */
.slide-in-top {
    animation: slideInTop 0.5s ease-in-out;
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In From Bottom */
.slide-in-bottom {
    animation: slideInBottom 0.5s ease-in-out;
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Zoom In Animation */
.zoom-in {
    animation: zoomIn 0.5s ease-in-out;
}

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

/* Zoom Out Animation */
.zoom-out {
    animation: zoomOut 0.5s ease-in-out;
}

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

/* Typing Animation */
.typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--color-red-primary);
    animation: typing 3s steps(30, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-red-primary);
    }
}

/* Blur In Animation */
.blur-in {
    animation: blurIn 1s ease-in-out;
}

@keyframes blurIn {
    from {
        filter: blur(10px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

/* Blur Out Animation */
.blur-out {
    animation: blurOut 1s ease-in-out;
}

@keyframes blurOut {
    from {
        filter: blur(0);
        opacity: 1;
    }
    to {
        filter: blur(10px);
        opacity: 0;
    }
}

/* Flip Animation */
.flip {
    animation: flip 1s ease-in-out;
    transform-style: preserve-3d;
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* Swing Animation */
.swing {
    animation: swing 1s ease-in-out;
    transform-origin: top center;
}

@keyframes swing {
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Tada Animation */
.tada {
    animation: tada 1s ease-in-out;
}

@keyframes tada {
    0% {
        transform: scale(1);
    }
    10%, 20% {
        transform: scale(0.9) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.1) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

/* Wobble Animation */
.wobble {
    animation: wobble 1s ease-in-out;
}

@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Jello Animation */
.jello {
    animation: jello 1s ease-in-out;
}

@keyframes jello {
    0%, 11.1%, 100% {
        transform: none;
    }
    22.2% {
        transform: skewX(-12.5deg) skewY(-12.5deg);
    }
    33.3% {
        transform: skewX(6.25deg) skewY(6.25deg);
    }
    44.4% {
        transform: skewX(-3.125deg) skewY(-3.125deg);
    }
    55.5% {
        transform: skewX(1.5625deg) skewY(1.5625deg);
    }
    66.6% {
        transform: skewX(-0.78125deg) skewY(-0.78125deg);
    }
    77.7% {
        transform: skewX(0.390625deg) skewY(0.390625deg);
    }
    88.8% {
        transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

/* Rubber Band Animation */
.rubber-band {
    animation: rubberBand 1s ease-in-out;
}

@keyframes rubberBand {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scaleX(1.25) scaleY(0.75);
    }
    40% {
        transform: scaleX(0.75) scaleY(1.25);
    }
    50% {
        transform: scaleX(1.15) scaleY(0.85);
    }
    65% {
        transform: scaleX(0.95) scaleY(1.05);
    }
    75% {
        transform: scaleX(1.05) scaleY(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Flash Animation */
.flash {
    animation: flash 1s ease-in-out;
}

@keyframes flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 1s ease-in-out infinite;
}

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

/* Hinge Animation */
.hinge {
    animation: hinge 2s ease-in-out;
    transform-origin: top left;
}

@keyframes hinge {
    0% {
        transform: rotate(0);
    }
    20%, 60% {
        transform: rotate(80deg);
    }
    40%, 80% {
        transform: rotate(60deg);
        opacity: 1;
    }
    100% {
        transform: translateY(700px);
        opacity: 0;
    }
}

/* Roll In Animation */
.roll-in {
    animation: rollIn 1s ease-in-out;
}

@keyframes rollIn {
    0% {
        opacity: 0;
        transform: translateX(-100%) rotate(-120deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotate(0);
    }
}

/* Roll Out Animation */
.roll-out {
    animation: rollOut 1s ease-in-out;
}

@keyframes rollOut {
    0% {
        opacity: 1;
        transform: translateX(0) rotate(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%) rotate(120deg);
    }
}

/* Light Speed In Animation */
.light-speed-in {
    animation: lightSpeedIn 1s ease-out;
}

@keyframes lightSpeedIn {
    0% {
        transform: translateX(100%) skewX(-30deg);
        opacity: 0;
    }
    60% {
        transform: translateX(-20%) skewX(30deg);
        opacity: 1;
    }
    80% {
        transform: translateX(0%) skewX(-15deg);
        opacity: 1;
    }
    100% {
        transform: translateX(0%) skewX(0deg);
        opacity: 1;
    }
}

/* Light Speed Out Animation */
.light-speed-out {
    animation: lightSpeedOut 1s ease-in;
}

@keyframes lightSpeedOut {
    0% {
        transform: translateX(0%) skewX(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(100%) skewX(30deg);
        opacity: 0;
    }
}

/* Rotate In Animation */
.rotate-in {
    animation: rotateIn 1s ease-in-out;
    transform-origin: center;
}

@keyframes rotateIn {
    0% {
        transform: rotate(-200deg);
        opacity: 0;
    }
    100% {
        transform: rotate(0);
        opacity: 1;
    }
}

/* Rotate Out Animation */
.rotate-out {
    animation: rotateOut 1s ease-in-out;
    transform-origin: center;
}

@keyframes rotateOut {
    0% {
        transform: rotate(0);
        opacity: 1;
    }
    100% {
        transform: rotate(200deg);
        opacity: 0;
    }
}

/* Rotate In Down Left Animation */
.rotate-in-down-left {
    animation: rotateInDownLeft 1s ease-in-out;
    transform-origin: left bottom;
}

@keyframes rotateInDownLeft {
    0% {
        transform: rotate(-90deg);
        opacity: 0;
    }
    100% {
        transform: rotate(0);
        opacity: 1;
    }
}

/* Rotate In Down Right Animation */
.rotate-in-down-right {
    animation: rotateInDownRight 1s ease-in-out;
    transform-origin: right bottom;
}

@keyframes rotateInDownRight {
    0% {
        transform: rotate(90deg);
        opacity: 0;
    }
    100% {
        transform: rotate(0);
        opacity: 1;
    }
}

/* Rotate In Up Left Animation */
.rotate-in-up-left {
    animation: rotateInUpLeft 1s ease-in-out;
    transform-origin: left bottom;
}

@keyframes rotateInUpLeft {
    0% {
        transform: rotate(90deg);
        opacity: 0;
    }
    100% {
        transform: rotate(0);
        opacity: 1;
    }
}

/* Rotate In Up Right Animation */
.rotate-in-up-right {
    animation: rotateInUpRight 1s ease-in-out;
    transform-origin: right bottom;
}

@keyframes rotateInUpRight {
    0% {
        transform: rotate(-90deg);
        opacity: 0;
    }
    100% {
        transform: rotate(0);
        opacity: 1;
    }
}

/* ===== Hierarchy Specific Animations ===== */

/* Enhanced card entrance animation */
@keyframes hierarchyCardEntrance {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.9) rotateX(20deg);
    }
    50% {
        opacity: 0.7;
        transform: translateY(20px) scale(0.95) rotateX(10deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

/* Supreme leader special glow */
@keyframes supremeGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.6), 0 0 60px rgba(255, 215, 0, 0.2);
    }
}

/* Avatar glow animation */
@keyframes avatarGlow {
    0%, 100% {
        box-shadow: 0 0 16px var(--color-red-primary);
    }
    25% {
        box-shadow: 0 0 24px var(--color-red-bright), 0 0 32px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 32px #ffff00, 0 0 24px var(--color-red-primary);
    }
    75% {
        box-shadow: 0 0 28px var(--color-red-secondary), 0 0 40px rgba(255, 0, 0, 0.3);
    }
}

/* Title text glow */
@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

/* Knight item hover animation */
@keyframes knightHover {
    0% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        transform: scale(1.03) translateY(-3px);
    }
}

/* Stat bar fill animation */
@keyframes statFill {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

/* Card border glow */
@keyframes cardBorderGlow {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0.2);
    }
    50% {
        border-color: rgba(239, 68, 68, 0.8);
    }
}

/* Hierarchy entrance stagger */
.hierarchy-level .member-card {
    animation: hierarchyCardEntrance 0.8s ease-out forwards;
}

.hierarchy-level.supreme .member-card {
    animation: hierarchyCardEntrance 0.8s ease-out forwards, supremeGlow 3s ease-in-out infinite;
}

.knight-item {
    animation: hierarchyCardEntrance 0.6s ease-out forwards;
}

.level-title {
    animation: titleGlow 4s ease-in-out infinite;
}

/* Enhanced hover states - Removido para evitar conflitos com transições suaves */

.stat-fill {
    animation: statFill 1.5s ease-out forwards;
}

/* Pulsing effect for important elements */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

.knight-avatar {
    animation: pulse 2s ease-in-out infinite;
}

/* Floating effect for knight names */
@keyframes floatText {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

.knight-name {
    animation: floatText 3s ease-in-out infinite;
}
