@extends('frontend.layouts.app')
@section('title','AI Asistan — Animexe')
@push('styles')
<style>
.ai-hero{
  padding:52px 24px 28px;max-width:900px;margin:0 auto;text-align:center;
}
.ai-hero-icon{
  width:80px;height:80px;border-radius:50%;margin:0 auto 20px;
  background:linear-gradient(135deg,var(--accent3),var(--accent));
  display:flex;align-items:center;justify-content:center;font-size:2.2rem;color:#fff;
  box-shadow:0 0 48px rgba(184,77,255,.45),0 0 80px rgba(255,45,125,.2);
  animation:ai-glow 3s ease-in-out infinite;
}
@keyframes ai-glow{
  0%,100%{box-shadow:0 0 48px rgba(184,77,255,.45),0 0 80px rgba(255,45,125,.2)}
  50%{box-shadow:0 0 64px rgba(184,77,255,.65),0 0 100px rgba(255,45,125,.35)}
}
.ai-hero h1{
  font-family:var(--font-display);font-size:clamp(1.6rem,4vw,2.5rem);font-weight:800;
  background:linear-gradient(120deg,#fff 0%,var(--accent3) 40%,var(--accent) 100%);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;
  margin-bottom:10px;
}
.ai-hero p{color:var(--text2);font-size:1rem;max-width:520px;margin:0 auto 32px;line-height:1.7}

.ai-tabs{
  display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-bottom:32px;
}
.ai-tab{
  padding:10px 22px;border-radius:999px;font-size:.88rem;font-weight:700;cursor:pointer;
  background:var(--surface);border:1px solid var(--border);color:var(--text2);
  transition:all .18s;
}
.ai-tab.on,.ai-tab:hover{
  background:linear-gradient(135deg,rgba(184,77,255,.18),rgba(255,45,125,.1));
  border-color:var(--accent3);color:var(--accent3);
  box-shadow:0 0 20px rgba(184,77,255,.2);
}

.ai-section{max-width:900px;margin:0 auto;padding:0 24px 48px}

/* Öneri kartı */
.ai-box{
  background:linear-gradient(145deg,rgba(17,17,31,.95),rgba(10,10,20,.98));
  border:1px solid rgba(184,77,255,.2);border-radius:18px;padding:28px;
  box-shadow:0 8px 40px rgba(0,0,0,.35),0 0 40px rgba(184,77,255,.05);
}
.ai-box-title{
  font-family:var(--font-display);font-size:.85rem;letter-spacing:.12em;
  text-transform:uppercase;color:var(--accent3);font-weight:700;
  display:flex;align-items:center;gap:10px;margin-bottom:20px;
}
.ai-box-title i{font-size:1.1rem}

/* Ruh hali chips */
.mood-grid{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}
.mood-chip{
  padding:8px 16px;border-radius:999px;font-size:.82rem;font-weight:600;cursor:pointer;
  background:rgba(17,17,31,.8);border:1px solid var(--border);color:var(--text2);
  transition:all .16s;display:flex;align-items:center;gap:6px;
}
.mood-chip.on,.mood-chip:hover{
  background:rgba(184,77,255,.14);border-color:var(--accent3);color:var(--accent3);
  box-shadow:0 0 16px rgba(184,77,255,.2);
}

/* Tür chips */
.genre-wrap{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:20px}

/* Tip toggle */
.type-row{display:flex;gap:8px;margin-bottom:24px}
.type-btn{
  flex:1;padding:10px;border-radius:10px;border:1px solid var(--border);
  background:var(--surface);color:var(--text2);font-size:.84rem;font-weight:700;
  cursor:pointer;transition:all .16s;text-align:center;
}
.type-btn.on{
  background:rgba(0,245,255,.1);border-color:var(--accent2);color:var(--accent2);
  box-shadow:0 0 16px rgba(0,245,255,.12);
}

.ai-btn{
  width:100%;padding:14px;border-radius:12px;border:none;cursor:pointer;
  background:linear-gradient(135deg,var(--accent3),var(--accent));color:#fff;
  font-size:.95rem;font-weight:800;letter-spacing:.04em;
  transition:transform .16s,box-shadow .18s;
  box-shadow:0 0 28px rgba(184,77,255,.3),0 4px 16px rgba(255,45,125,.2);
  display:flex;align-items:center;justify-content:center;gap:10px;
}
.ai-btn:hover{transform:translateY(-1px);box-shadow:0 0 40px rgba(184,77,255,.45)}
.ai-btn:disabled{opacity:.55;cursor:not-allowed;transform:none}

/* Loader */
.ai-loader{display:none;justify-content:center;align-items:center;gap:6px;padding:28px}
.ai-loader.on{display:flex}
.al-dot{width:10px;height:10px;border-radius:50%;background:var(--accent3);animation:al-b .9s ease-in-out infinite}
.al-dot:nth-child(2){animation-delay:.18s;background:var(--accent)}
.al-dot:nth-child(3){animation-delay:.36s;background:var(--accent2)}
@keyframes al-b{0%,80%,100%{transform:scale(.5);opacity:.4}40%{transform:scale(1);opacity:1}}

/* Sonuç grid */
.ai-results{margin-top:24px;display:none}
.ai-results.on{display:block}
.ai-res-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:16px;margin-top:16px}
.ai-res-card{
  background:var(--surface);border:1px solid rgba(0,245,255,.1);border-radius:14px;
  overflow:hidden;cursor:pointer;transition:all .2s;
}
.ai-res-card:hover{transform:translateY(-5px);border-color:rgba(255,45,125,.4);box-shadow:0 12px 36px rgba(0,0,0,.4),0 0 28px rgba(255,45,125,.1)}
.ai-res-poster{position:relative;aspect-ratio:2/3;background:var(--surface2);overflow:hidden}
.ai-res-poster img{width:100%;height:100%;object-fit:cover;transition:transform .28s}
.ai-res-card:hover .ai-res-poster img{transform:scale(1.06)}
.ai-res-poster-ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--text3);font-size:2rem}
.ai-res-reason{
  position:absolute;bottom:0;left:0;right:0;padding:8px;
  background:linear-gradient(to top,rgba(0,0,0,.88),transparent);
  font-size:.65rem;color:rgba(255,255,255,.8);line-height:1.35;
}
.ai-res-body{padding:9px 10px}
.ai-res-title{font-size:.8rem;font-weight:700;color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ai-res-meta{font-size:.7rem;color:var(--text3);margin-top:3px}

/* Natural search */
.ai-search-wrap{position:relative}
.ai-search-wrap input{
  width:100%;background:rgba(255,255,255,.05);border:1px solid rgba(184,77,255,.3);
  border-radius:12px;padding:14px 52px 14px 18px;color:var(--text);font-size:.9rem;
  font-family:inherit;outline:none;transition:all .18s;
}
.ai-search-wrap input:focus{
  border-color:var(--accent3);background:rgba(184,77,255,.06);
  box-shadow:0 0 0 3px rgba(184,77,255,.15),0 0 32px rgba(184,77,255,.1);
}
.ai-search-wrap input::placeholder{color:var(--text3)}
.ai-search-btn{
  position:absolute;right:10px;top:50%;transform:translateY(-50%);
  width:36px;height:36px;border-radius:9px;border:none;cursor:pointer;
  background:linear-gradient(135deg,var(--accent3),var(--accent));color:#fff;font-size:.9rem;
  display:flex;align-items:center;justify-content:center;transition:transform .14s;
}
.ai-search-btn:hover{transform:translateY(-50%) scale(1.08)}
.ai-search-hints{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.ai-hint{
  padding:6px 13px;border-radius:999px;font-size:.75rem;font-weight:600;cursor:pointer;
  background:rgba(0,245,255,.06);border:1px solid rgba(0,245,255,.2);color:var(--accent2);
  transition:all .14s;
}
.ai-hint:hover{background:rgba(0,245,255,.12);box-shadow:0 0 12px rgba(0,245,255,.15)}

.ai-empty{text-align:center;padding:32px;color:var(--text3);font-size:.9rem}
.ai-error{padding:14px 18px;border-radius:10px;background:rgba(255,60,90,.08);border:1px solid rgba(255,60,90,.25);color:#ff8a9a;font-size:.85rem;margin-top:16px;display:none}
.ai-error.on{display:block}

@media(max-width:600px){
  .ai-hero{padding:36px 16px 20px}
  .ai-hero p{font-size:.9rem}
  .ai-section{padding:0 14px 40px}
  .ai-box{padding:18px 14px}
  .ai-res-grid{grid-template-columns:repeat(3,1fr);gap:10px}
  .ai-tabs{gap:5px}
  .ai-tab{padding:8px 14px;font-size:.82rem}
  .type-row{gap:6px}
  .mood-chip{font-size:.78rem;padding:6px 12px}
  .ai-search-wrap input{font-size:.85rem;padding:12px 46px 12px 14px}
}
@media(max-width:380px){
  .ai-res-grid{grid-template-columns:repeat(2,1fr)}
  .ai-hero h1{font-size:1.4rem}
}
</style>
@endpush

@section('content')
<div class="ai-hero">
  <div class="ai-hero-icon"><i class="bi bi-stars"></i></div>
  <h1>Animexe AI Asistan</h1>
  <p>Yapay zeka destekli anime keşfi. Ruh haline göre öneri al, doğal dille ara veya sağ alttaki balondan sohbet et.</p>

  @guest
  <div style="background:rgba(255,45,125,.08);border:1px solid rgba(255,45,125,.25);border-radius:14px;padding:20px 24px;text-align:center;max-width:480px;margin:20px auto 0">
    <i class="bi bi-lock" style="font-size:1.8rem;color:var(--accent);display:block;margin-bottom:10px"></i>
    <p style="color:var(--text2);font-size:.9rem;margin-bottom:16px">AI özelliklerini kullanmak için ücretsiz hesap oluştur veya giriş yap.</p>
    <a href="{{ route('frontend.register') }}" style="display:inline-block;padding:10px 24px;background:var(--accent);border-radius:20px;color:#fff;font-weight:700;text-decoration:none;margin-right:8px">Ücretsiz Kayıt Ol</a>
    <a href="{{ route('frontend.login') }}" style="display:inline-block;padding:10px 24px;background:#21262d;border-radius:20px;color:var(--text2);font-weight:600;text-decoration:none">Giriş Yap</a>
  </div>
  @endguest

  <div class="ai-tabs" @guest style="margin-top:20px;opacity:.5;pointer-events:none" @endguest>
    <button class="ai-tab on" onclick="switchAiTab('recommend',this)"><i class="bi bi-magic"></i> Kişisel Öneri</button>
    <button class="ai-tab" onclick="switchAiTab('search',this)"><i class="bi bi-search-heart"></i> Doğal Dil Ara</button>
    <button class="ai-tab" onclick="switchAiTab('platform',this)"><i class="bi bi-question-circle"></i> Site Yardımı</button>
  </div>
</div>

<div class="ai-section">

  {{-- ── TAB 1: Kişisel Öneri ─────────────────────────────────── --}}
  <div id="tab-recommend">
    <div class="ai-box">
      <div class="ai-box-title"><i class="bi bi-emoji-smile"></i> Nasıl bir ruh halindeydin?</div>
      <div class="mood-grid">
        @foreach([
          ['😤','Aksiyona dolu','action'],['😢','Duygusal ağlatıcı','emotional'],
          ['😂','Komik ve eğlenceli','comedy'],['😨','Gerilim/Korku','thriller'],
          ['🌸','Romantik','romance'],['🤯','Akıl oyunları','mindgame'],
          ['⚔️','Fantezi macera','fantasy'],['🤖','Sci-Fi / Mecha','scifi'],
          ['🏫','Okul / Slice of life','school'],['💪','Motivasyonel','motivational'],
        ] as $m)
        <button class="mood-chip" data-mood="{{ $m[2] }}" onclick="toggleMood(this,'{{ addslashes($m[0].' '.$m[1]) }}')">
          {{ $m[0] }} {{ $m[1] }}
        </button>
        @endforeach
      </div>

      <div class="ai-box-title" style="margin-top:4px"><i class="bi bi-tags"></i> Tür tercihleri (opsiyonel)</div>
      <div class="genre-wrap" id="genre-wrap">
        @foreach($genres as $g)
        <button class="genre-chip" data-genre="{{ $g->name }}" onclick="this.classList.toggle('on')">{{ $g->name }}</button>
        @endforeach
      </div>

      <div class="ai-box-title" style="margin-top:4px"><i class="bi bi-collection-play"></i> İçerik tipi</div>
      <div class="type-row" id="type-row">
        <button class="type-btn on" data-type="" onclick="selectType(this)">Hepsi</button>
        <button class="type-btn" data-type="series" onclick="selectType(this)">Dizi</button>
        <button class="type-btn" data-type="movie" onclick="selectType(this)">Film</button>
      </div>

      <button class="ai-btn" id="rec-btn" onclick="getRecommendations()">
        <i class="bi bi-magic"></i> Bana Özel Öneri Al
      </button>
      <div class="ai-error" id="rec-error"></div>
    </div>

    <div class="ai-loader" id="rec-loader">
      <div class="al-dot"></div><div class="al-dot"></div><div class="al-dot"></div>
      <span style="color:var(--text3);font-size:.85rem;margin-left:6px">AI düşünüyor...</span>
    </div>

    <div class="ai-results" id="rec-results">
      <div style="display:flex;align-items:center;gap:10px;margin-bottom:4px">
        <span style="font-family:var(--font-display);font-size:.82rem;letter-spacing:.1em;text-transform:uppercase;color:var(--accent3)"><i class="bi bi-stars" style="margin-right:6px"></i>AI Önerileri</span>
      </div>
      <div class="ai-res-grid" id="rec-grid"></div>
    </div>
  </div>

  {{-- ── TAB 3: Platform Yardımı ─────────────────────────────── --}}
  <div id="tab-platform" style="display:none">
    <div class="ai-box">
      <div class="ai-box-title"><i class="bi bi-question-circle"></i> Animexe Hakkında Sık Sorulanlar</div>
      <div style="display:grid;gap:10px">
        @foreach([
          ['Kayıt olmak ücretsiz mi?','Evet! Animexe\'ye kayıt olmak tamamen ücretsizdir. E-posta adresinle saniyeler içinde hesap oluşturabilirsin.'],
          ['Premium üyelik ne sağlar?','Premium üyelik ile reklamsız izleme, 1080p HD kalite ve yeni bölümlere erken erişim imkanı kazanırsın.'],
          ['Altyazı ve dublaj var mı?','Evet, çoğu animede Türkçe altyazı bulunur. Bir kısım animede Türkçe dublaj da mevcuttur.'],
          ['Hangi cihazlarda çalışır?','Bilgisayar, tablet ve telefon tarayıcısında sorunsuz çalışır. Özel bir uygulama indirmene gerek yok.'],
          ['Şifremi unuttum, ne yapmalıyım?','Giriş sayfasındaki "Şifremi Unuttum" linkine tıklayarak e-postanla şifre sıfırlama bağlantısı alabilirsin.'],
        ] as [$q, $a])
        <details style="background:rgba(255,255,255,.03);border:1px solid rgba(184,77,255,.15);border-radius:10px;overflow:hidden">
          <summary style="padding:13px 16px;cursor:pointer;font-size:.86rem;font-weight:600;color:var(--text);list-style:none;display:flex;align-items:center;justify-content:space-between">
            {{ $q }}
            <i class="bi bi-chevron-down" style="font-size:.75rem;color:var(--accent3);flex-shrink:0;transition:transform .2s"></i>
          </summary>
          <p style="padding:0 16px 14px;margin:0;font-size:.84rem;color:var(--text2);line-height:1.65">{{ $a }}</p>
        </details>
        @endforeach
      </div>
      <div style="margin-top:20px;padding:14px;background:rgba(184,77,255,.07);border:1px solid rgba(184,77,255,.2);border-radius:12px;text-align:center">
        <p style="margin:0 0 12px;color:var(--text2);font-size:.85rem">Cevabını bulamadın mı? AI asistana sor!</p>
        <button class="ai-btn" style="width:auto;padding:10px 24px;display:inline-flex" onclick="openAiWithQuestion()">
          <i class="bi bi-chat-dots-fill"></i> AI\'a Sor
        </button>
      </div>
    </div>
  </div>

  {{-- ── TAB 2: Doğal Dil Arama ─────────────────────────────── --}}
  <div id="tab-search" style="display:none">
    <div class="ai-box">
      <div class="ai-box-title"><i class="bi bi-search-heart"></i> Ne aramak istiyorsun?</div>
      <div class="ai-search-wrap">
        <input type="text" id="ai-search-inp" placeholder="Ör: ağlatan romantik okul animesi, 2023'te çıkmış aksiyon dizisi..."
          onkeydown="if(event.key==='Enter') aiNaturalSearch()">
        <button class="ai-search-btn" onclick="aiNaturalSearch()"><i class="bi bi-send-fill"></i></button>
      </div>
      <div class="ai-search-hints">
        @foreach(['Ağlatan romantik anime','İsekai macera dizisi','Kısa 12 bölüm aksiyon','Dövüş sanatları anime','Distopik sci-fi film','Komedi okul dizisi'] as $h)
        <button class="ai-hint" onclick="document.getElementById('ai-search-inp').value=this.textContent;aiNaturalSearch()">{{ $h }}</button>
        @endforeach
      </div>
      <div class="ai-error" id="search-error"></div>
    </div>

    <div class="ai-loader" id="search-loader">
      <div class="al-dot"></div><div class="al-dot"></div><div class="al-dot"></div>
      <span style="color:var(--text3);font-size:.85rem;margin-left:6px">AI arıyor...</span>
    </div>

    <div class="ai-results" id="search-results">
      <div style="display:flex;align-items:center;gap:10px;margin-bottom:4px">
        <span style="font-family:var(--font-display);font-size:.82rem;letter-spacing:.1em;text-transform:uppercase;color:var(--accent2)"><i class="bi bi-lightning-fill" style="margin-right:6px"></i>AI Arama Sonuçları</span>
      </div>
      <div class="ai-res-grid" id="search-grid"></div>
    </div>
  </div>

</div>
@endsection

@push('scripts')
<script>
const CSRF = document.querySelector('meta[name=csrf-token]').content;

// ── Tab yönetimi ──────────────────────────────────────────────────────────────
function switchAiTab(tab, btn){
  document.querySelectorAll('.ai-tab').forEach(b=>b.classList.remove('on'));
  btn.classList.add('on');
  document.getElementById('tab-recommend').style.display = tab==='recommend' ? '' : 'none';
  document.getElementById('tab-search').style.display    = tab==='search'    ? '' : 'none';
  document.getElementById('tab-platform').style.display  = tab==='platform'  ? '' : 'none';
}

function openAiWithQuestion(){
  if(typeof window.toggleAiPanel === 'function'){
    window.toggleAiPanel();
    setTimeout(()=>{
      const inp = document.getElementById('ai-inp');
      if(inp){ inp.focus(); inp.placeholder='Site hakkında soru sor...'; }
    }, 300);
  }
}

// ── Ruh hali seçimi ───────────────────────────────────────────────────────────
let selectedMoods = [];
function toggleMood(btn, label){
  btn.classList.toggle('on');
  if(btn.classList.contains('on')){
    selectedMoods.push(label);
  } else {
    selectedMoods = selectedMoods.filter(m=>m!==label);
  }
}

function selectType(btn){
  document.querySelectorAll('#type-row .type-btn').forEach(b=>b.classList.remove('on'));
  btn.classList.add('on');
}

// ── Öneri al ─────────────────────────────────────────────────────────────────
async function getRecommendations(){
  const btn = document.getElementById('rec-btn');
  const loader = document.getElementById('rec-loader');
  const results = document.getElementById('rec-results');
  const errEl = document.getElementById('rec-error');

  const mood = selectedMoods.join(', ');
  const genres = [...document.querySelectorAll('#genre-wrap .genre-chip.on')].map(c=>c.dataset.genre);
  const type = document.querySelector('#type-row .type-btn.on')?.dataset.type || '';

  btn.disabled = true;
  loader.classList.add('on');
  results.classList.remove('on');
  errEl.classList.remove('on');

  try{
    const res = await fetch('{{ route("ai.recommend") }}',{
      method:'POST',
      headers:{'Content-Type':'application/json','X-CSRF-TOKEN':CSRF},
      body: JSON.stringify({ mood, genres, type })
    });
    const data = await res.json();
    loader.classList.remove('on');

    if(data.error){ errEl.textContent=data.error; errEl.classList.add('on'); }
    else { renderRecGrid(data.recommendations || [], 'rec-grid', true); results.classList.add('on'); }
  }catch(e){
    loader.classList.remove('on');
    errEl.textContent = 'Bağlantı hatası, tekrar dene.';
    errEl.classList.add('on');
  }
  btn.disabled = false;
}

// ── Doğal dil arama ───────────────────────────────────────────────────────────
async function aiNaturalSearch(){
  const query = document.getElementById('ai-search-inp').value.trim();
  if(!query) return;

  const loader = document.getElementById('search-loader');
  const results = document.getElementById('search-results');
  const errEl = document.getElementById('search-error');

  loader.classList.add('on');
  results.classList.remove('on');
  errEl.classList.remove('on');

  try{
    const res = await fetch('{{ route("ai.search") }}',{
      method:'POST',
      headers:{'Content-Type':'application/json','X-CSRF-TOKEN':CSRF},
      body: JSON.stringify({ query })
    });
    const data = await res.json();
    loader.classList.remove('on');

    if(data.error){ errEl.textContent=data.error; errEl.classList.add('on'); }
    else if(!data.results || !data.results.length){
      errEl.textContent = 'Sonuç bulunamadı. Farklı bir şey dene!';
      errEl.classList.add('on');
    } else {
      renderRecGrid(data.results, 'search-grid', false);
      results.classList.add('on');
    }
  }catch(e){
    loader.classList.remove('on');
    errEl.textContent = 'Bağlantı hatası, tekrar dene.';
    errEl.classList.add('on');
  }
}

// ── Kart render ───────────────────────────────────────────────────────────────
function renderRecGrid(items, gridId, showReason){
  const grid = document.getElementById(gridId);
  grid.innerHTML = '';
  if(!items.length){
    grid.innerHTML = '<div class="ai-empty">Sonuç bulunamadı.</div>';
    return;
  }
  items.forEach(a=>{
    const detailUrl = '/anime/'+a.slug;
    const watchUrl  = '/watch/'+a.slug+'/1/1';
    const typeLabel = a.type==='movie' ? '🎬 Film' : (a.type==='ova' ? 'OVA' : '📺 Dizi');
    const ratingHtml = a.rating ? `<span style="color:#f59e0b;font-weight:700">★${parseFloat(a.rating).toFixed(1)}</span>` : '';
    const epHtml = a.episode_count ? `<span>${a.episode_count} bölüm</span>` : '';
    grid.innerHTML += `
      <div class="ai-res-card">
        <div class="ai-res-poster">
          ${a.cover
            ? `<img src="${esc(a.cover)}" alt="${esc(a.title)}" loading="lazy">`
            : `<div class="ai-res-poster-ph"><i class="bi bi-image"></i></div>`}
          <div style="position:absolute;top:6px;left:6px;background:rgba(0,0,0,.72);backdrop-filter:blur(4px);border-radius:5px;padding:2px 7px;font-size:.65rem;font-weight:700;color:#fff">${typeLabel}</div>
          ${showReason && a.reason ? `<div class="ai-res-reason">${esc(a.reason)}</div>` : ''}
        </div>
        <div class="ai-res-body">
          <div class="ai-res-title">${esc(a.title)}</div>
          <div class="ai-res-meta" style="display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:4px">
            ${ratingHtml}${epHtml}
          </div>
        </div>
        <div style="display:flex;gap:5px;padding:0 9px 9px">
          <a href="${esc(watchUrl)}" style="flex:1;padding:6px 0;background:linear-gradient(135deg,var(--accent3),var(--accent));border-radius:8px;color:#fff;font-size:.72rem;font-weight:700;text-align:center;text-decoration:none;display:flex;align-items:center;justify-content:center;gap:3px"><i class="bi bi-play-fill"></i>İzle</a>
          <a href="${esc(detailUrl)}" style="flex:1;padding:6px 0;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);border-radius:8px;color:var(--text2);font-size:.72rem;font-weight:700;text-align:center;text-decoration:none;display:flex;align-items:center;justify-content:center;gap:3px"><i class="bi bi-info-circle"></i>Detay</a>
        </div>
      </div>`;
  });
}

function esc(s){ return String(s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;'); }
</script>
@endpush
