/**
 * SOSYALVADI ULTRA 2026 — Dünyanın En Gelişmiş İçerik Platformu
 * Skeleton, skip link, smooth scroll, view transitions
 * @version 2026.2.12
 */

/* ========== SKIP LINK (WCAG 2.1 AAA) ========== */
/* Noscript banner - JS kapalı uyarısı */
.sv-noscript-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: #fef3c7;
  color: #92400e;
  text-align: center;
  font-size: 14px;
  z-index: 99999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.sv-noscript-banner a { color: #92400e; text-decoration: underline; }
[data-theme="dark"] .sv-noscript-banner { background: #422006; color: #fcd34d; }
[data-theme="dark"] .sv-noscript-banner a { color: #fcd34d; }

.sv-skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-5);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-2);
  text-decoration: none;
  transition: top 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}
.sv-skip-link:focus {
  top: var(--space-4);
  outline: none;
  transform: translateY(0);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .sv-skip-link { transition: none; }
}

/* Ekran okuyucu için görünmez, metin okunur (ARIA live vb.) */
.sv-sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== YUKARI ÇIK (Back to top - tüm sayfalar) ========== */
.sv-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4), 0 2px 8px rgba(0,0,0,0.1);
  z-index: 999;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  align-items: center;
  justify-content: center;
}
.sv-back-to-top:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 28px rgba(66, 133, 244, 0.5), 0 4px 12px rgba(52, 168, 83, 0.2);
}
.sv-back-to-top:active {
  transform: translateY(-2px) scale(1.02);
}
.sv-back-to-top svg { flex-shrink: 0; }
[data-theme="dark"] .sv-back-to-top {
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 6px 24px rgba(66, 133, 244, 0.5);
}
@media (max-width: 640px) {
  .sv-back-to-top { bottom: 16px; right: 16px; width: 48px; height: 48px; }
}

/* ========== SMOOTH SCROLL ========== */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  html:focus-within { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ========== SKELETON LOADING ========== */
.sv-skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-subtle) 25%,
    color-mix(in oklch, var(--bg-subtle) 70%, var(--border-subtle)) 50%,
    var(--bg-subtle) 75%
  );
  background-size: 200% 100%;
  animation: sv-skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
[data-theme="dark"] .sv-skeleton {
  background: linear-gradient(
    90deg,
    rgba(51, 65, 85, 0.6) 25%,
    rgba(71, 85, 105, 0.8) 50%,
    rgba(51, 65, 85, 0.6) 75%
  );
  background-size: 200% 100%;
}
@media (prefers-reduced-motion: reduce) {
  .sv-skeleton { animation: none; opacity: 0.7; }
}
@keyframes sv-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sv-skeleton-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}
.sv-skeleton-line {
  height: 1em;
  width: 100%;
}
.sv-skeleton-line--short { width: 60%; }
.sv-skeleton-line--title { height: 1.25em; width: 85%; }
.sv-skeleton-thumb {
  aspect-ratio: 16/9;
  width: 100%;
}

/* ========== PAGE FADE-IN ========== */
.sv-page--animate .sv-module {
  animation: sv-page-fade-in 0.4s ease-out forwards;
}
@media (prefers-reduced-motion: reduce) {
  .sv-page--animate .sv-module { animation: none; }
}
@keyframes sv-page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== FOCUS VISIBLE ENHANCEMENT ========== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ========== RENKLİ KUTU SİSTEMİ (Global - tüm modüller) ========== */
.sv-chip-color {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .2s, box-shadow .2s;
}
.sv-chip-color:hover { transform: scale(1.04); }
.sv-chip-color--accent { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.sv-chip-color--success { background: linear-gradient(135deg, #10b981, #059669); }
.sv-chip-color--warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.sv-chip-color--info { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.sv-chip-color--rose { background: linear-gradient(135deg, #f43f5e, #e11d48); }

/* ========== 3D KART EFEKTİ (Genel) ========== */
.sv-card-3d {
  transition: transform .3s ease, box-shadow .3s ease;
}
.sv-card-3d:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.2);
}
@media (prefers-reduced-motion: reduce) {
  .sv-card-3d:hover { transform: translateY(-2px); }
}

/* ========== MOBİL STİCKY REKLAM (768px altı, scroll sonrası) ========== */
.sv-sticky-ad-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 998;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  padding: var(--space-2);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  align-items: center;
  gap: var(--space-2, 8px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.sv-sticky-ad-mobile[hidden] { display: none !important; }
.sv-sticky-ad-mobile.is-visible { display: flex; }
.sv-sticky-ad-mobile .sv-sticky-ad-content {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.sv-sticky-ad-mobile .sv-sticky-ad-inner {
  min-width: 280px;
  max-width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Kapat butonu — modern X ikonu */
.sv-sticky-ad-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.sv-sticky-ad-close:hover { background: rgba(0,0,0,.1); color: var(--text); }
.sv-sticky-ad-close:active { transform: scale(0.95); }
[data-theme="dark"] .sv-sticky-ad-close {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
}
[data-theme="dark"] .sv-sticky-ad-close:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
}
@media (min-width: 769px) {
  .sv-sticky-ad-mobile { display: none !important; }
}

/* ========== LOADING STATES (UX - erişilebilir) ========== */
.sv-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  z-index: 10;
  border-radius: inherit;
}
.sv-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: sv-spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .sv-loading-spinner { animation: none; opacity: 0.8; }
}
@keyframes sv-spin {
  to { transform: rotate(360deg); }
}

/* Klavye navigasyonu - tab sırası görünür */
.sv-focus-ring:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.sv-focus-ring:focus:not(:focus-visible) { outline: none; }

/* Offline indicator (PWA) */
.sv-offline-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: #ef4444;
  color: #fff;
  font-size: 14px;
  border-radius: 8px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
