/* ============================================================
   Faz 2 — Akış: hikayeler, reklam, anket, gönderi kartları, sütunlar
   ui.css'ten sonra yüklenir. Yalnızca görünüm; JS kancalarına dokunmaz.
   ============================================================ */

/* ---------- 1) Sayfa düzeni ---------- */
body .ss-home-layout { padding-top: 8px; }
@media (min-width: 1100px) {
  body .ss-home-layout {
    grid-template-columns: minmax(0, 600px) minmax(280px, 340px);
    grid-template-rows: auto 1fr;
    grid-template-areas: "feed city" "feed pulse";
    justify-content: center; align-items: start;
    column-gap: 32px; row-gap: 16px; padding: 24px 28px 40px;
  }
  body .ss-home-feed { grid-area: feed; max-width: 600px !important; }
  body .ss-home-sidebar { display: block; min-width: 0; }
  body .ss-home-sidebar-left { grid-area: city; position: static; }
  body .ss-home-sidebar-right { grid-area: pulse; position: sticky; top: 84px; }
}

/* ---------- 2) Yan sütun ---------- */
body .ss-side-panel, body .ss-app-card { border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: none; }
body .ss-side-eyebrow { color: var(--ss-link); font-size: 12px; font-weight: 600; letter-spacing: 0; }
body .ss-side-title { margin: 4px 0 14px; font-size: 21px; font-weight: 800; line-height: 1.15; }
body .ss-side-heading { font-family: var(--ui-font-display); font-size: 15px; font-weight: 700; }
body .ss-home-sidebar-left .ss-side-panel:first-child { border: 0; border-radius: 28px 28px 28px 8px; background: var(--ui-plum-900); color: #fff; }
body .ss-home-sidebar-left .ss-side-panel:first-child .ss-side-eyebrow { color: var(--ui-aqua); }
body .ss-home-sidebar-left .ss-side-panel:first-child .ss-side-title { color: #fff; font-size: 24px; }
body .ss-side-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body .ss-side-link { min-height: 46px; gap: 9px; padding: 0 10px; border-radius: 16px; background: rgba(255, 255, 255, .08); color: #e1e9f4; font-size: 13px; font-weight: 600; }
body .ss-side-link > span { background: transparent; color: var(--ui-aqua); }
body .ss-side-link.is-current { background: var(--ui-rose); color: #fff; transform: none; }
body .ss-side-link.is-current > span { color: #fff; }
@media (hover:hover) and (pointer:fine) {
  body .ss-side-link:not(.is-current):hover { background: rgba(255, 255, 255, .16); color: #fff; transform: none; }
}
body .ss-category-list a { padding: 8px 13px; border: 0; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
body .ss-trend-item { padding: 13px 0; }
body .ss-trend-number { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 12px 12px 12px 4px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
body .ss-trend-item strong { font-size: 13px; font-weight: 700; }
body .ss-trend-item small { font-size: 11.5px; font-weight: 500; }
body .ss-app-card { border: 0; background: linear-gradient(140deg, var(--ui-rose), #1c4a86); color: #fff; }
body .ss-app-card .ss-side-eyebrow, body .ss-app-card > p:not(.ss-side-eyebrow) { color: rgba(255, 255, 255, .88); font-size: 12.5px; }
body .ss-app-card h2 { color: #fff; font-size: 22px; }
body .ss-app-icon { border-radius: 14px 14px 14px 4px; background: #fff; color: var(--ui-plum-900); box-shadow: none; }
body .ss-app-card > a { border-radius: 999px; padding: 12px 18px; background: #fff; color: var(--ui-plum-900); font-size: 13px; }
@media (hover:hover) and (pointer:fine) { body .ss-app-card > a:hover { background: var(--ui-aqua); color: var(--ui-plum-950); } }

/* ---------- 3) Hikayeler: yuvarlak halkalar ---------- */
body .ss-stories-heading { padding: 8px 16px 0; }
body .ss-stories-heading h2 { margin-top: 1px; font-size: 20px; font-weight: 800; }
body .ss-stories-heading h2 span { font-family: var(--ui-font-body); font-size: 12px; font-weight: 500; }
body .ss-live-dot { background: var(--ui-aqua); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ui-aqua) 22%, transparent); }
body #ssStoriesBar section { border: 0 !important; }
body #ssStoriesBar section > div:first-child { padding-top: 6px; }
body #ssStoriesBar section > div:first-child h2 { color: var(--muted); font-size: 12.5px; }
body #ssStoriesBar section > div:nth-child(2) { gap: 12px; padding-top: 10px; padding-bottom: 6px; scroll-snap-type: x proximity; scroll-padding-left: 16px; }
body #ssStoriesBar .story-item, body #ssStoriesBar [data-story-add] { width: 80px; gap: 6px; scroll-snap-align: start; }
body #ssStoriesBar .story-item .ss-ig-ring, body #ssStoriesBar [data-story-add] > div:first-child {
  display: block; position: relative; width: 80px; height: 80px; padding: 3px; box-sizing: border-box; border-radius: 50% !important;
}
body #ssStoriesBar .story-item .ss-ig-ring { background: conic-gradient(from 200deg, #ffb347, var(--ui-rose), #2f6bb0, var(--ui-aqua), #ffb347); transition: transform .18s cubic-bezier(.34, 1.56, .64, 1); }
body #ssStoriesBar .story-item .ss-ig-ring.is-seen, body #ssStoriesBar .story-item[data-seen="1"] .ss-ig-ring { padding: 2px; background: var(--line); }
body #ssStoriesBar .story-item:active .ss-ig-ring { transform: scale(.92); }
@media (hover:hover) and (pointer:fine) { body #ssStoriesBar .story-item:hover .ss-ig-ring { transform: scale(1.06); } }
body #ssStoriesBar .ss-ig-ring .ss-ig-inner, body #ssStoriesBar [data-story-add] .story-ring-inner {
  display: block; position: relative; width: 100%; height: 100%; overflow: hidden; box-sizing: border-box;
  border: 3px solid var(--bg); border-radius: 50% !important; background: var(--ui-plum-700);
}
body #ssStoriesBar [data-story-add] > div:first-child { padding: 2px; background: var(--line); }
body #ssStoriesBar [data-story-add] .story-ring-inner { display: flex; background: var(--card); }
body #ssStoriesBar [data-story-add] .story-ring-inner > img { border-radius: 50%; color: transparent; }
body #ssStoriesBar [data-story-add] > div:first-child > span:last-child { right: -1px; bottom: -1px; border-color: var(--bg) !important; }
body #ssStoriesBar .ss-ig-media { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
body #ssStoriesBar .story-item[data-seen="1"] .ss-ig-media { opacity: .75; }
body #ssStoriesBar .ss-ig-label, body #ssStoriesBar [data-story-add] > span:last-child { font-size: 11.5px; }
body #ssUnseenBadge { background: var(--ui-rose) !important; }

body div:has(> [data-ss-fab]) { border: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none; }
body div > [data-ss-fab] { min-height: 40px; border-radius: 12px; }

/* ---------- 4) Reklam ---------- */
body .ss-banner-head-label { color: var(--muted); letter-spacing: .02em; }
body .ss-site-banner { border: 0; border-radius: 26px 26px 26px 8px; box-shadow: none; }
body .ss-site-banner:active { transform: scale(.985); }
body .ss-banner-dot.is-active { background: var(--ui-rose); }

/* ---------- 5) Anket ---------- */
body section[data-poll] { padding: 18px; border: 1px solid var(--line) !important; border-radius: 26px !important; box-shadow: none; }
body section[data-poll] > div:first-child > span:first-child { border-radius: 10px 10px 10px 3px; }
body section[data-poll] > div:first-child > span:nth-child(2) { color: var(--ss-link) !important; letter-spacing: 0; text-transform: none; font-size: 13px; }
body section[data-poll] h3 { font-size: 18px; }
body section[data-poll] [data-poll-opt] { min-height: 50px; border-radius: 999px; }
body section[data-poll] [data-poll-opt]:active { border-color: var(--accent) !important; }

/* ---------- 6) Gönderi kartları ---------- */
body #videoFeed { gap: 18px; }
body article[data-vcard],
body article[data-complaint] {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line) !important; border-radius: 30px !important;
  background: var(--card) !important; color: var(--ink); box-shadow: none !important;
}
body article[data-vcard] > *, body article[data-complaint] > * { order: 1; }
body article[data-vcard] > header, body article[data-complaint] > header { order: 0; gap: 10px; min-height: 64px; padding: 12px 14px 10px; border: 0; background: transparent; }
body article[data-vcard] > header > a { flex: 1 1 auto; }
body article header .ring-gradient { border-radius: 17px 17px 17px 6px !important; }
body article header .ring-gradient img,
body article header .ring-gradient > * { border-radius: 15px 15px 15px 4px !important; }
body article[data-vcard] header span[style*="#1e3a8a"] { background: var(--ui-plum-700) !important; border: 0 !important; box-shadow: none !important; }
body article[data-vcard] header .telegram-badge { animation: none; }
body article > header [data-follow],
body article > header > span:last-child { min-height: 28px; align-items: center; }

body article[data-vcard] > header > div { gap: 6px !important; }
body article[data-vcard] > header > div > button[data-vreels],
body article[data-vcard] > header > div > a[href*="kullanici.php"],
body article[data-vcard] > header > div > a[href*="profil.php"] {
  min-height: 34px; align-items: center; justify-content: center;
  padding: 0 13px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap;
}
body article[data-vcard] > header > div > button[data-vreels] { display: inline-flex; gap: 6px; border-color: transparent !important; background: var(--accent-soft) !important; color: var(--accent) !important; } /* satır içi stili ezer */
body article[data-vcard] > header > div > button[data-vreels]::before { content: ""; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 7px solid currentColor; }
/* "Profili Gör" telefonda da görünür kalır (eski davranış) */
body article[data-vcard] > header > div > a[href*="kullanici.php"],
body article[data-vcard] > header > div > a[href*="profil.php"] { display: inline-flex; }
@media (max-width: 479px) {
  body article[data-vcard] > header > div > button[data-vreels],
  body article[data-vcard] > header > div > a[href*="kullanici.php"],
  body article[data-vcard] > header > div > a[href*="profil.php"] { min-height: 32px; padding: 0 9px; font-size: 11px; }
}
body article[data-vcard] [data-vmanage] { min-width: 36px; min-height: 36px; }

/* medya: kart içinde çerçeveli */
body article > [data-vwrap],
body article > [data-cvwrap],
body article[data-complaint] > div[class*="aspect-"] { width: auto; margin: 0 8px; border-radius: 24px 24px 24px 8px; isolation: isolate; }
body article[data-vcard] [data-vprogress], body article [data-cvprogress] { background: var(--ui-aqua) !important; }
body article[data-vcard] [data-vmute] { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0; }
body article .ss-video-views { top: 12px; left: 12px; border-radius: 999px; background: rgba(2, 15, 34, .66); }

/* metin medyanın hemen altında, eylemler kartın tabanında */
body article[data-vcard] .ss-video-caption { order: 2; margin: 0; padding: 12px 18px 0; border: 0; background: transparent; }
body article[data-vcard] .ss-video-caption h2 { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--ink); }
body article[data-vcard] .ss-video-caption [data-vdesc] { font-size: 14px; line-height: 1.55; }
body article[data-vcard] .ss-video-desc-more { color: var(--ss-link); font-size: 12.5px; }
body article[data-complaint] > div:has(> .ss-feed-copy-text) { order: 2; padding: 12px 18px 2px; }
body article[data-complaint] h3 { color: var(--ink); font-size: 17px; line-height: 1.3; }
body article .ss-feed-copy-text { font-size: 14px; }
body article[data-complaint] .font-mono { padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
body article[data-complaint] button[onclick] { min-height: 36px; border-radius: 999px; }

body article[data-vcard] .ss-video-actions,
body article[data-complaint] > div:has(> [data-interact="save"]) { order: 3; display: flex; align-items: center; gap: 6px; padding: 12px 12px 4px; }
body article[data-complaint] > div:has(> [data-interact="save"]) { padding-bottom: 14px; }
body article[data-vcard] .ss-video-actions > button,
body article[data-complaint] > div > [data-interact],
body article[data-complaint] > div > [data-comments],
body article[data-complaint] > div > [data-share-target],
body article[data-complaint] > div > [data-report-target] {
  display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; gap: 7px;
  padding: 0 12px; border-radius: 999px; background: var(--bg); color: var(--ink);
}
body article[data-vcard] .ss-video-actions > [data-interact="save"],
body article[data-complaint] > div > [data-interact="save"] { margin-left: auto; }
body article .ss-video-actions svg,
body article[data-complaint] > div > button svg { width: 21px; height: 21px; }
body article[data-vcard] .ss-video-actions > button[data-report-target],
body article[data-complaint] > div > [data-report-target] { background: transparent; color: var(--muted); }
body article .ss-video-actions > button:active,
body article[data-complaint] > div > button:active { background: var(--accent-soft); }
body article [data-vlikecount], body article [data-ccount], body article [data-social-count] { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
body [data-vheart][style*="var(--accent)"],
body article[data-complaint] [data-interact="like"][aria-pressed="true"] [data-social-icon],
body article[data-complaint] [data-interact="like"] [data-social-icon][fill="var(--accent)"] { fill: var(--ui-rose) !important; stroke: var(--ui-rose) !important; }
body article [data-interact="save"][aria-pressed="true"] { color: var(--accent) !important; }
body article[data-vcard] .ss-video-footer { order: 4; padding: 2px 18px 12px; }
body article[data-vcard] [data-vcomment-text] { min-height: 32px; font-size: 12.5px; }
body .ss-hashtag { color: var(--ss-link); }
body .ss-reel-desc-preview .ss-hashtag, body .ss-reel-description-text .ss-hashtag { color: #fff; }

/* ---------- 7) Boş durum ve akış sonu ---------- */
body #videoFeed > p { margin: 0; padding: 44px 20px; border: 1px dashed var(--line); border-radius: 30px; background: var(--card); }
body #feedLoading { color: var(--accent) !important; }
body #feedEnd { padding: 26px 24px 8px; text-align: center; line-height: 1.6; color: var(--muted); text-wrap: balance; }

@media (max-width: 540px) {
  body #videoFeed { gap: 12px; margin: 0 -8px; }
  body article[data-vcard], body article[data-complaint] { border-radius: 26px !important; }
}
@media (max-width: 359px) {
  body article[data-vcard] > header { gap: 6px; padding-right: 8px; padding-left: 10px; }
  body article[data-vcard] .ss-video-actions,
  body article[data-complaint] > div:has(> [data-interact="save"]) { gap: 2px; padding-right: 6px; padding-left: 6px; }
  body article[data-vcard] .ss-video-actions > button,
  body article[data-complaint] > div > button { min-width: 38px; padding: 0 7px; }
}
@media (prefers-reduced-motion: reduce) {
  body #ssStoriesBar .ss-ig-ring { transition: none !important; }
}

/* ---------- 8) Akıcılık ve sürükleyici telefon akışı ---------- */
/* Sayfa geçişi yalnızca saydamlıkla: sabit pencerelerin konumunu etkilemez */
@keyframes ui-page-in { from { opacity: .25; } to { opacity: 1; } }
body main > * { animation: ui-page-in .26s ease-out backwards; }
body article header .ring-gradient, body article header .ring-gradient img, body article header .ring-gradient > * { border-radius: 50% !important; }
body article [data-vwrap], body article [data-cvwrap] { -webkit-tap-highlight-color: transparent; }
body article .ss-video-actions > button, body article[data-complaint] > div > button { transition: transform .16s cubic-bezier(.34, 1.56, .64, 1), background-color .16s ease; }
body article .ss-video-actions > button:active, body article[data-complaint] > div > button:active { transform: scale(.86); }
@media (max-width: 540px) {
  body #videoFeed { gap: 8px; margin: 0 -16px; }
  body #videoFeed > article[data-vcard], body #videoFeed > article[data-complaint] { border-width: 1px 0 !important; border-radius: 0 !important; }
  body #videoFeed > article > [data-vwrap], body #videoFeed > article > [data-cvwrap], body #videoFeed > article[data-complaint] > div[class*="aspect-"] { margin: 0; border-radius: 0; max-height: 78dvh; }
  body #videoFeed > :not(article) { margin-right: 12px; margin-left: 12px; }
}
@media (prefers-reduced-motion: reduce) { body main > * { animation: none; } }

@media (max-width: 639px) { body #fabBtn { width: 50px; height: 50px; } }
