@extends('layouts.app')

@section('title', 'International Study Destinations - LECL')
@section('description',
    'Explore world-class education opportunities across our partner countries. Discover the best
    universities and programs in UK, Australia, Canada, and USA.')

@section('content')
    <!-- Hero Section -->
    <section class="hero-section position-relative overflow-hidden"
        style="background: linear-gradient(135deg, #1e293b 0%, #334155 25%, #4f46e5 75%, #7c3aed 100%); min-height: 80vh; display: flex; align-items: center; justify-content: center;">

        <!-- Animated Background Elements -->
        <div class="floating-shapes">
            <div class="shape shape-1"></div>
            <div class="shape shape-2"></div>
            <div class="shape shape-3"></div>
            <div class="shape shape-4"></div>
            <div class="shape shape-5"></div>
        </div>

        <!-- Animated Particles -->
        <div class="particles">
            <div class="particle"></div>
            <div class="particle"></div>
            <div class="particle"></div>
            <div class="particle"></div>
            <div class="particle"></div>
            <div class="particle"></div>
        </div>

        <!-- Gradient Overlay -->
        <div class="position-absolute top-0 start-0 w-100 h-100"
            style="background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 50%), radial-gradient(circle at 70% 80%, rgba(59, 130, 246, 0.3) 0%, transparent 50%);">
        </div>

        <div class="container position-relative text-center text-white">
            <div class="row justify-content-center">
                <div class="col-lg-8">
                    <h1 class="display-3 fw-bold mb-4 fade-in">{{ $destinationsSection->title ?? 'Study Destinations' }}
                    </h1>
                    <p class="lead mb-4 fade-in">
                        {{ $destinationsSection->content ?? 'Explore world-class education opportunities across our partner countries.' }}
                    </p>
                    {{-- <div class="fade-in">
                        <a href="#destinations" class="btn btn-light btn-lg px-4 me-3">Explore Countries</a>
                        <a href="{{ route('contact') }}" class="btn btn-outline-light btn-lg px-4">Get Guidance</a>
                    </div> --}}
                </div>
            </div>
        </div>
    </section>
    <!-- Study Destinations Section -->
    <section id="destinations" class="py-5 section-animate mt-5">
        <div class="container">
            <div class="text-center mb-5 fade-in">
                <h2 class="display-5 fw-bold mb-3 section-title">Choose Your Study Destination</h2>
                <p class="lead text-muted mb-4">Discover the perfect country for your educational journey</p>
            </div>

            @if ($destinations && $destinations->count() > 0)
                <div class="row">
                    @foreach ($destinations as $index => $destination)
                        <div class="col-lg-6 col-xl-3 mb-4 slide-up stagger-{{ $index + 1 }}">
                            <div class="destination-card-glass h-100">
                                <div class="card-inner">
                                    <!-- Decorative Background -->
                                    <div class="card-bg-pattern"></div>

                                    <!-- Country Flag -->
                                    <div class="flag-container mb-4">
                                        <div class="country-flag-modern">
                                            <span class="flag-emoji">{{ $destination->flag }}</span>
                                            <div class="flag-glow"></div>
                                        </div>
                                    </div>

                                    <!-- Country Name -->
                                    <h4 class="country-name mb-3">{{ $destination->name }}</h4>

                                    <!-- Universities Count -->
                                    <div class="university-badge mb-4">
                                        <div class="badge-content">
                                            <i class="bi bi-mortarboard badge-icon"></i>
                                            <span class="badge-text">{{ $destination->universities_count }}+
                                                Universities</span>
                                        </div>
                                    </div>

                                    <!-- Description -->
                                    <p class="country-description mb-4">{{ $destination->description }}</p>

                                    <!-- Action Buttons -->
                                    <div class="action-buttons">
                                        <a href="{{ route('contact') }}"style="z-index:9999999999"
                                            class="btn-modern btn-primary-modern">
                                            <span class="btn-text">Get Guidance</span>
                                            <i class="bi bi-arrow-right btn-icon"></i>
                                        </a>
                                    </div>
                                </div>

                                <!-- Magical Hover Effects -->
                                <div class="magic-border"></div>
                                <div class="shine-effect"></div>
                            </div>
                        </div>
                    @endforeach
                </div>
            @else
                <div class="text-center py-5">
                    <i class="bi bi-globe text-muted" style="font-size: 4rem;"></i>
                    <h4 class="text-muted mt-3">No destinations available at the moment</h4>
                    <p class="text-muted">Please check back later or contact us for more information.</p>
                </div>
            @endif
        </div>
    </section>

    <!-- Why Choose International Education Section -->
    <section class="py-5 why-choose-section section-animate">
        <div class="container">
            <div class="text-center mb-5 fade-in">
                <h2 class="section-title-modern fw-bold mb-3">Why Study Internationally?</h2>
                <p class="lead section-subtitle">Unlock global opportunities and transform your future</p>
            </div>

            <div class="row">
                <div class="col-lg-4 mb-4 slide-up stagger-1">
                    <div class="why-choose-card-modern text-center h-100">
                        <div class="card-inner-modern">
                            <div class="icon-circle-modern mb-4">
                                <i class="bi bi-globe"></i>
                                <div class="icon-bg-effect"></div>
                            </div>
                            <h5 class="card-title-modern mb-3">Global Perspective</h5>
                            <p class="card-description">Gain international exposure and develop a global mindset that
                                employers value.</p>
                            <div class="card-accent"></div>
                        </div>
                        <div class="card-glow"></div>
                    </div>
                </div>

                <div class="col-lg-4 mb-4 slide-up stagger-2">
                    <div class="why-choose-card-modern text-center h-100">
                        <div class="card-inner-modern">
                            <div class="icon-circle-modern mb-4">
                                <i class="bi bi-award"></i>
                                <div class="icon-bg-effect"></div>
                            </div>
                            <h5 class="card-title-modern mb-3">World-Class Education</h5>
                            <p class="card-description">Access top-ranked universities and cutting-edge research facilities
                                worldwide.</p>
                            <div class="card-accent"></div>
                        </div>
                        <div class="card-glow"></div>
                    </div>
                </div>

                <div class="col-lg-4 mb-4 slide-up stagger-3">
                    <div class="why-choose-card-modern text-center h-100">
                        <div class="card-inner-modern">
                            <div class="icon-circle-modern mb-4">
                                <i class="bi bi-people"></i>
                                <div class="icon-bg-effect"></div>
                            </div>
                            <h5 class="card-title-modern mb-3">Cultural Diversity</h5>
                            <p class="card-description">Experience diverse cultures and build an international network of
                                connections.</p>
                            <div class="card-accent"></div>
                        </div>
                        <div class="card-glow"></div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Call to Action Section -->
    <section class="cta-section py-5 text-white text-center">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="cta-content fade-in">
                        <h2 class="display-5 fw-bold mb-4">Ready to Start Your International Journey?</h2>
                        <p class="lead mb-5">Let our expert counselors guide you through every step of your study abroad
                            adventure.</p>
                        <a href="{{ route('contact') }}" class="btn-cta-modern">
                            <i class="bi bi-rocket-takeoff"></i>
                            <span>Get Free Consultation</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>

        <!-- Floating Elements -->
        <div class="cta-floating-elements">
            <div class="floating-element" style="top: 20%; left: 10%; animation-delay: 0s;"></div>
            <div class="floating-element" style="top: 60%; right: 15%; animation-delay: 2s;"></div>
            <div class="floating-element" style="bottom: 30%; left: 20%; animation-delay: 4s;"></div>
        </div>
    </section>
@endsection

@push('styles')
    <style>
        :root {
            --primary-blue: #4a6cf7;
            --secondary-blue: #3b82f6;
            --accent-gold: #f59e0b;
            --text-dark: #1e293b;
            --text-light: #64748b;
            --bg-light: #f8fafc;
        }

        /* Modern Glassmorphism Destination Cards */
        .destination-card-glass {
            position: relative;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 24px;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
        }

        .destination-card-glass:hover {
            transform: translateY(-12px) scale(1.02);
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.3);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
        }

        .card-inner {
            position: relative;
            padding: 2rem;
            text-align: center;
            z-index: 2;
        }

        .card-bg-pattern {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at 20% 20%, rgba(74, 108, 247, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
            z-index: 1;
        }

        .flag-container {
            position: relative;
            display: flex;
            justify-content: center;
        }

        .country-flag-modern {
            position: relative;
            width: 90px;
            height: 90px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }

        .destination-card-glass:hover .country-flag-modern {
            transform: scale(1.1) rotate(5deg);
            border-color: rgba(74, 108, 247, 0.5);
        }

        .flag-emoji {
            font-size: 2.5rem;
            position: relative;
            z-index: 2;
        }

        .flag-glow {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100%;
            height: 100%;
            background: radial-gradient(circle, rgba(74, 108, 247, 0.3) 0%, transparent 70%);
            border-radius: 50%;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .destination-card-glass:hover .flag-glow {
            opacity: 1;
        }

        .country-name {
            font-weight: 700;
            font-size: 1.5rem;
            background: linear-gradient(135deg, #1e293b 0%, #4a6cf7 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 1rem;
        }

        .university-badge {
            display: flex;
            justify-content: center;
        }

        .badge-content {
            display: inline-flex;
            align-items: center;
            padding: 0.75rem 1.5rem;
            background: linear-gradient(135deg, rgba(74, 108, 247, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
            border: 1px solid rgba(74, 108, 247, 0.2);
            border-radius: 50px;
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }

        .destination-card-glass:hover .badge-content {
            background: linear-gradient(135deg, rgba(74, 108, 247, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
            border-color: rgba(74, 108, 247, 0.4);
            transform: scale(1.05);
        }

        .badge-icon {
            color: #4a6cf7;
            margin-right: 0.5rem;
            font-size: 1.1rem;
        }

        .badge-text {
            font-weight: 600;
            color: #1e293b;
            font-size: 0.9rem;
        }

        .country-description {
            color: #64748b;
            line-height: 1.6;
            font-size: 0.95rem;
        }

        .action-buttons {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .btn-modern {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.875rem 1.5rem;
            border-radius: 12px;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            border: none;
            font-size: 0.9rem;
        }

        .btn-primary-modern {
            background: linear-gradient(135deg, #4a6cf7 0%, #3b82f6 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(74, 108, 247, 0.3);
        }

        .btn-primary-modern:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(74, 108, 247, 0.4);
            color: white;
        }

        .btn-secondary-modern {
            background: rgba(255, 255, 255, 0.1);
            color: #1e293b;
            border: 1px solid rgba(74, 108, 247, 0.2);
            backdrop-filter: blur(10px);
        }

        .btn-secondary-modern:hover {
            background: rgba(74, 108, 247, 0.1);
            border-color: rgba(74, 108, 247, 0.4);
            transform: translateY(-2px);
            color: #4a6cf7;
        }

        .btn-text {
            margin-right: 0.5rem;
        }

        .btn-icon {
            font-size: 0.9rem;
            transition: transform 0.3s ease;
        }

        .btn-modern:hover .btn-icon {
            transform: translateX(3px);
        }

        .magic-border {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 24px;
            padding: 1px;
            background: linear-gradient(45deg, transparent, rgba(74, 108, 247, 0.5), transparent);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .destination-card-glass:hover .magic-border {
            opacity: 1;
            animation: borderRotate 2s linear infinite;
        }

        @keyframes borderRotate {
            0% {
                background: linear-gradient(45deg, transparent, rgba(74, 108, 247, 0.5), transparent);
            }

            25% {
                background: linear-gradient(135deg, transparent, rgba(59, 130, 246, 0.5), transparent);
            }

            50% {
                background: linear-gradient(225deg, transparent, rgba(74, 108, 247, 0.5), transparent);
            }

            75% {
                background: linear-gradient(315deg, transparent, rgba(59, 130, 246, 0.5), transparent);
            }

            100% {
                background: linear-gradient(45deg, transparent, rgba(74, 108, 247, 0.5), transparent);
            }
        }

        .shine-effect {
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.6s ease;
        }

        .destination-card-glass:hover .shine-effect {
            left: 100%;
        }

        /* Why Choose Section Styles */
        .why-choose-section {
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            position: relative;
            overflow: hidden;
        }

        .why-choose-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at 30% 20%, rgba(74, 108, 247, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
        }

        .section-title-modern {
            font-size: 2.5rem;
            background: linear-gradient(135deg, #1e293b 0%, #4a6cf7 50%, #3b82f6 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            position: relative;
        }

        .section-subtitle {
            color: #64748b;
            font-size: 1.2rem;
            font-weight: 400;
        }

        .why-choose-card-modern {
            position: relative;
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 20px;
            padding: 2.5rem 2rem;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            z-index: 2;
        }

        .why-choose-card-modern:hover {
            transform: translateY(-8px) scale(1.02);
            background: rgba(255, 255, 255, 0.9);
            border-color: rgba(74, 108, 247, 0.3);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(74, 108, 247, 0.1);
        }

        .card-inner-modern {
            position: relative;
            z-index: 2;
        }

        .icon-circle-modern {
            position: relative;
            width: 80px;
            height: 80px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #4a6cf7 0%, #3b82f6 100%);
            border-radius: 50%;
            color: white;
            font-size: 1.8rem;
            transition: all 0.3s ease;
            overflow: hidden;
        }

        .why-choose-card-modern:hover .icon-circle-modern {
            transform: scale(1.1) rotate(10deg);
            box-shadow: 0 10px 25px rgba(74, 108, 247, 0.4);
        }

        .icon-bg-effect {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .why-choose-card-modern:hover .icon-bg-effect {
            opacity: 1;
        }

        .card-title-modern {
            font-weight: 700;
            font-size: 1.3rem;
            color: #1e293b;
            margin-bottom: 1rem;
        }

        .card-description {
            color: #64748b;
            line-height: 1.6;
            font-size: 0.95rem;
        }

        .card-accent {
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 3px;
            background: linear-gradient(90deg, #4a6cf7, #3b82f6);
            border-radius: 2px;
            transition: width 0.3s ease;
        }

        .why-choose-card-modern:hover .card-accent {
            width: 60px;
        }

        .card-glow {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at center, rgba(74, 108, 247, 0.1) 0%, transparent 70%);
            opacity: 0;
            transition: opacity 0.3s ease;
            border-radius: 20px;
        }

        .why-choose-card-modern:hover .card-glow {
            opacity: 1;
        }

        /* Enhanced CTA Section */
        .cta-section {
            background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
            position: relative;
            overflow: hidden;
        }

        .cta-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
        }

        .cta-content {
            position: relative;
            z-index: 3;
        }

        .btn-cta-modern {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            border: none;
            padding: 1rem 2.5rem;
            border-radius: 50px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            color: white;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 1.1rem;
        }

        .btn-cta-modern:hover {
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 15px 35px rgba(245, 158, 11, 0.4);
            color: white;
        }

        .btn-cta-modern::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.6s ease;
        }

        .btn-cta-modern:hover::before {
            left: 100%;
        }

        .cta-floating-elements {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            pointer-events: none;
            z-index: 1;
        }

        .floating-element {
            position: absolute;
            width: 60px;
            height: 60px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            animation: floatCTA 8s ease-in-out infinite;
        }

        @keyframes floatCTA {

            0%,
            100% {
                transform: translateY(0px) rotate(0deg);
                opacity: 0.7;
            }

            50% {
                transform: translateY(-30px) rotate(180deg);
                opacity: 1;
            }
        }

        .fade-in {
            opacity: 0;
            transform: translateY(30px);
            transition: all 0.6s ease;
        }

        .fade-in.revealed {
            opacity: 1;
            transform: translateY(0);
        }

        .slide-up {
            opacity: 0;
            transform: translateY(50px);
            transition: all 0.6s ease;
        }

        .slide-up.revealed {
            opacity: 1;
            transform: translateY(0);
        }

        .stagger-1 {
            transition-delay: 0.1s;
        }

        .stagger-2 {
            transition-delay: 0.2s;
        }

        .stagger-3 {
            transition-delay: 0.3s;
        }

        .stagger-4 {
            transition-delay: 0.4s;
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .destination-card-glass {
                margin-bottom: 1.5rem;
            }

            .section-title-modern {
                font-size: 2rem;
            }

            .btn-cta-modern {
                padding: 0.875rem 2rem;
                font-size: 1rem;
            }
        }
    </style>
@endpush

@push('scripts')
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Intersection Observer for animations
            const observerOptions = {
                threshold: 0.1,
                rootMargin: '0px 0px -50px 0px'
            };

            const observer = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        entry.target.classList.add('revealed');
                    }
                });
            }, observerOptions);

            // Observe all animated elements
            document.querySelectorAll('.fade-in, .slide-up').forEach(el => {
                observer.observe(el);
            });

            // Smooth scrolling for anchor links
            document.querySelectorAll('a[href^="#"]').forEach(anchor => {
                anchor.addEventListener('click', function(e) {
                    e.preventDefault();
                    const target = document.querySelector(this.getAttribute('href'));
                    if (target) {
                        target.scrollIntoView({
                            behavior: 'smooth',
                            block: 'start'
                        });
                    }
                });
            });
        });
    </script>
@endpush
