@php
    $alumni_stories = App\Models\AlumniMember::take($alumni->alumni_members_count)->get();
@endphp

<!-- Swiper CSS -->


<div class="alumni-stories">
    <div class="alumni-stories-title">
        <h2>{{ $alumni->success_title }}</h2>
    </div>
    <div class="alumni-stories-slider-container">
        <div class="swiper alumni-stories-swiper">
            <div class="swiper-wrapper">
                @foreach($alumni_stories as $story)
                    <div class="swiper-slide alumni-story-slide">
                        <div class="alumni-story-inner">
                            <div class="alumni-story-photo">
                                <img src="{{ asset('storage/' . $story->alumni_photo) }}" alt="{{ $story->alumni_name }}">
                            </div>
                            <div class="alumni-story-info">
                                <div class="alumni-story-name">{{ $story->alumni_name }}</div>
                                <div class="alumni-story-company">{{ $story->company_name }}</div>
                                <div class="alumni-story-position">{{ $story->alumni_position }}</div>
                                <div class="alumni-story-quote-block">
                                    <div class="alumni-quote-marks">
                                        <span class="alumni-quote-icon">“</span>
                                        {{-- <span class="alumni-quote-icon">“</span> --}}
                                    </div>
                                    <div class="alumni-quote-text">
                                        {{ $story->alumni_description }}
                                        <span class="alumni-quote-icon alumni-quote-end">”</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
            <!-- Pagination and navigation -->
            <div class="swiper-pagination"></div>
            <div class="swiper-button-prev"></div>
            <div class="swiper-button-next"></div>
        </div>
    </div>
</div>

<!-- Swiper JS -->
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
<script>
    document.addEventListener('DOMContentLoaded', function () {
        new Swiper('.alumni-stories-swiper', {
            slidesPerView: 1,
            spaceBetween: 30,
            loop: true,
            pagination: {
                el: '.swiper-pagination',
                clickable: true,
            },
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
            // autoplay: {
            //     delay: 4000,
            //     disableOnInteraction: false,
            // },
        });
    });
</script>

<style>
.alumni-stories {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px auto;
    padding: 0 10px;
}
.alumni-stories-title {
    text-align: right;
    margin-bottom: 18px;
}
.alumni-stories-title h2 {
    color: #0a4977;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
}
.alumni-stories-slider-container {
    border-radius: 10px;
    padding: 40px 0 60px 0;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}
.alumni-story-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}
.alumni-story-inner {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}
.alumni-story-photo img {
    width: 320px;
    height: 340px;
    object-fit: cover;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}
.alumni-story-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0;
}
.alumni-story-name {
    font-size: 2rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 2px;
}
.alumni-story-company {
    font-size: 1rem;
    color: #888;
    margin-bottom: 2px;
}
.alumni-story-position {
    font-size: 1rem;
    color: #f58428;
    font-weight: 600;
    margin-bottom: 32px;
}
.alumni-story-quote-block {
    margin-top: 32px;
}
.alumni-quote-marks {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.alumni-quote-icon {
    color: #1e8dd2;
    font-size: 2.2rem;
    font-family: serif;
    font-weight: bold;
    line-height: 1;
}
.alumni-quote-end {
    margin-left: 4px;
    vertical-align: bottom;
}
.alumni-quote-text {
    color: #444;
    font-size: 1rem;
    line-height: 1.7;
    text-align: justify;
    margin-top: 0;
    margin-bottom: 0;
    max-width: 420px;
    position: relative;
    display: inline-block;
}
.swiper-button-next, .swiper-button-prev {
    color: #fff;
    background: #1e3f6e;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    transform: translateY(-50%);
}

.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 1rem;
    /* font-weight: bold; */
}
.swiper-pagination {
    position: relative;
    margin-top: 18px;
    text-align: center;
}
.swiper-pagination-bullet {
    background: #0a4977;
    opacity: 1;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px !important;
    transition: all 0.3s;
}
.swiper-pagination-bullet-active {
    width: 36px;
    height: 12px;
    border-radius: 8px;
    background: #0a4977;
}
/* Enhanced responsive styles */
@media (max-width: 1200px) {
    .alumni-stories {
        max-width: 850px;
        padding: 0 15px;
    }
    .alumni-stories-title h2 {
        font-size: 1.8rem;
    }
    .alumni-story-inner {
        gap: 40px;
        max-width: 750px;
    }
    .alumni-story-photo img {
        width: 280px;
        height: 300px;
    }
    .alumni-story-name {
        font-size: 1.8rem;
    }
    .alumni-quote-text {
        max-width: 380px;
    }
}

