/* ============================================================
   Faz 3 — Keşfet, Reels ve profil
   Yalnızca görünüm; JS kancalarına dokunmaz.
   ============================================================ */

/* ---------- 1) Keşfet ---------- */
body .ss-explore-wrap { max-width: 980px; padding: 14px 12px calc(env(safe-area-inset-bottom, 0px) + 112px); }
body .ss-explore-head { align-items: flex-end; gap: 12px; }
body .ss-explore-wrap > .ss-explore-head:first-child { padding: 20px; border-radius: 30px 30px 30px 10px; background: var(--ui-plum-900); color: #fff; }
body .ss-explore-eyebrow { color: var(--ss-link); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
body .ss-explore-wrap > .ss-explore-head:first-child .ss-explore-eyebrow { color: var(--ui-aqua); }
body .ss-explore-title { font-size: clamp(25px, 6vw, 38px); font-weight: 800; line-height: 1.05; }
body .ss-explore-wrap > .ss-explore-head:first-child .ss-explore-title { color: #fff; }
body .ss-explore-sub { color: var(--muted); font-size: 13px; }
body .ss-explore-wrap > .ss-explore-head:first-child .ss-explore-sub { color: #c3d1e4; }
body .ss-explore-pill { flex: none; border: 0; border-radius: 999px; padding: 8px 13px; background: var(--ui-aqua); color: var(--ui-plum-950); font-size: 12px; font-weight: 700; }
body .ss-explore-tags { display: flex; flex-wrap: nowrap; gap: 8px; margin: 12px -12px 0; padding: 2px 12px; overflow-x: auto; scrollbar-width: none; }
body .ss-explore-tags::-webkit-scrollbar { display: none; }
body .ss-explore-tag { flex: none; min-height: 38px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; background: var(--card); font-size: 13px; font-weight: 600; }
body .ss-explore-tag span { color: var(--accent); }

body .ss-explore-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: 3px; margin-right: -12px; margin-left: -12px; }
body .ss-explore-grid > .ss-explore-tile { position: relative; overflow: hidden; padding: 0; border: 0; border-radius: 4px; background: var(--ui-plum-700); }
body .ss-explore-grid > .ss-explore-tile:nth-child(10n+1), body .ss-explore-grid > .ss-explore-tile:nth-child(10n+8) { grid-column: span 2; grid-row: span 2; }
body .ss-explore-grid > .ss-explore-tile:nth-child(10n+8) { grid-column-start: 2; }
body .ss-explore-thumb { width: 100%; height: 100%; aspect-ratio: 3 / 4; border-radius: 0; background: linear-gradient(145deg, var(--ui-plum-700), var(--ui-plum-950)); }
body .ss-explore-img, body .ss-explore-vid { transition: transform .35s cubic-bezier(.22, 1, .36, 1); }
@media (hover:hover) and (pointer:fine) { body .ss-explore-tile:hover .ss-explore-img, body .ss-explore-tile:hover .ss-explore-vid { transform: scale(1.07); } }
body .ss-explore-thumb::after { background: linear-gradient(to top, rgba(2, 15, 34, .85), transparent 48%); z-index: 1; }
body .ss-explore-grid .ss-explore-meta { position: absolute; right: 0; bottom: 0; left: 0; z-index: 2; padding: 7px 8px; color: #fff; text-align: left; pointer-events: none; }
body .ss-explore-meta b { color: #fff; font-size: 11.5px; font-weight: 700; -webkit-line-clamp: 1; }
body .ss-explore-meta small { color: #d5deec; font-size: 10px; font-weight: 500; }
body .ss-explore-grid .ss-explore-views { top: 6px; right: auto; bottom: auto; left: 6px; z-index: 2; border-radius: 999px; padding: 3px 7px; background: rgba(2, 15, 34, .6); font-size: 10px; }
body .ss-explore-grid .ss-explore-play { top: 6px; right: 6px; z-index: 2; transform: scale(.8); transform-origin: top right; }
body .ss-explore-empty { border: 1px dashed var(--line); border-radius: 30px; background: var(--card); }
@media (min-width: 640px) {
  body .ss-explore-grid { gap: 6px; margin-right: 0; margin-left: 0; }
  body .ss-explore-grid > .ss-explore-tile { border-radius: 14px; }
  body .ss-explore-meta b { font-size: 13px; }
}


/* ---------- 2) Reels (tam ekran oynatıcı) ---------- */
body #ssReels [data-rlike], body #ssReels [data-rcomment], body #ssReels [data-rshare], body #ssReels [data-rsave], body #ssReels [data-rmute] { gap: 3px; }
body #ssReels [data-rlike] > svg, body #ssReels [data-rcomment] > svg, body #ssReels [data-rshare] > svg, body #ssReels [data-rsave] > svg, body #ssReels [data-rmute] > svg {
  box-sizing: content-box; width: 24px; height: 24px; padding: 11px;
  border-radius: 18px 18px 18px 6px; background: rgba(3, 23, 50, .62);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
body #ssReels [data-rmute] > svg.hidden { display: none; }
body #ssReels [data-rfollow] { border-color: transparent; background: var(--ui-rose); }
body #ssReels [data-rprog] { background: var(--ui-aqua) !important; }
body #ssReels [data-reel] p { max-width: 520px; }
body .ss-reel-description-sheet { border-radius: 28px 28px 0 0; background: var(--ui-plum-900); }
@media (max-height: 620px) {
  body #ssReels [data-rlike] > svg, body #ssReels [data-rcomment] > svg, body #ssReels [data-rshare] > svg, body #ssReels [data-rsave] > svg, body #ssReels [data-rmute] > svg { width: 20px; height: 20px; padding: 7px; }
}

/* Masaüstünde dikey video sütunu: gerçek uygulama gibi ortalanmış 9:16 */
@media (min-width: 800px) {
  body #ssReels [data-reel] { width: min(100%, calc(100dvh * .5625)); margin-right: auto; margin-left: auto; border-radius: 22px; }
}
body #ssReels [data-rlike] > svg, body #ssReels [data-rcomment] > svg { transition: transform .18s cubic-bezier(.34, 1.56, .64, 1); }
body #ssReels [data-rlike]:active > svg, body #ssReels [data-rcomment]:active > svg { transform: scale(.82); }
/* ---------- 3) Profil: derli toplu kimlik ---------- */
body .ss-profile { max-width: 640px; }
body .ss-profile .ss-profile-body { padding: 8px 14px 12px; }
body .ss-profile-cover { position: relative; height: 104px; overflow: hidden; border-radius: 22px;
  background: radial-gradient(circle at 88% 8%, rgba(252, 177, 64, .8) 0 30px, transparent 31px), radial-gradient(circle at 12% 125%, rgba(28, 74, 134, .95) 0 82px, transparent 83px), linear-gradient(120deg, #15355f, #020f22); }
body .ss-profile-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body .ss-profile-cover.has-photo { height: auto; aspect-ratio: 3 / 1; }
body .ss-profile-cover.ss-cover-preview { display: block; height: auto; aspect-ratio: 3 / 1; margin: 10px 0 8px; border-radius: 18px; cursor: pointer; }
@media (min-width: 640px) { body .ss-profile-body > .ss-profile-cover { height: 160px; } body .ss-profile-body > .ss-profile-cover.has-photo { height: auto; } }

body .ss-profile .ss-profile-top { position: relative; flex-direction: row; align-items: flex-end; gap: 12px; padding: 0 4px; }
@keyframes slow-avatar-spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
body .ss-main-avatar-ring { position: relative; z-index: 2; display: inline-flex; flex: none; align-items: center; justify-content: center; overflow: hidden; margin-top: -34px; padding: 4px; border: 0; border-radius: 50%; background: var(--bg); cursor: pointer; transition: transform .2s ease; }
body .ss-main-avatar-ring:active { transform: scale(.95); }
body .ss-main-avatar-ring::before { content: ""; position: absolute; top: 50%; left: 50%; z-index: -2; width: 150%; height: 150%; background: conic-gradient(from 0deg, #ffb347, var(--ui-rose), #2f6bb0, var(--ui-aqua), #ffb347); animation: slow-avatar-spin 3s linear infinite; }
body .ss-main-avatar-ring.no-story::before { background: var(--line); animation: none; }
body .ss-main-avatar-ring.is-seen::before { background: var(--line); animation: none; }
body .ss-main-avatar-ring::after { content: ""; position: absolute; inset: 3px; z-index: -1; border-radius: 50%; background: var(--bg); }
body .ss-profile .ss-main-avatar-ring > * { position: relative; z-index: 2; width: 82px !important; height: 82px !important; overflow: hidden; border: 0 !important; border-radius: 50% !important; color: transparent; object-fit: cover; }
body .ss-profile .ss-main-avatar-ring > span { color: #fff; }
@media (prefers-reduced-motion: reduce) { body .ss-main-avatar-ring::before { animation: none; } }

body .ss-profile .ss-profile-stats { min-width: 0; flex: 1 1 0; gap: 0; align-self: flex-end; }
body .ss-profile .ss-profile-stats > * { display: flex; min-width: 0; min-height: 50px; flex-direction: column; align-items: center; justify-content: center; padding: 4px 1px; border: 0; border-radius: 12px; background: transparent; }
body .ss-profile .ss-profile-stats p:first-child { font: 800 18px/1.15 var(--ui-font-display); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
body .ss-profile .ss-profile-stats p:last-child { max-width: 100%; overflow: hidden; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
@media (hover:hover) and (pointer:fine) { body .ss-profile .ss-profile-stats button:hover { background: var(--accent-soft); } }
@media (max-width: 359px) { body .ss-profile .ss-profile-top { gap: 4px; padding: 0; } body .ss-profile .ss-main-avatar-ring > * { width: 66px !important; height: 66px !important; } body .ss-profile .ss-profile-stats p:first-child { font-size: 15px; } body .ss-profile .ss-profile-stats p:last-child { font-size: 9px; } }

body .ss-profile .ss-profile-info { margin-top: 10px; padding: 0 4px; text-align: left; }
body .ss-profile .ss-profile-info h1 { flex-wrap: wrap; justify-content: flex-start; font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--ink); }
body .ss-profile .ss-profile-info h1 > span[style*="var(--accent)"] { padding: 2px 8px; background: var(--ss-amber-100) !important; color: var(--ss-amber-800) !important; font-family: var(--ui-font-body); font-size: 9.5px; }
html[data-ss-mode='dark'] body .ss-profile .ss-profile-info h1 > span[style*="var(--accent)"] { background: rgba(252, 177, 64, .16) !important; color: var(--ui-aqua) !important; }
body .ss-profile .ss-profile-info h1 .telegram-badge { animation: none; }
body .ss-profile .ss-profile-info > p { overflow-wrap: anywhere; }
body .ss-profile .ss-profile-info > p.mt-2 { margin-top: 5px; line-height: 1.45; }
body .ss-profile .ss-profile-info > .border-dashed { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; margin-top: 8px; padding: 8px 12px; border-radius: 14px; background: var(--card) !important; overflow-wrap: anywhere; }
body .ss-profile .ss-profile-info > .border-dashed > p { margin: 0; font-size: 11.5px; }
body .ss-profile .ss-profile-info > .border-dashed > p:first-child { width: 100%; font-size: 10px; }

/* ---------- 4) Profil düğmeleri: sıkı, iki sütun ---------- */
body .ss-profile .ss-profile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
body .ss-profile .ss-profile-actions > * { grid-column: 1 / -1; min-width: 0; margin-top: 0; }
body .ss-profile .ss-profile-actions > button, body .ss-profile .ss-profile-actions > a { grid-column: auto; }
body .ss-profile .ss-profile-actions > button:only-of-type:not(:has(+ button)):first-child:last-child { grid-column: 1 / -1; }
body .ss-profile .ss-profile-actions button, body .ss-profile .ss-profile-actions a { min-height: 38px; padding-top: 7px; padding-bottom: 7px; border-radius: 12px; font-size: 12px; }
body .ss-profile .ss-profile-actions .border-t { margin-top: 0; padding-top: 0; border: 0; }
body .ss-profile .ss-profile-actions select { min-height: 38px; border-radius: 12px; }
body .ss-profile .ss-profile-actions .grid { gap: 7px; }
body .ss-profile .ss-profile-actions .grid > * { min-width: 0; text-align: center; }
/* Ziyaretçide üstte zaten "Mesaj" varken yönetici iletişim satırındaki kopya gizlenir */
body .ss-profile-actions:has(#mainProfileFollowBtn) .ss-admin-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body .ss-profile-actions:has(#mainProfileFollowBtn) .ss-admin-contact [data-dm-open] { display: none; }
@media (max-width: 479px) {
  body .ss-profile-actions > .grid-cols-3:not(.ss-admin-contact) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body .ss-profile-actions > .grid-cols-3:not(.ss-admin-contact) > * { padding-right: 4px; padding-left: 4px; font-size: 11px; line-height: 1.2; }
}
@media (max-width: 420px) {
  body article[data-vcard][data-manage="1"] > header > div > a[href*="kullanici.php"],
  body article[data-vcard][data-manage="1"] > header > div > a[href*="profil.php"] { display: none; }
}
body .ss-social-row a > span { display: inline !important; }
body .ss-social-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
body .ss-social-row a { flex: 1 0 auto; min-width: 108px; border-radius: 12px; background: var(--card) !important; }


/* ---------- 5) Hareketlerim, bölümler, ızgara ---------- */
body #ssActivitySection { margin-top: 16px; border-radius: 18px; }
body .ss-act-tabs { gap: 4px; margin: 10px 10px 0; padding: 4px !important; border-radius: 999px; background: var(--bg); }
body .ss-act-tabs > button { min-width: 0; min-height: 40px; padding: 0 4px; border-radius: 999px; font-size: 11.5px; line-height: 1.2; }
body .ss-profile .ss-profile-section { border-top: 0 !important; }
body .ss-profile .ss-profile-section > h2 { font-size: 16px; font-weight: 800; color: var(--ink); }
body #profileGrid { gap: 2px; margin-right: -14px; margin-left: -14px; }
body #profileGrid > button { aspect-ratio: 4 / 5; border-radius: 3px; background: var(--ui-plum-700); }
body #profileGrid > button:active { opacity: .85; }
body #ssPostGrid { gap: 2px; margin-right: -14px; margin-left: -14px; }
body #ssPostAdd, body #ssPostMore { min-height: 48px; border-radius: 999px; }

body .ss-profile-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 22px; padding: 38px 20px; border: 1px dashed var(--line); border-radius: 30px; background: var(--card); text-align: center; }
body .ss-profile-empty strong { font: 800 18px var(--ui-font-display); color: var(--ink); }
body .ss-profile-empty span { font-size: 13px; color: var(--muted); }
body .ss-profile:has(.ss-profile-section) .ss-profile-empty,
body .ss-profile:has(#ssActivitySection) .ss-profile-empty { display: none; }
body .ss-profile-legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
body .ss-profile-legal .ss-legal-nav { justify-content: flex-start; flex-wrap: nowrap; margin: 0; overflow-x: auto; }

/* ---------- 6) Profil pencereleri ---------- */
body #followListModal > div:last-child, body #followRequestsModal > div:last-child,
body #profileEditModal > div:last-child, body #passwordModal > div:last-child { border-radius: 30px 30px 0 0; }
@media (min-width: 640px) {
  body #followListModal > div:last-child, body #followRequestsModal > div:last-child,
  body #profileEditModal > div:last-child, body #passwordModal > div:last-child { border-radius: 30px; }
}

/* Video veri beklerken ince yükleniyor halkası (app.js .ss-buffering sınıfını koyar) */
body .ss-buffering::after { content: ""; position: absolute; top: 50%; left: 50%; z-index: 25; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fcb140; border-radius: 50%; pointer-events: none; animation: ui-spin .7s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
