/* shorts/social.css — Shorts action rail + glass social panel.
   Shared by shorts/index.php (feed) and shorts/watch.php (permalink).
   Both previously carried their own copy of the rail styles; this file is
   now the only source. */

/* ── Action rail ─────────────────────────────────────────────────── */
.ss-actions {
  position: absolute; right: 8px; bottom: 100px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ss-avatar-wrap { position: relative; margin-bottom: 6px; }

/* Caption — bottom-left, TikTok-style: name (photo lives on the rail avatar
   at the top of .ss-actions instead — corrected 2026-08-19, an earlier pass
   wrongly put the avatar photo down here too), a text "· Follow" link next
   to the name (a second affordance for the same follow target as the rail
   avatar badge — kept in sync by doFollow()/setFollowState() in social.js),
   and the short's title, clamped to 2 lines with a Show more/less toggle. */
.ss-caption {
  position: absolute; left: 12px; bottom: 80px; z-index: 3;
  max-width: calc(100% - 80px);
  display: flex; flex-direction: column; gap: 4px;
}
.ss-caption-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ss-caption-name {
  color: #fff; font-size: .85rem; font-weight: 700; text-decoration: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.ss-caption-sep { color: rgba(255,255,255,.5); font-size: .8rem; flex-shrink: 0; }
/* Font/layout properties only — the icon-badge overrides (position,
   background, width/height) live further down next to .ss-follow-badge,
   using the higher-specificity .ss-follow-badge.ss-caption-follow selector
   so they reliably win over that base rule regardless of source order. */
.ss-caption-follow {
  flex-shrink: 0; padding: 0;
  font: inherit; font-size: .85rem; font-weight: 800;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ss-caption-title {
  color: rgba(255,255,255,.92); font-size: .8rem; line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ss-caption-title.ss-expanded { -webkit-line-clamp: unset; overflow: visible; }
.ss-caption-more {
  align-self: flex-start; background: none; border: none; padding: 0; margin-top: 1px;
  color: rgba(255,255,255,.65); font-size: .72rem; font-weight: 700;
  text-decoration: underline; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ss-caption-credit {
  display: block; margin-top: 2px;
  font-size: .74rem; color: rgba(255,255,255,.55);
  text-decoration: none;
}
.ss-caption-credit:hover { color: rgba(255,255,255,.8); text-decoration: underline; }
.ss-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,.9); display: block;
}
.ss-follow-badge {
  position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  width: 21px; height: 21px; padding: 0; border: none; border-radius: 50%;
  background: var(--green, #01FF95); color: #07070d;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ss-follow-badge svg { fill: currentColor; }
.ss-follow-badge.ss-following { background: rgba(255,255,255,.28); color: #fff; }
/* .ss-caption-follow shares the .ss-follow-badge CLASS (for click-handler
   reuse — see social_rail.php) but is a text link, not a circular icon
   badge. Two-class selector so this reliably wins over the base
   .ss-follow-badge rule above regardless of source order. */
.ss-follow-badge.ss-caption-follow {
  position: static; transform: none; width: auto; height: auto;
  background: none; color: var(--green, #01FF95);
}
.ss-follow-badge.ss-caption-follow.ss-following { background: none; color: rgba(255,255,255,.85); }

.ss-action-item { display: flex; flex-direction: column; align-items: center; gap: 0px; margin-bottom: 4px; }
.ss-count { color: #fff; font-size: .65rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.7); line-height: 1; margin-top: -1px; }

.ss-btn {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 50%; color: #fff;
  cursor: pointer; transition: background .15s, transform .12s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.ss-btn svg { width: 26px; height: 26px; fill: currentColor; filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); }
/* No :hover background at all (2026-08-19, explicit request): touch devices
   fire a synthetic :hover on tap with no corresponding hover-out event, so
   it can visually "stick" on whatever was last tapped until something else
   is tapped — reading exactly like the semi-transparent background that was
   supposedly already removed. :active (below) is the real touch feedback. */
.ss-btn:active { transform: scale(.9); }
.ss-btn.ss-liked { color: #ff4060; }
.ss-btn.ss-saved { color: var(--green, #01FF95); }
.ss-mute .ss-icon-on { display: none; }
.ss-mute.ss-audio-on .ss-icon-off { display: none; }
.ss-mute.ss-audio-on .ss-icon-on { display: block; }

/* ── Glass panels (Share + More) — horizontal row ──────────────────── */
.ss-share-menu[hidden], .ss-more-menu[hidden] { display: none !important; }
.ss-share-menu, .ss-more-menu {
  z-index: 70; display: flex; flex-direction: row; gap: 8px; padding: 8px;
  background: rgba(20,20,30,.75);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
.ss-share-menu a, .ss-share-menu button,
.ss-more-menu button {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.08); color: #fff;
  text-decoration: none; border: none; cursor: pointer; padding: 0;
  transition: background .15s;
}
.ss-share-menu a:hover, .ss-share-menu button:hover,
.ss-more-menu button:hover { background: rgba(255,255,255,.18); }
.ss-share-menu a svg, .ss-share-menu button svg,
.ss-more-menu button svg { width: 20px; height: 20px; fill: currentColor; }
.ss-share-copy svg { fill: none !important; }

/* ── Glass panel ─────────────────────────────────────────────────── */
.ss-panel {
  position: fixed; z-index: 60;
  background: rgba(18,18,28,.62);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,.14);
  display: flex; flex-direction: column;
  color: #fff;
  transition: transform .28s cubic-bezier(.32,.72,0,1);
}
.ss-panel[hidden] { display: none; }

/* Mobile: bottom sheet. The video keeps playing in the strip above. */
@media (max-width: 899px) {
  .ss-panel {
    left: 0; right: 0; bottom: 0; height: 62vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none; border-left: none; border-right: none;
    box-shadow: 0 -8px 34px rgba(0,0,0,.55);
    transform: translateY(100%);
  }
  .ss-panel.ss-open { transform: translateY(0); }
  .ss-grabber {
    width: 36px; height: 4px; border-radius: 4px;
    background: rgba(255,255,255,.28); margin: 9px auto 0; flex-shrink: 0;
  }
}

/* Desktop: right-side dock. */
@media (min-width: 900px) {
  .ss-panel {
    top: 0; right: 0; bottom: 0; width: 380px;
    border-radius: 0; border-right: none;
    box-shadow: -8px 0 34px rgba(0,0,0,.55);
    transform: translateX(100%);
  }
  .ss-panel.ss-open { transform: translateX(0); }
  .ss-grabber { display: none; }
  /* The feed has a 3-column layout; the dock takes the right sidebar's place
     so the video stays centred instead of being squeezed by a 4th column.
     shorts/watch.php has no sidebars, so this simply does nothing there. */
  body.ss-panel-open .shorts-creators { display: none; }
}

.ss-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 15px 10px; flex-shrink: 0;
}
.ss-panel-title { font-size: .92rem; font-weight: 800; }
.ss-panel-close {
  background: none; border: none; color: rgba(255,255,255,.55);
  cursor: pointer; padding: 4px; display: flex;
}
.ss-panel-close svg { fill: currentColor; }
.ss-panel-body { flex: 1; overflow-y: auto; padding: 0 15px; }
.ss-panel-foot { flex-shrink: 0; padding: 10px 12px calc(12px + env(safe-area-inset-bottom,0px)); }

/* ── Comments ────────────────────────────────────────────────────── */
.ss-c-item { display: flex; gap: 9px; margin-bottom: 15px; }
.ss-c-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: rgba(255,255,255,.12); }
.ss-c-main { flex: 1; min-width: 0; }
.ss-c-meta { color: rgba(255,255,255,.5); font-size: .7rem; margin-bottom: 2px; }
.ss-c-user { color: rgba(255,255,255,.8); font-weight: 700; }
.ss-c-text { font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; }
.ss-c-acts { display: flex; gap: 13px; margin-top: 4px; color: rgba(255,255,255,.45); font-size: .72rem; }
.ss-c-acts button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.ss-c-acts button:hover { color: #fff; }
.ss-c-empty, .ss-c-error { text-align: center; color: rgba(255,255,255,.45); padding: 26px 0; font-size: .84rem; }

/* Compose */
.ss-compose { display: flex; gap: 8px; align-items: flex-end; }
.ss-compose textarea {
  flex: 1; min-height: 40px; max-height: 120px; resize: none;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px; color: #fff; font: inherit; font-size: .84rem;
  padding: 10px 13px; outline: none;
}
.ss-compose textarea:focus { border-color: var(--green, #01FF95); }
.ss-compose-send {
  width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: 50%;
  background: var(--green, #01FF95); color: #07070d;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.ss-compose-send svg { fill: currentColor; }
.ss-compose-send:disabled { opacity: .4; cursor: default; }
.ss-inline-err { color: #ff6b81; font-size: .76rem; margin-bottom: 6px; }

/* ── Inline auth (Phase 3) ───────────────────────────────────────── */
.ss-auth { padding: 14px; border-radius: 15px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13); }
.ss-auth-title { font-size: .9rem; font-weight: 800; text-align: center; margin-bottom: 3px; }
.ss-auth-sub { font-size: .76rem; color: rgba(255,255,255,.55); text-align: center; margin-bottom: 12px; }
/* Grid, not flex: an earlier flex:1-based fix was reported still showing an
   uneven split (2026-08-19). Grid's 1fr columns guarantee a true 50/50 split
   with no flex-basis/content-width ambiguity to fight — a more robust
   mechanism for exactly two equal-width buttons than flex was. */
.ss-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 11px; }
.ss-auth-tab { width: 100%; padding: 8px 0; border: none; border-radius: 9px; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.ss-auth-tab.ss-active { background: var(--green, #01FF95); color: #07070d; }
.ss-auth input {
  width: 100%; margin-bottom: 8px; padding: 10px 12px;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.13);
  border-radius: 9px; color: #fff; font: inherit; font-size: .82rem; outline: none;
}
.ss-auth input:focus { border-color: var(--green, #01FF95); }
.ss-auth-submit {
  width: 100%; padding: 11px 0; border: none; border-radius: 9px;
  background: var(--green, #01FF95); color: #07070d;
  font: inherit; font-weight: 800; font-size: .84rem; cursor: pointer;
}
.ss-auth-submit:disabled { opacity: .5; cursor: default; }
/* Cloudflare renders the widget at a fixed native width (~300px); the
   dock (380px) and a narrow phone in mobile-sheet mode can both be tighter
   than that once the panel's own padding is subtracted. */
.ss-auth-form .cf-turnstile { margin-bottom: 8px; max-width: 100%; overflow: hidden; }
.ss-auth-divider { text-align: center; color: rgba(255,255,255,.35); font-size: .72rem; margin: 11px 0; }
.ss-auth-benefits { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ss-auth-benefits li { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: rgba(255,255,255,.75); }
.ss-auth-benefits li svg { flex-shrink: 0; fill: var(--green, #01FF95); }

/* ── Report form (Phase 4) ───────────────────────────────────────── */
.ss-report-reason { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.ss-report-reason label { display: flex; align-items: center; gap: 9px; font-size: .82rem; cursor: pointer; }

/* Blur is GPU-expensive over playing video on low-end Android. Drop it (not
   the panel) when the user has asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .ss-panel { transition: none; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(14,14,22,.95); }
  .ss-btn { transition: none; }
}