@media (max-width: 1100px) {
    .alumni-story-inner {
        gap: 24px;
    }
    .alumni-story-photo img {
        width: 220px;
        height: 240px;
    }
    .alumni-quote-text {
        max-width: 220px;
    }
    .swiper-button-prev, .swiper-button-next {
        left: 0;
        right: 0;
    }
    .alumni-story-name {
        font-size: 1.6rem;
    }
    .alumni-story-position {
        margin-bottom: 24px;
    }
    .alumni-story-quote-block {
        margin-top: 24px;
    }
}

@media (max-width: 900px) {
    .alumni-stories {
        max-width: 800px;
        padding: 0 12px;
    }
    .alumni-stories-title h2 {
        font-size: 1.6rem;
        letter-spacing: 1px;
    }
    .alumni-stories-slider-container {
        padding: 30px 0 50px 0;
    }
    .alumni-story-inner {
        gap: 20px;
    }
    .alumni-story-photo img {
        width: 200px;
        height: 220px;
    }
    .alumni-story-name {
        font-size: 1.4rem;
    }
    .alumni-story-company,
    .alumni-story-position {
        font-size: 0.9rem;
    }
    .alumni-quote-text {
        max-width: 200px;
        font-size: 0.9rem;
        line-height: 1.6;
    }
    .alumni-quote-icon {
        font-size: 1.8rem;
    }
}

@media (max-width: 700px) {
    .alumni-stories {
        padding: 0 10px;
        margin-bottom: 30px;
    }
    .alumni-stories-title {
        text-align: center;
        margin-bottom: 15px;
    }
    .alumni-stories-title h2 {
        font-size: 1.4rem;
    }
    .alumni-stories-slider-container {
        padding: 25px 0 40px 0;
    }
    .alumni-story-inner {
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }
    .alumni-story-photo img {
        width: 180px;
        height: 200px;
    }
    .alumni-story-info {
        align-items: center;
        text-align: center;
    }
    .alumni-quote-text {
        max-width: 98%;
        text-align: center;
    }
    .swiper-button-prev, .swiper-button-next {
        display: none;
    }
    .alumni-story-name {
        font-size: 1.3rem;
    }
    .alumni-story-position {
        margin-bottom: 20px;
    }
    .alumni-story-quote-block {
        margin-top: 20px;
    }
    .alumni-quote-icon {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .alumni-stories {
        padding: 0 8px;
        margin-bottom: 25px;
    }
    .alumni-stories-title h2 {
        font-size: 1.2rem;
        letter-spacing: 0.5px;
    }
    .alumni-stories-slider-container {
        padding: 20px 0 35px 0;
    }
    .alumni-story-inner {
        gap: 15px;
    }
    .alumni-story-photo img {
        width: 160px;
        height: 180px;
    }
    .alumni-story-name {
        font-size: 1.2rem;
    }
    .alumni-story-company,
    .alumni-story-position {
        font-size: 0.85rem;
    }
    .alumni-quote-text {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    .alumni-quote-icon {
        font-size: 1.4rem;
    }
    .swiper-pagination {
        margin-top: 15px;
    }
    .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        margin: 0 4px !important;
    }
    .swiper-pagination-bullet-active {
        width: 30px;
        height: 10px;
    }
}

@media (max-width: 360px) {
    .alumni-stories {
        padding: 0 6px;
        margin-bottom: 20px;
    }
    .alumni-stories-title h2 {
        font-size: 1.1rem;
    }
    .alumni-stories-slider-container {
        padding: 18px 0 30px 0;
    }
    .alumni-story-inner {
        gap: 12px;
    }
    .alumni-story-photo img {
        width: 140px;
        height: 160px;
    }
    .alumni-story-name {
        font-size: 1.1rem;
    }
    .alumni-story-company,
    .alumni-story-position {
        font-size: 0.8rem;
    }
    .alumni-quote-text {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    .alumni-quote-icon {
        font-size: 1.2rem;
    }
    .swiper-pagination {
        margin-top: 12px;
    }
    .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 3px !important;
    }
    .swiper-pagination-bullet-active {
        width: 24px;
        height: 8px;
    }
}
</style>
