/* ============ xRedPlay — sunucu tarafı eklentileri ============ */

/* Gerçek thumbnail görselleri (placeholder SVG yerine) */
.poster-img { width:100%; height:100%; object-fit:cover; display:block; }
.video-thumb img.poster-img, .discover-thumb img.poster-img { border-radius:inherit; }
.cat-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

/* Üst yükleme çizgisi (Turbo geçişleri) */
.topbar-loader {
  position:fixed; top:0; left:0; height:3px; width:0;
  background:linear-gradient(90deg,var(--red),var(--red-hover));
  z-index:9999; opacity:0; transition:width .2s ease, opacity .3s ease;
  box-shadow:0 0 8px var(--red);
}
.topbar-loader.active { opacity:1; }

/* Header altı kategori şeridi (en çok tıklanan) */
.category-strip {
  position:sticky; top:56px; z-index:40;
  background:var(--bg); border-bottom:1px solid var(--surface-2);
}
.category-strip-inner {
  display:flex; gap:8px; overflow-x:auto; padding:10px 20px;
  scrollbar-width:none;
}
.category-strip-inner::-webkit-scrollbar { display:none; }
.strip-chip {
  flex:0 0 auto; padding:7px 14px; border-radius:var(--pill);
  background:var(--surface); color:var(--text); font-size:13px; font-weight:600;
  white-space:nowrap; border:1px solid transparent; transition:background .15s, border-color .15s;
}
.strip-chip:hover { background:var(--hover); border-color:var(--active); }

/* Empty / durumlar */
.empty-state { text-align:center; padding:80px 20px; display:flex; flex-direction:column; align-items:center; gap:14px; }
.empty-text { color:var(--muted); max-width:420px; }

