/* Better preloader and page transitions */
body {
    opacity: 0;
    transition: opacity 0.8s ease-in;
    visibility: hidden; /* Ensure content is not visible during loading */
}

body.content-loaded {
    opacity: 1;
    visibility: visible; /* Make content visible after loading */
}

/* Prevent FOUC (Flash of Unstyled Content) during page load */
.preloader ~ * {
    visibility: hidden;
}

body.content-loaded .preloader ~ * {
    visibility: visible;
}

/* Additional animation for smoother fade-in */
.fade-in-soft {
    animation: fadeInSoft 0.8s ease-in-out forwards;
    opacity: 0;
}

@keyframes fadeInSoft {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Carousel padding and styling optimization */
.banner-section {
    background-color: var(--dark-color);
    padding: 20px 40px;
    margin-top: 15px;
    position: relative;
}

/* Add a subtle gradient background to the banner section */
.banner-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(30, 44, 58, 0.6) 0%, var(--dark-color) 70%);
    z-index: -1;
}

/* Optimize the swiper container */
.banner-section .swiper {
    overflow: visible;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Prevent content jumps during transitions */
.banner-section .swiper-wrapper {
    transition-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
}

/* Style the carousel slides */
.banner-section .swiper-slide {
    border-radius: 12px;
    overflow: hidden;
    transform: scale(0.98);
    transition: all 0.7s ease-out;
    opacity: 0.7;
}

.banner-section .swiper-slide-active {
    transform: scale(1);
    opacity: 1;
    transition: all 0.7s ease-out;
}

/* Enhance the gradient overlay on slides */
.banner-section .banner-item::before {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.2) 100%);
}

/* Hide navigation arrows */
.banner-section .swiper-button-next,
.banner-section .swiper-button-prev {
    display: none;
}

/* Enhanced pagination bullets */
.banner-section .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.banner-section .swiper-pagination-bullet-active {
    background-color: var(--primary-color);
    width: 20px;
    border-radius: 5px;
}

/* Responsive styles for banner carousel */
@media (max-width: 767px) {
    .banner-section {
        padding: 15px 25px;
    }
    
    .banner-section .banner-content h1,
    .banner-section .banner-content h2 {
        font-size: 1.8rem;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .banner-section {
        padding: 20px 30px;
    }
}

@media (min-width: 992px) {
    .banner-section {
        padding: 25px 50px;
    }
}

/* Game carousel enhanced styling */
.games-section {
    background-color: var(--dark-color);
    padding: 20px 40px;
    margin-top: 30px;
}

.games-swiper {
    overflow: visible;
    padding: 15px 0;
}

.games-swiper .swiper-slide {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    margin: 0 10px;
}

.games-swiper .swiper-slide:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Add a subtle glow effect on hover */
.games-swiper .game-item:hover {
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.3);
}

/* Game item image enhancement */
.games-swiper .game-item img {
    transition: transform 0.5s ease;
}

.games-swiper .game-item:hover img {
    transform: scale(1.05);
}

/* Enhanced game play button */
.games-swiper .game-play-btn {
    background-color: var(--primary-color);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.games-swiper .game-item:hover .game-play-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive styles for games carousel */
@media (max-width: 767px) {
    .games-section {
        padding: 15px 25px;
    }
    
    .games-swiper .swiper-slide {
        margin: 0 8px;
    }
    
    /* Reduce hover effects on mobile for better performance */
    .games-swiper .swiper-slide:hover {
        transform: translateY(-5px);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .games-section {
        padding: 20px 30px;
    }
    
    .games-swiper .swiper-slide {
        margin: 0 12px;
    }
}

@media (min-width: 992px) {
    .games-section {
        padding: 25px 50px;
    }
    
    .games-swiper .swiper-slide {
        margin: 0 15px;
    }
}

/* Clean up any conflicting styles by adding higher specificity */
.banner-section .banner-item {
    border-radius: 12px;
    position: relative;
}

.games-section .game-item {
    position: relative;
    height: 100%;
    border-radius: 12px;
}

/* Add subtle animations to content */
.banner-content {
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

.banner-content.animated {
    opacity: 1;
}

.banner-content h1,
.banner-content h2,
.banner-content p,
.banner-content .btn {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.7s ease-out;
}

.banner-content.animated h1,
.banner-content.animated h2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.banner-content.animated p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.banner-content.animated .btn {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}
