/*
===========================================
HOMEPAGE ANIMATIONS - OPTIMIZED FOR SPEED
===========================================
*/

/* ========== SCROLL ANIMATIONS ========== */

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale up animation */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations to sections */
.animate-on-scroll {
    opacity: 0;
    animation-duration: 0.4s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out;
}

.animate-on-scroll.animated {
    animation-name: fadeInUp;
}

/* ========== SECTION ANIMATIONS ========== */

/* Advantages cards - NO ANIMATION for first section */
.col_advantage_outer {
    opacity: 1;
}

.col_advantage_inner_border {
    position: relative;
}

/* ========== GAME CARDS ANIMATIONS ========== */

/* Fix for game cards container to prevent cropping on hover */
.container_our_games,
.row_our_games,
.home_section_our_games {
    overflow: visible !important;
}

.container_our_games .row {
    padding-top: 25px !important;
    padding-bottom: 25px !important;
    overflow: visible !important;
}

/* Add spacing to individual game card columns */
.container_our_games .col-xl-2,
.container_our_games .col-lg-3,
.container_our_games .col-md-4,
.container_our_games .col-sm-6 {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    overflow: visible !important;
}

/* Enhanced game card hover with floating effect */
.game-card-wrapper {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 10px;
    margin-bottom: 10px;
    will-change: transform; /* Hint to browser for optimization */
}

.game-card-wrapper:hover {
    transform: translateY(-10px);
    z-index: 10;
}

.game-card-wrapper:hover .img_our_games {
    box-shadow: 0 15px 35px rgba(131, 61, 197, 0.4);
}

/* Game cards fade in with stagger */
.container_our_games .col-xl-2,
.container_our_games .col-lg-3,
.container_our_games .col-md-4 {
    opacity: 0;
    animation: scaleUp 0.4s ease-out forwards;
}

.container_our_games .col-xl-2:nth-child(1),
.container_our_games .col-lg-3:nth-child(1),
.container_our_games .col-md-4:nth-child(1) { animation-delay: 0s; }
.container_our_games .col-xl-2:nth-child(2),
.container_our_games .col-lg-3:nth-child(2),
.container_our_games .col-md-4:nth-child(2) { animation-delay: 0.05s; }
.container_our_games .col-xl-2:nth-child(3),
.container_our_games .col-lg-3:nth-child(3),
.container_our_games .col-md-4:nth-child(3) { animation-delay: 0.1s; }
.container_our_games .col-xl-2:nth-child(4),
.container_our_games .col-lg-3:nth-child(4),
.container_our_games .col-md-4:nth-child(4) { animation-delay: 0.15s; }
.container_our_games .col-xl-2:nth-child(5),
.container_our_games .col-lg-3:nth-child(5),
.container_our_games .col-md-4:nth-child(5) { animation-delay: 0.2s; }
.container_our_games .col-xl-2:nth-child(6),
.container_our_games .col-lg-3:nth-child(6),
.container_our_games .col-md-4:nth-child(6) { animation-delay: 0.25s; }

/* ========== DECORATIVE COINS ANIMATION ========== */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.img_deco_coin {
    animation: float 5s ease-in-out infinite;
    will-change: transform; /* Hint to browser for optimization */
}

/* ========== NEWS CARDS ANIMATIONS ========== */

.home_section_latest_news .col_news {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home_section_latest_news .col-xl-4:nth-child(1) .col_news { animation-delay: 0s; }
.home_section_latest_news .col-xl-4:nth-child(2) .col_news { animation-delay: 0.1s; }
.home_section_latest_news .col-xl-4:nth-child(3) .col_news { animation-delay: 0.2s; }

.col_news {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform; /* Hint to browser for optimization */
}

.col_news:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(131, 61, 197, 0.2);
}

/* ========== BENEFITS TABLE ANIMATION ========== */

.div_benefits_table {
    overflow-x: auto;
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
    animation-delay: 0.2s;
}

/* ========== BUTTONS ANIMATION ========== */

.button_more_provider,
#button_more_provider,
.button_contact {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.button_more_provider:hover,
#button_more_provider:hover,
.button_contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(131, 61, 197, 0.4);
}

/* ========== HEADLINES ANIMATIONS ========== */

.page-section h1,
.page-section h2,
.page-section h3 {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
}

.page-section .text_violette {
    animation-delay: 0s;
}

.page-section .text_bold {
    animation-delay: 0.1s;
}

/* ========== PROVIDER LOGOS ANIMATION ========== */

.img_home_providers {
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
    filter: grayscale(20%);
    will-change: transform, opacity; /* Hint to browser for optimization */
}

.img_home_providers:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.1);
}

/* ========== SMOOTH SCROLLING ========== */

html {
    scroll-behavior: smooth;
}

/* ========== PRODUCTS IMAGES ANIMATION ========== */

.img_our_games {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

/* ========== MOBILE OPTIMIZATIONS ========== */

@media screen and (max-width: 767px) {
    /* Reduce animation intensity on mobile */
    .game-card-wrapper:hover {
        transform: translateY(-5px);
    }

    .col_news:hover {
        transform: translateY(-3px);
    }

    .img_deco_coin {
        animation-duration: 6s;
    }
}

/* ========== CONTACT SECTION ========== */

.home_section_contact {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
    animation-delay: 0.3s;
}

/* ========== SUBPAGE NEWS - NO FADE IN ========== */

.subpage_news_posts .col_news,
.b2b_news .col_news,
.subpage_news_posts .vce-posts-grid-item,
.b2b_news .vce-posts-grid-item {
    opacity: 1 !important;
    animation: none !important;
}

.subpage_news_posts .vce-post-description:hover,
.b2b_news .vce-post-description:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(131, 61, 197, 0.15);
}

.subpage_news_posts img,
.b2b_news img {
    transition: none;
}

.subpage_news_posts .col_news:hover img,
.b2b_news .col_news:hover img,
.subpage_news_posts .vce-post-description:hover img,
.b2b_news .vce-post-description:hover img {
    transform: none !important;
}