/* Pre-roll reklam katmanı */
.preroll-layer { position:absolute; inset:0; background:#000; z-index:20; display:none; }
.preroll-layer.active { display:block; }
.preroll-video { width:100%; height:100%; object-fit:contain; }
.preroll-skip {
  position:absolute; bottom:18px; right:18px; z-index:2;
  background:rgba(0,0,0,.7); color:#fff; border:1px solid rgba(255,255,255,.3);
  padding:9px 16px; border-radius:6px; font-size:13px; font-weight:600; cursor:pointer;
}
.preroll-skip[disabled] { opacity:.6; cursor:default; }
.preroll-badge {
  position:absolute; top:14px; left:14px; z-index:2;
  background:rgba(0,0,0,.7); color:#ffd34d; padding:5px 10px; border-radius:5px;
  font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase;
}
.preroll-cta {
  position:absolute; bottom:18px; left:18px; z-index:2;
  background:var(--red); color:#fff; padding:10px 18px; border-radius:6px; font-weight:700; font-size:13px;
}

/* Mobil alt tab bar (yalnız mobilde) */
.mobile-tabbar { display:none; }
@media (max-width: 860px) {
  .mobile-tabbar {
    display:flex; position:fixed; bottom:0; left:0; right:0; z-index:60;
    background:var(--surface); border-top:1px solid var(--surface-2); padding:6px 4px;
    padding-bottom:calc(6px + env(safe-area-inset-bottom));
  }
  .tab-item { flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; color:var(--muted-2); font-size:10px; font-weight:600; padding:4px; }
  .tab-item.active { color:var(--red); }
  body { padding-bottom:64px; }
  .reels-body .mobile-tabbar { background:transparent; border:none; }
}

/* Toast */
.toast {
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--surface-2); color:var(--text); padding:12px 20px; border-radius:10px;
  border:1px solid var(--active); z-index:9998; opacity:0; transition:opacity .25s, transform .25s;
  font-size:14px; box-shadow:0 8px 30px rgba(0,0,0,.5);
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* Saved (localStorage) durum işareti */
.btn-pill.is-saved, .btn-pill.is-liked { color:var(--red); border-color:var(--red); }

/* Search sonuç satırı */
.search-result-item { display:flex; gap:10px; padding:8px; border-radius:8px; align-items:center; }
.search-result-item:hover { background:var(--hover); }
.search-result-thumb { width:64px; height:38px; border-radius:6px; overflow:hidden; flex:0 0 auto; background:var(--surface-2); }
.search-result-thumb img { width:100%; height:100%; object-fit:cover; }
.search-result-info { min-width:0; }
.search-result-title { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.search-result-meta { font-size:11px; color:var(--muted); }
.search-empty, .search-hint { padding:14px; color:var(--muted); font-size:13px; text-align:center; }

/* ============ Pagination ============ */
.pagination { display:flex; align-items:center; justify-content:center; gap:16px; margin:32px 0 12px; }
.page-btn { padding:9px 18px; border-radius:var(--pill); background:var(--surface); color:var(--text); font-weight:600; font-size:14px; border:1px solid var(--surface-2); }
.page-btn:hover { background:var(--hover); }
.page-info { color:var(--muted); font-size:13px; }

/* ============ Report form ============ */
.report-wrap { max-width:620px; }
.report-form { display:flex; flex-direction:column; gap:16px; margin-top:8px; }
.report-form .field { display:flex; flex-direction:column; gap:6px; }
.report-form label { font-size:13px; font-weight:600; color:var(--muted); }
.report-form input, .report-form select, .report-form textarea {
  background:var(--surface); border:1px solid var(--surface-2); border-radius:10px;
  padding:12px 14px; color:var(--text); font-size:14px; font-family:inherit; width:100%;
}
.report-form input:focus, .report-form select:focus, .report-form textarea:focus { outline:none; border-color:var(--red); }
.report-form textarea { resize:vertical; }
.report-target { display:flex; gap:12px; align-items:center; background:var(--surface); border:1px solid var(--surface-2); border-radius:12px; padding:12px; }
.report-target-thumb { width:120px; height:68px; border-radius:8px; overflow:hidden; flex:0 0 auto; background:var(--surface-2); }
.report-target-thumb svg { width:100%; height:100%; }
.report-target-title { font-weight:600; font-size:14px; }
.form-msg { font-size:14px; padding:4px 0; }
.form-msg.ok { color:#3fb950; }
.form-msg.err { color:var(--red-hover); }

/* reel başlık link (caption) */
.reel-title { color:#fff; text-decoration:none; }
.reel-title:hover { text-decoration:underline; }

/* drawer açık backdrop */
.drawer-backdrop.open { opacity:1; visibility:visible; pointer-events:auto; }

/* video-thumb artık <a> (link) — block olmalı ki aspect-ratio/overflow çalışsın */
a.video-thumb { display:block; }
.video-card-title a { color:inherit; text-decoration:none; }
.video-card-title a:hover { color:var(--text-strong); }
/* reels shelf kartı da her bağlamda block kalsın */
a.discover-card { display:block; }

/* Shelf satırlarında görünür scroll çubuğunu gizle (swipe/scroll yine çalışır) */
.shelf-row { scrollbar-width:none; -ms-overflow-style:none; padding-bottom:2px; }
.shelf-row::-webkit-scrollbar { display:none; height:0; }

/* Reels tam ekran — footer gizli */
.reels-body .site-footer { display:none; }

/* Reels: #turbo-root wrapper flex zincire dahil olmalı (reels-stage flex:1 çalışsın) */
.reels-body #turbo-root { flex:1; min-height:0; display:flex; flex-direction:column; }

/* Ses kaydırıcı (player controls) */
.vol-slider {
  -webkit-appearance:none; appearance:none; width:78px; height:4px; border-radius:3px;
  background:rgba(255,255,255,.28); cursor:pointer; margin:0 2px; flex:0 0 auto;
}
.vol-slider::-webkit-slider-thumb { -webkit-appearance:none; appearance:none; width:13px; height:13px; border-radius:50%; background:#fff; cursor:pointer; }
.vol-slider::-moz-range-thumb { width:13px; height:13px; border:none; border-radius:50%; background:#fff; cursor:pointer; }
@media (max-width:600px){ .vol-slider { width:56px; } }

/* Reels: alttaki mobil tab bar'ı gizle (video ile çakışıyordu) */
.reels-body .mobile-tabbar { display:none !important; }

/* Reels üst bar: geri+ses SOLDA (videonun sol kenarında), fullscreen SAĞDA (videonun sağ kenarında) */
.reels-fabs { justify-content:space-between !important; }
/* Ses: mute + slider tek pill içinde birleşik */
.reels-vol-group {
  display:flex; align-items:center; gap:8px; pointer-events:auto;
  background:rgba(0,0,0,.5); border-radius:999px; padding:0 16px 0 6px; height:40px;
}
.reels-vol-group .fab-btn { background:transparent !important; box-shadow:none !important; }
.reels-fabs .reel-vol {
  width:82px; align-self:center; pointer-events:auto;
  background:rgba(255,255,255,.35);
}
.reels-fabs .reel-vol::-webkit-slider-thumb { width:14px; height:14px; }
@media (max-width:600px){ .reels-fabs .reel-vol { width:64px; } }

/* ============ 18+ Age Gate ============ */
body.age-locked { overflow:hidden; }
.age-gate {
  position:fixed; inset:0; z-index:10000; display:flex; align-items:center; justify-content:center;
  padding:20px; background:rgba(5,5,7,.92); backdrop-filter:blur(8px);
  animation:ageIn .2s ease;
}
.age-gate.closing { opacity:0; transition:opacity .2s ease; }
@keyframes ageIn { from{opacity:0} to{opacity:1} }
.age-card {
  max-width:480px; width:100%; text-align:center; background:var(--surface);
  border:1px solid var(--surface-2); border-radius:var(--r-xl); padding:34px 28px;
  box-shadow:0 20px 60px rgba(0,0,0,.6); cursor:pointer;
}
.age-logo { width:52px; height:52px; margin:0 auto 6px; }
.age-badge-lg {
  display:inline-block; background:var(--red); color:#fff; font-weight:800; font-size:15px;
  padding:5px 14px; border-radius:var(--pill); letter-spacing:1px; margin-bottom:14px;
}
.age-card h2 { font-size:22px; font-weight:800; margin-bottom:12px; color:var(--text-strong); }
.age-card p { color:var(--muted); font-size:14px; line-height:1.6; margin-bottom:14px; }
.age-rta { font-size:13px !important; }
.age-rta a, .age-note a { color:var(--red); }
.age-accept-btn { width:100%; padding:14px; font-size:15px; font-weight:700; margin:6px 0 14px; }
.age-note { font-size:12px !important; color:var(--muted-2) !important; margin-bottom:0 !important; }

/* ============ Legal / static pages ============ */
.legal-page { max-width:820px; }
.legal-updated { color:var(--muted-2); font-size:13px; margin:-6px 0 24px; }
.legal-body { color:var(--text); font-size:15px; line-height:1.7; }
.legal-body h2 { font-size:18px; font-weight:700; color:var(--text-strong); margin:26px 0 10px; }
.legal-body p { margin-bottom:14px; color:var(--muted); }
.legal-body ul { margin:0 0 16px 20px; }
.legal-body li { margin-bottom:7px; color:var(--muted); }
.legal-body a { color:var(--red); }
.legal-body b { color:var(--text); }
.footer-bottom-links { flex-wrap:wrap; }

/* Yatay video reel'e yüklenmişse sığdır (letterbox), kırpma/bozma */
.reel-video.contain { object-fit:contain !important; background:#000; }

/* Footer kolonlar (Explore / Support / Legal) */
.footer-cols { display:flex; flex-wrap:wrap; gap:40px 60px; padding:8px 0 24px; }
.footer-col { display:flex; flex-direction:column; gap:9px; min-width:130px; }
.footer-col h4 { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--muted-2); margin-bottom:4px; }
.footer-col a { color:var(--muted); font-size:14px; }
.footer-col a:hover { color:var(--text-strong); }
@media (max-width:600px){ .footer-cols { gap:28px 40px; } }

/* ============ Thumbnail shimmer + fade-in ============ */
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.video-thumb:has(img.poster-img:not(.loaded))::after,
.discover-thumb:has(img.poster-img:not(.loaded))::after,
.cat-avatar:has(img.poster-img:not(.loaded))::after {
  content:''; position:absolute; inset:0; z-index:0;
  background:linear-gradient(100deg, var(--surface-2) 25%, var(--hover) 50%, var(--surface-2) 75%);
  background-size:200% 100%; animation:shimmer 1.3s linear infinite;
}
.cat-avatar { position:relative; }
img.poster-img { opacity:0; transition:opacity .35s ease; position:relative; z-index:1; }
img.poster-img.loaded { opacity:1; }
/* Süre/now-playing rozetleri resmin ÜstÜnde kalsın (arkasına düşmesin) */
.video-duration, .now-playing-badge { z-index:2; }

/* ============ Reels: action butonlarını 1 tık küçült ============ */
.reels-body .reel-actions { gap:15px; bottom:24px; }
.reels-body .reel-action-icon { width:42px; height:42px; }
.reels-body .reel-action-icon svg { width:22px; height:22px; }
.reels-body .reel-action-label { font-size:0.72rem; }
.reels-body .more-btn { background:none; border:none; padding:0; cursor:pointer; }

/* RTA logosu (footer) — gri + hover'da renklen */
.rta-logo { display:inline-flex; margin-left:auto; }
.footer-bottom { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.rta-logo img { height:26px; width:auto; filter:invert(0.5); opacity:.85; transition:filter .2s ease, opacity .2s ease; }
.rta-logo:hover img { filter:invert(0.75); opacity:1; }

/* Reels seek: sürüklerken bar kalınlaşsın */
.reel-progress.seeking::before { height:5px; }

/* Discover sıralama sekmeleri */
.sort-tabs { display:flex; gap:6px; margin-left:auto; flex-wrap:wrap; }
.sort-tab { padding:6px 12px; border-radius:var(--pill); background:var(--surface); color:var(--muted); font-size:13px; font-weight:600; border:1px solid transparent; }
.sort-tab:hover { background:var(--hover); color:var(--text); }
.sort-tab.active { background:var(--red); color:#fff; }

/* Player buffer göstergesi (indirilen kısım — kırmızının arkasında açık) */
.progress-buffer { position:absolute; left:0; height:4px; width:0; background:rgba(255,255,255,.4); border-radius:2px; z-index:0; transition:width .2s linear; }
.progress-bar { z-index:1; }

/* Mobilde reels TAM EKRAN: header + kategori şeridi gizli, alt siyah boşluk yok */
@media (max-width: 860px) {
  .reels-body .site-header,
  .reels-body .category-strip { display: none !important; }
  body.reels-body { padding-bottom: 0 !important; }
  .reels-body .reels-stage { padding: 0 !important; }
  .reels-body .reels-feed { border-radius: 0; }
}

/* Reels sol küme: geri + ses birlikte solda */
/* Geri + ses: fabs barının solunda (video üstünde, sol kenar) */
.reels-left-fabs { display:flex; align-items:center; gap:10px; pointer-events:auto; }
.reels-left-fabs .fab-btn { pointer-events:auto; }

/* Mobil: fabs barı tam genişlik → geri+ses ekranın soluna 10px yapışık (fullscreen zaten gizli) */
@media (max-width: 860px) {
  .reels-fabs { left:0 !important; right:0 !important; width:auto !important; transform:none !important; padding:0 10px !important; }
}

/* ============ 404 ============ */
.notfound {
  min-height: calc(100vh - 220px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; text-align: center;
}
.notfound-inner { max-width: 440px; }
.notfound-mark {
  display: inline-grid; place-items: center; width: 64px; height: 64px;
  border-radius: 18px; background: var(--red); color: #fff; margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(229,9,20,.35);
}
.notfound-code {
  font-size: clamp(84px, 16vw, 132px); font-weight: 900; line-height: .9;
  letter-spacing: -.04em; color: var(--text-strong);
  background: linear-gradient(180deg, var(--text-strong), var(--muted));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.notfound-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 8px; }
.notfound-text { color: var(--muted); font-size: 15px; line-height: 1.6; margin-bottom: 26px; }
.notfound-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Çift-tap beğeni kalbi */
.reel-heart-pop {
  position:absolute; top:50%; left:50%; z-index:8; pointer-events:none;
  color:#ff2d55; transform:translate(-50%,-50%) scale(0);
  animation:reelHeart .8s ease forwards;
}
.reel-heart-pop svg { width:104px; height:104px; filter:drop-shadow(0 6px 16px rgba(0,0,0,.45)); }
@keyframes reelHeart {
  0%   { transform:translate(-50%,-50%) scale(0);    opacity:0; }
  15%  { transform:translate(-50%,-50%) scale(1.25); opacity:1; }
  30%  { transform:translate(-50%,-50%) scale(0.92); }
  45%  { transform:translate(-50%,-50%) scale(1); }
  80%  { opacity:1; }
  100% { transform:translate(-50%,-62%) scale(1);    opacity:0; }
}
/* Tam ekran butonu sadece masaüstünde */
@media (max-width: 860px) { .reels-body #reelFullBtn { display:none !important; } }

/* ============ Trending (home top): 5 per row ============ */
.trending-section { margin-bottom:30px; }
.trending-grid { grid-template-columns:repeat(5, minmax(0,1fr)); }
@media (max-width:1200px){ .trending-grid { grid-template-columns:repeat(4, minmax(0,1fr)); } }
@media (max-width:900px){ .trending-grid { grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (max-width:600px){ .trending-grid { grid-template-columns:repeat(2, minmax(0,1fr)); gap:16px 10px; } }
