@extends(get_theme().'.layouts')

@section('content')
    {{-- Movie Popular --}}
    <div class="card mb-3">
        <div class="card-header">
            <h5 class="card-title m-0">{{ __('section.title.popular') }}</h5>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach (block_id_lists($movie_popular->results) as $item)
                    <div class="col-md-3 mb-3">
                        <div class="media position-relative">
                            <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->title }}" title="Image {{ $item->title }} ({{ to_year($item->release_date ?? '') }})">
                            <div class="media-body">
                                <a href="{{ mopie_route('movie.single',['id' => $item->id, 'slug' => str_slug($item->original_title)]) }}" rel="bookmark" title="{{ $item->title }} ({{ to_year($item->release_date ?? '') }})" class="stretched-link">
                                    <h2 class="card-title h6 m-1">{{ $item->title }}</h2>
                                </a>
                                <p class="small text-secondary">{{ $item->release_date ?? '' }}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    {{-- Movie Now Playing --}}
    <div class="card mb-3">
        <div class="card-header">
            <h5 class="card-title m-0">{{ __('section.title.now_playing') }}</h5>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach (block_id_lists($movie_now_playing->results) as $item)
                    <div class="col-md-3 mb-3">
                        <div class="media position-relative">
                            <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->title }}" title="Image {{ $item->title }} ({{ to_year($item->release_date ?? '') }})">
                            <div class="media-body">
                                <a href="{{ mopie_route('movie.single',['id' => $item->id, 'slug' => str_slug($item->original_title)]) }}" rel="bookmark" title="{{ $item->title }} ({{ to_year($item->release_date ?? '') }})" class="stretched-link">
                                    <h2 class="card-title h6 m-1">{{ $item->title }}</h2>
                                </a>
                                <p class="small text-secondary">{{ $item->release_date ?? '' }}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    {{-- Movie Upcoming --}}
    <div class="card mb-3">
        <div class="card-header">
            <h5 class="card-title m-0">{{ __('section.title.movie_upcoming') }}</h5>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach (block_id_lists($movie_upcoming->results) as $item)
                    <div class="col-md-3 mb-3">
                        <div class="media position-relative">
                            <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->title }}" title="Image {{ $item->title }} ({{ to_year($item->release_date ?? '') }})">
                            <div class="media-body">
                                <a href="{{ mopie_route('movie.single',['id' => $item->id, 'slug' => str_slug($item->original_title)]) }}" rel="bookmark" title="{{ $item->title }} ({{ to_year($item->release_date ?? '') }})" class="stretched-link">
                                    <h2 class="card-title h6 m-1">{{ $item->title }}</h2>
                                </a>
                                <p class="small text-secondary">{{ $item->release_date ?? '' }}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    {{-- Movie Top Rated --}}
    <div class="card mb-3">
        <div class="card-header">
            <h5 class="card-title m-0">{{ __('section.title.movie_top_rated') }}</h5>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach (block_id_lists($movie_top_rated->results) as $item)
                    <div class="col-md-3 mb-3">
                        <div class="media position-relative">
                            <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->title }}" title="Image {{ $item->title }} ({{ to_year($item->release_date ?? '') }})">
                            <div class="media-body">
                                <a href="{{ mopie_route('movie.single',['id' => $item->id, 'slug' => str_slug($item->original_title)]) }}" rel="bookmark" title="{{ $item->title }} ({{ to_year($item->release_date ?? '') }})" class="stretched-link">
                                    <h2 class="card-title h6 m-1">{{ $item->title }}</h2>
                                </a>
                                <p class="small text-secondary">{{ $item->release_date ?? '' }}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    {{-- TV Popular --}}
    <div class="card mb-3">
        <div class="card-header">
            <h5 class="card-title m-0">{{ __('section.title.tv_popular') }}</h5>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach (block_id_lists($tv_popular->results) as $item)
                    <div class="col-md-3 mb-3">
                        <div class="media position-relative">
                            <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->name }}" title="Image {{ $item->name }} ({{ to_year($item->first_air_date ?? '') }})">
                            <div class="media-body">
                                <a href="{{ mopie_route('tv.single',['id' => $item->id, 'slug' => str_slug($item->original_name)]) }}" rel="bookmark" title="{{ $item->name }} ({{ to_year($item->first_air_date ?? '') }})" class="stretched-link">
                                    <h2 class="card-title h6 m-1">{{ $item->name }}</h2>
                                </a>
                                <p class="small text-secondary">{{ $item->first_air_date }}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    {{-- TV tv_airing_today --}}
    <div class="card mb-3">
        <div class="card-header">
            <h5 class="card-title m-0">{{ __('section.title.tv_airing_today') }}</h5>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach (block_id_lists($tv_airing_today->results) as $item)
                    <div class="col-md-3 mb-3">
                        <div class="media position-relative">
                            <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->name }}" title="Image {{ $item->name }} ({{ to_year($item->first_air_date ?? '') }})">
                            <div class="media-body">
                                <a href="{{ mopie_route('tv.single',['id' => $item->id, 'slug' => str_slug($item->original_name)]) }}" rel="bookmark" title="{{ $item->name }} ({{ to_year($item->first_air_date ?? '') }})" class="stretched-link">
                                    <h2 class="card-title h6 m-1">{{ $item->name }}</h2>
                                </a>
                                <p class="small text-secondary">{{ $item->first_air_date }}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    {{-- TV tv_on_the_air --}}
    <div class="card mb-3">
        <div class="card-header">
            <h5 class="card-title m-0">{{ __('section.title.tv_on_the_air') }}</h5>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach (block_id_lists($tv_on_the_air->results) as $item)
                    <div class="col-md-3 mb-3">
                        <div class="media position-relative">
                            <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->name }}" title="Image {{ $item->name }} ({{ to_year($item->first_air_date ?? '') }})">
                            <div class="media-body">
                                <a href="{{ mopie_route('tv.single',['id' => $item->id, 'slug' => str_slug($item->original_name)]) }}" rel="bookmark" title="{{ $item->name }} ({{ to_year($item->first_air_date ?? '') }})" class="stretched-link">
                                    <h2 class="card-title h6 m-1">{{ $item->name }}</h2>
                                </a>
                                <p class="small text-secondary">{{ $item->first_air_date }}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    {{-- TV tv_top_rated --}}
    <div class="card mb-3">
        <div class="card-header">
            <h5 class="card-title m-0">{{ __('section.title.tv_top_rated') }}</h5>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach (block_id_lists($tv_top_rated->results) as $item)
                    <div class="col-md-3 mb-3">
                        <div class="media position-relative">
                            <img class="mr-3" width="50" src="{{ img_poster($item->poster_path) }}" alt="Image {{ $item->name }}" title="Image {{ $item->name }} ({{ to_year($item->first_air_date ?? '') }})">
                            <div class="media-body">
                                <a href="{{ mopie_route('tv.single',['id' => $item->id, 'slug' => str_slug($item->original_name)]) }}" rel="bookmark" title="{{ $item->name }} ({{ to_year($item->first_air_date ?? '') }})" class="stretched-link">
                                    <h2 class="card-title h6 m-1">{{ $item->name }}</h2>
                                </a>
                                <p class="small text-secondary">{{ $item->first_air_date }}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>
@endsection