/**
 * Custom Swiper.js Styling
 * Matches the existing Slick carousel appearance for seamless migration
 */

/* ================================
   Carousel Wrapper Styles
   Parent container that holds swiper and nav arrows
   ================================ */

.carousel-wrapper {
    position: relative;
    padding-left: 60px;
    padding-right: 60px;
}

/* Navigation arrows positioned relative to wrapper */
.carousel-wrapper>.swiper-button-prev,
.carousel-wrapper>.swiper-button-next {
    position: absolute;
    width: 48px;
    height: 48px;
    background: transparent;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    margin-top: -25px;
    /* Offset for pagination area */
    cursor: pointer;
}

.carousel-wrapper>.swiper-button-prev::after,
.carousel-wrapper>.swiper-button-next::after {
    content: '' !important;
    display: none;
}

.carousel-wrapper>.swiper-button-prev {
    left: 5px;
    background: url('/images/arrow-carousel-prev.png') no-repeat center center;
    background-size: contain;
}

.carousel-wrapper>.swiper-button-next {
    right: 5px;
    background: url('/images/arrow-carousel-next.png') no-repeat center center;
    background-size: contain;
}

/* ================================
   Swiper Container Styles
   ================================ */

.swiper {
    width: 100%;
    padding-bottom: 50px;
    /* Space for pagination dots */
    overflow: hidden;
    position: relative;
}

.swiper-wrapper {
    display: flex;
    align-items: stretch;
}

/* ================================
   Fallback Navigation Arrow Styles
   For swipers without carousel-wrapper
   ================================ */

.swiper>.swiper-button-prev,
.swiper>.swiper-button-next {
    width: 48px;
    height: 48px;
    background: transparent;
    z-index: 10 !important;
    top: 50%;
    transform: translateY(-50%);
    margin-top: -25px;
}

.swiper>.swiper-button-prev::after,
.swiper>.swiper-button-next::after {
    content: '' !important;
    display: none;
}

.swiper>.swiper-button-prev {
    left: 10px;
    background: url('/images/arrow-carousel-prev.png') no-repeat center center;
    background-size: contain;
}

.swiper>.swiper-button-next {
    right: 10px;
    background: url('/images/arrow-carousel-next.png') no-repeat center center;
    background-size: contain;
}

/* ================================
   Pagination Dots Styles
   Matching Slick dots exactly
   ================================ */

.swiper-pagination {
    bottom: 0 !important;
    position: relative !important;
    margin-top: 20px;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    margin: 0 5px !important;
    background-color: #d9e4ef !important;
    opacity: 1 !important;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.swiper-pagination-bullet:hover,
.swiper-pagination-bullet:focus {
    background-color: #b8cbdc !important;
}

.swiper-pagination-bullet-active {
    background-color: #99bcdd !important;
}

/* ================================
   Slide Styles
   ================================ */

.swiper-slide {
    height: auto !important;
    box-sizing: border-box;
    margin: 0 10px;
    opacity: 1 !important;
    display: flex !important;
    flex-direction: column;
}

/* Override init-opacity-zero for swiper slides to ensure visibility */
.swiper-slide.init-opacity-zero,
.swiper-slide .init-opacity-zero,
.swiper-slide.card.init-opacity-zero {
    opacity: 1 !important;
}

/* ================================
   Freshers Slider Specific
   ================================ */

.freshers-swiper {
    position: relative;
}

.freshers-swiper .swiper-wrapper {
    padding-top: 30px;
    padding-bottom: 30px;
}

.freshers-swiper .swiper-slide {
    display: flex !important;
    flex-direction: column;
}

.freshers-swiper .swiper-slide.card {
    border: none;
    background: transparent;
}

.freshers-swiper .card-img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.freshers-swiper .card-img img {
    border-radius: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.freshers-swiper .card-img-overlay {
    position: static;
    text-align: center;
}

/* ================================
   Squad Advantages Slider Specific
   ================================ */

.squad-advantages-swiper {
    position: relative;
}

.squad-advantages-swiper .swiper-slide {
    display: flex !important;
}

.squad-advantages-swiper .swiper-slide.card {
    border: none;
    background: transparent;
}

/* ================================
   YouTube Training Videos Slider
   ================================ */

.yt-training-swiper {
    padding-left: 60px;
    padding-right: 60px;
    position: relative;
}

.yt-training-swiper .swiper-slide {
    display: inline-block;
}

.yt-training-swiper .video-embed {
    display: flex;
    flex-direction: column;
    position: relative;
    margin-bottom: 10px;
}

.yt-training-swiper iframe {
    width: 100%;
    border-radius: 6px;
    aspect-ratio: 16/9;
}

.yt-training-swiper .video-caption {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 0;
    display: block;
    clear: both;
    width: 100%;
}

/* ================================
   Testimonials Slider Specific
   ================================ */

.testimonials-swiper {
    padding-left: 60px;
    padding-right: 60px;
    position: relative;
}

.testimonials-swiper .swiper-slide {
    display: flex !important;
}

.testimonials-swiper .testimonial-slide {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    height: 100%;
}

/* ================================
   Responsive Adjustments
   ================================ */

@media (max-width: 800px) {

    .swiper-button-prev,
    .swiper-button-next {
        display: none;
    }

    /* Remove all padding on mobile to prevent clipping */
    .freshers-swiper,
    .squad-advantages-swiper,
    .yt-training-swiper,
    .testimonials-swiper {
        padding-left: 0;
        padding-right: 0;
    }

    /* Remove margin on slides for mobile */
    .swiper-slide {
        margin: 0 !important;
    }

    /* Ensure testimonial slides take full width on mobile */
    .testimonials-swiper .swiper-slide {
        width: 100% !important;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .testimonials-swiper .testimonial-slide {
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* Remove container padding on mobile for testimonials */
    .testimonials-swiper {
        width: 100%;
        max-width: 100%;
    }

    /* Freshers carousel mobile fix */
    .freshers-swiper .swiper-slide {
        width: 100% !important;
        padding: 0 10px;
    }

    .freshers-swiper .swiper-wrapper {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    /* Squad advantages mobile fix */
    .squad-advantages-swiper .swiper-slide {
        width: 100% !important;
        padding: 0 10px;
    }

    /* YouTube training videos mobile fix */
    .yt-training-swiper .swiper-slide {
        width: 100% !important;
        padding: 0 10px;
    }

    /* Reduce pagination dot sizes on mobile */
    .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 3px !important;
    }
}

/* ================================
   Override Slick CSS conflicts
   The existing .slider class should work with Swiper
   ================================ */

.slider.swiper {
    position: relative;
    width: 100%;
    margin: 2rem auto;
    margin-bottom: 0;
}