/**
 * Seasonal Logo Animations CSS
 * Styles for seasonal animations on the AdLuge logo
 */

/* ============================================
   HEADER BACKGROUND (Christmas)
   ============================================ */
header.season-christmas {
    background-image: url('../images/seasonal/headerbg1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ============================================
   LOGIN PAGE BACKGROUND (Christmas)
   ============================================ */
.login-outer-wrap.season-christmas {
    background-image: url('../images/seasonal/login_bg_xmas.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Animation wrapper */
.seasonal-animation-wrapper {
    position: relative;
    display: inline-block;
    overflow: visible;
    z-index: 1;
}

.header-logo.seasonal-animation-active {
    position: relative;
    overflow: visible;
}

/* ============================================
   SNOWFLAKES ANIMATION (Christmas)
   ============================================ */
.snowflakes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.snowflake {
    position: absolute;
    top: -10px;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0.7;
    pointer-events: none;
    animation: snowfall linear infinite;
}

.snowflake::before,
.snowflake::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
}

.snowflake::before {
    transform: translateX(-1px);
}

.snowflake::after {
    transform: translateX(1px);
}

@keyframes snowfall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(25px) translateX(10px) rotate(180deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(60px) translateX(-5px) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================
   SANTA ANIMATION (Christmas)
   ============================================ */
.santa-container {
    position: absolute;
    bottom: -10px;
    right: -40px;
    width: 35px;
    height: 52px;
    pointer-events: none;
    z-index: 20;
}

.santa-image {
    width: 100%;
    height: auto;
    max-width: 35px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease-in;
}

.santa-image.santa-appear {
    animation: santaFadeInOut 4s ease-in-out forwards;
}

@keyframes santaFadeInOut {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    12.5% {
        opacity: 1;
        transform: scale(1);
    }
    87.5% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* ============================================
   GOLDEN SPARKLES ANIMATION (Particles)
   ============================================ */
.sparkles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 17;
}

.sparkle.golden-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    pointer-events: none;
    z-index: 18;
    background-color: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 2px #FFD700, 0 0 4px rgba(255, 215, 0, 0.5);
}

.sparkle.golden-particle.active {
    animation: goldenSparklePop 2s ease-out forwards;
}

@keyframes goldenSparklePop {
    0% {
        opacity: 0;
        transform: scale(0) translate(0, 0);
    }
    15% {
        opacity: 1;
        transform: scale(1.5) translate(0, -5px);
    }
    30% {
        opacity: 1;
        transform: scale(1) translate(0, -10px);
    }
    60% {
        opacity: 0.9;
        transform: scale(0.8) translate(0, -20px);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) translate(0, -35px);
    }
}

/* ============================================
   FALLING GIFTS AND CANDY ANIMATION (Christmas)
   ============================================ */
.falling-gifts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 12;
}

.falling-gift {
    position: absolute;
    width: 20px;
    height: auto;
    object-fit: contain;
    z-index: 13;
    pointer-events: none;
    animation: giftFall var(--fall-duration, 2.5s) linear forwards;
    transform-origin: center center;
    display: block;
    opacity: 1;
    will-change: transform, opacity; /* GPU acceleration hint */
    backface-visibility: hidden; /* Better rendering performance */
    transform: translateZ(0); /* Force hardware acceleration */
}

.falling-gift.falling-candy {
    filter: brightness(1.1) contrast(1.1);
}

.falling-gift-sparkle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 2px #FFD700, 0 0 4px rgba(255, 215, 0, 0.6);
    opacity: 0;
    z-index: 14;
    animation: giftSparkle 1.2s ease-out var(--sparkle-delay, 0s) forwards;
    will-change: transform, opacity; /* GPU acceleration hint */
    backface-visibility: hidden; /* Better rendering performance */
    transform: translateZ(0); /* Force hardware acceleration */
}

@keyframes giftFall {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate3d(var(--random-x, 0px), calc(var(--header-height, 60px) * 0.5), 0) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--random-x, 0px), calc(var(--header-height, 60px) + 30px), 0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes giftSparkle {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0);
    }
    30% {
        opacity: 0.9;
        transform: translate3d(0, -2px, 0) scale(1.5);
    }
    60% {
        opacity: 0.7;
        transform: translate3d(0, -3px, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, -5px, 0) scale(0.5);
    }
}

/* ============================================
   HEARTS ANIMATION (Valentine's Day)
   ============================================ */
.hearts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.heart {
    position: absolute;
    top: -10px;
    width: 12px;
    height: 12px;
    pointer-events: none;
    animation: heartFall linear infinite;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 12px;
    background: #ff1744;
    border-radius: 8px 8px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.heart::after {
    left: 4px;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

@keyframes heartFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(60px) translateX(15px) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================
   CONFETTI ANIMATION (New Year)
   ============================================ */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 6px;
    height: 6px;
    pointer-events: none;
    animation: confettiFall linear infinite;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(60px) translateX(20px) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   BATS ANIMATION (Halloween)
   ============================================ */
.bats-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.bat {
    position: absolute;
    top: -10px;
    width: 12px;
    height: 12px;
    pointer-events: none;
    animation: batFly linear infinite;
}

.bat::before {
    content: '🦇';
    font-size: 12px;
    opacity: 0.7;
}

@keyframes batFly {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.7;
    }
    50% {
        transform: translateY(30px) translateX(15px);
        opacity: 0.5;
    }
    100% {
        transform: translateY(60px) translateX(-10px);
        opacity: 0;
    }
}

/* ============================================
   LEAVES ANIMATION (Thanksgiving)
   ============================================ */
.leaves-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.leaf {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    pointer-events: none;
    animation: leafFall linear infinite;
    background: #ff6b35;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

@keyframes leafFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(30px) translateX(10px) rotate(180deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(60px) translateX(-15px) rotate(360deg);
        opacity: 0;
    }
}

/* Ensure logo remains clickable */
.seasonal-animation-wrapper .logo-img {
    position: relative;
    z-index: 5;
}

/* ============================================
   SANTA HAT ON LOGO (Christmas)
   ============================================ */
.santa-hat-container {
    position: absolute;
    top: 9px;
    left: -2px;
    pointer-events: none;
    z-index: 25;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    transform: rotate(334deg);
}

.santa-hat-image {
    width: auto;
    height: auto;
    max-width: 30px;
    max-height: 30px;
    object-fit: contain;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .santa-container {
        bottom: -8px;
        right: -30px;
        width: 28px;
        height: 42px;
    }
    
    .santa-image {
        max-width: 28px;
    }
    
    .snowflake {
        width: 2px;
        height: 2px;
    }
    
    .snowflake::before,
    .snowflake::after {
        width: 2px;
        height: 2px;
    }
    
    .snowflake::before {
        transform: translateX(-1px);
    }
    
    .snowflake::after {
        transform: translateX(1px);
    }
    
    .heart,
    .confetti,
    .bat,
    .leaf {
        width: 6px;
        height: 6px;
    }
    
    .sparkle.golden-particle {
        width: 1.5px;
        height: 1.5px;
        box-shadow: 0 0 1.5px #FFD700, 0 0 3px rgba(255, 215, 0, 0.4);
    }
    
    .santa-hat-image {
        max-width: 24px;
        max-height: 24px;
    }
}
