@extends('frontend.layouts.app')
@php
    $__genreCanon = rtrim(\App\Models\Setting::get('seo_canonical_domain', config('app.url')), '/') . route('genre', $genre->slug, false);
    $__genreDesc  = $genre->name . ' türündeki en iyi anime dizileri ve filmlerini Animexe\'de Türkçe altyazılı veya dublajlı ücretsiz izleyin. ' . $genre->name . ' anime listesi.';
@endphp
@section('title', $genre->name . ' Anime İzle - Türkçe Altyazılı | Animexe')
@section('meta_description', $__genreDesc)
@section('meta_keywords', $genre->name . ' anime izle, ' . $genre->name . ' türkçe anime izle, ' . $genre->name . ' anime, türkçe ' . $genre->name . ' anime, animexe ' . strtolower($genre->name))
@section('og_title', $genre->name . ' Türündeki Animeler — Animexe')
@section('og_description', $__genreDesc)
@section('canonical', $__genreCanon)
@section('schema')
@if((\App\Models\Setting::get('seo_enable_schema','1')) === '1')
@php $__gDomain = rtrim(\App\Models\Setting::get('seo_canonical_domain',config('app.url')),'/'); @endphp

{{-- CollectionPage + ItemList --}}
<script type="application/ld+json">
{
  "@@context":"https://schema.org",
  "@@type":"CollectionPage",
  "name":"{{ addslashes($genre->name) }} Anime İzle - Türkçe Altyazılı",
  "description":"{{ addslashes($__genreDesc) }}",
  "url":"{{ $__genreCanon }}",
  "inLanguage":"tr-TR",
  "mainEntity":{
    "@@type":"ItemList",
    "name":"{{ addslashes($genre->name) }} Anime Listesi",
    "numberOfItems":{{ $animes->total() }},
    "itemListElement":[
      @foreach($animes->take(10) as $i => $ga)
      {"@@type":"ListItem","position":{{ $i+1 }},"name":"{{ addslashes($ga->title) }} İzle","url":"{{ $__gDomain }}/anime/{{ $ga->slug }}"}{{ $i < min(9,$animes->count()-1) ? ',' : '' }}
      @endforeach
    ]
  }
}
</script>

{{-- BreadcrumbList --}}
@if((\App\Models\Setting::get('seo_enable_breadcrumb','1')) === '1')
<script type="application/ld+json">
{
  "@@context":"https://schema.org",
  "@@type":"BreadcrumbList",
  "itemListElement":[
    {"@@type":"ListItem","position":1,"name":"Ana Sayfa","item":"{{ $__gDomain }}/"},
    {"@@type":"ListItem","position":2,"name":"Türler","item":"{{ $__gDomain }}/search"},
    {"@@type":"ListItem","position":3,"name":"{{ addslashes($genre->name) }} Anime İzle","item":"{{ $__genreCanon }}"}
  ]
}
</script>
@endif
@endif
@endsection

@section('content')
<div class="section" style="padding-top:36px">
  <div class="section-hdr" style="margin-bottom:18px">
    <span class="section-title">
      <i class="bi bi-tag" style="font-size:.85rem;color:var(--accent2)"></i>
      {{ $genre->name }}
    </span>
    <span style="color:var(--text3);font-size:.82rem">{{ $animes->total() }} anime</span>
  </div>

  @if($animes->count())
  <div class="a-grid">
    @foreach($animes as $anime)
    <a href="{{ $anime->detailUrl }}" class="a-card">
      <div class="a-poster">
        @if($anime->coverUrl)
        <img src="{{ $anime->coverUrl }}" alt="{{ $anime->title }}" loading="lazy">
        @else
        <div class="a-no-img"><i class="bi bi-image"></i></div>
        @endif
        @if($anime->type==='movie')<span class="a-badge">Film</span>@endif
        @if($anime->rating)<span class="a-rating"><i class="bi bi-star-fill" style="font-size:.65rem"></i>{{ number_format($anime->rating,1) }}</span>@endif
        <div class="a-hover-play"><div class="play-circle"><i class="bi bi-play-fill"></i></div></div>
      </div>
      <div class="a-info">
        <div class="a-title">{{ $anime->title }}</div>
        <div class="a-meta">{{ $anime->release_year }}</div>
      </div>
    </a>
    @endforeach
  </div>
  @if($animes->hasPages())
  <div style="margin-top:32px">{{ $animes->links('frontend.pagination') }}</div>
  @endif
  @else
  <div style="text-align:center;padding:64px 20px;color:var(--text3)">
    <i class="bi bi-collection" style="font-size:3rem;opacity:.25;display:block;margin-bottom:14px"></i>
    <p>Bu türde henüz anime bulunmuyor.</p>
  </div>
  @endif
</div>
@endsection
