/* Bombo creator profile page: slide-in overlay + TikTok-style post grid.
   Loaded by index.html. Self-contained: it carries every rule the #profileModal overlay needs. */

/* =========================================================
   FEED PROFILE OVERLAY
   Independent of Artist. Opened only from a feed account tap.
========================================================= */
/* Slides in from the right (like opening a profile in TikTok) and slides back out on close.
   It stays in the layout but is hidden + not clickable while closed. */
.profile-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 50000;
  display: block;
  background: #000;
  color: #fff;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(100%, 0, 0);
  transition: transform .32s cubic-bezier(.22, .8, .26, 1), visibility 0s linear .32s;
  will-change: transform;
}
.profile-fullscreen.open {
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition: transform .32s cubic-bezier(.22, .8, .26, 1), visibility 0s linear 0s;
}
@media (prefers-reduced-motion: reduce) {
  .profile-fullscreen, .profile-fullscreen.open { transition: none; }
}
.profile-modal-body {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #000;
}
.profile-screen {
  width: 100%;
  min-height: 100%;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  background: #000;
  box-sizing: border-box;
}
.profile-screen .profile-back-btn {
  position: sticky;
  top: 0;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.profile-screen .tiktok-profile-container { width:100%; max-width:900px; margin:0 auto; }
.profile-business-cover {
  width: 100%;
  height: clamp(150px, 30vw, 270px);
  border-radius: 18px;
  background-color: #111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
}
.profile-avatar-over-cover {
  position: relative;
  z-index: 3;
  height: 0;
  display: flex;
  justify-content: center;
}
.profile-avatar-over-cover .tiktok-avatar-wrapper {
  width: 100px;
  height: 100px;
  margin-top: -50px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #000;
  box-shadow: 0 2px 16px rgba(0,0,0,.65);
  background: #111;
}
.profile-avatar-over-cover .tiktok-avatar { width:100%; height:100%; object-fit:cover; display:block; }
.profile-screen .tiktok-header {
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:62px 0 18px;
  border-bottom:1px solid rgba(255,255,255,.12);
}
.profile-screen .tiktok-username { margin:0; color:#fff; font-size:1.3rem; font-weight:800; }
.profile-screen .tiktok-handle { color:rgba(255,255,255,.65); font-size:.88rem; margin:5px 0 14px; }
.profile-screen .tiktok-stats { display:flex; justify-content:center; gap:32px; margin-bottom:14px; }
.profile-screen .stat-item { display:flex; flex-direction:column; align-items:center; }
.profile-screen .stat-item strong { color:#fff; font-size:1rem; }
.profile-screen .stat-item span { color:rgba(255,255,255,.6); font-size:.72rem; }
.profile-screen .tiktok-actions.centered { display:flex; justify-content:center; align-items:center; gap:10px; margin-bottom:12px; width:100%; }
.profile-screen .profile-follow-btn,
.profile-screen .profile-visit-btn {
  position:relative; overflow:hidden; min-width:126px; height:46px;
  padding:0 22px; border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid transparent;
  font-size:.88rem; font-weight:800; letter-spacing:.01em;
  cursor:pointer; isolation:isolate;
  transition:transform .18s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
  will-change:transform;
}
.profile-screen .profile-follow-btn {
  color:#fff;
  background:linear-gradient(135deg,#ff1744 0%,#e60023 55%,#b8001c 100%);
  border-color:rgba(255,255,255,.14);
  box-shadow:0 9px 24px rgba(230,0,35,.28);
}
.profile-screen .profile-follow-btn.following {
  color:#111;
  background:linear-gradient(135deg,#ffd84d 0%,#ffbf00 100%);
  border-color:rgba(255,216,77,.5);
  box-shadow:0 9px 24px rgba(255,191,0,.22);
}
.profile-screen .profile-visit-btn {
  color:#111;
  background:linear-gradient(135deg,#fff 0%,#f1f1f1 52%,#d8d8d8 100%);
  border-color:rgba(255,255,255,.5);
  box-shadow:0 9px 24px rgba(0,0,0,.28);
}
.profile-screen .profile-follow-btn:not(.following) { animation:profileFollowPulse 2.8s ease-in-out infinite; }
.profile-screen .profile-follow-btn:hover, .profile-screen .profile-visit-btn:hover { transform:translateY(-2px); }
.profile-screen .profile-follow-btn:active, .profile-screen .profile-visit-btn:active { transform:scale(.95); }
.profile-screen .profile-follow-btn::after, .profile-screen .profile-visit-btn::after {
  content:""; position:absolute; inset:0; z-index:-1;
  background:linear-gradient(110deg,transparent 22%,rgba(255,255,255,.38) 50%,transparent 78%);
  transform:translateX(-125%); animation:profileButtonShine 3.4s ease-in-out infinite; pointer-events:none;
}
@keyframes profileFollowPulse { 0%,100% { box-shadow:0 9px 24px rgba(230,0,35,.28); } 50% { box-shadow:0 9px 24px rgba(230,0,35,.28), 0 0 0 6px rgba(230,0,35,.08); } }
@keyframes profileButtonShine { 0%,55%,100% { transform:translateX(-125%); } 70% { transform:translateX(125%); } }
@media (prefers-reduced-motion: reduce) { .profile-screen .profile-follow-btn:not(.following), .profile-screen .profile-follow-btn::after, .profile-screen .profile-visit-btn::after { animation:none; } }
.profile-screen .tiktok-bio { width:100%; color:rgba(255,255,255,.78); font-size:.86rem; line-height:1.4; }
.profile-screen .tiktok-content-tabs { display:flex; justify-content:center; border-bottom:1px solid rgba(255,255,255,.12); margin:12px 0 16px; }
.profile-screen .tt-tab { background:transparent; border:0; color:#fff; padding:10px 28px; font-weight:800; cursor:pointer; border-bottom:2px solid #fff; }
.profile-screen .tiktok-posts-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  width:100%;
  padding:0 0 24px;
}
.profile-screen .tiktok-post-card {
  min-width:0;
  background:#111;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  overflow:hidden;
  cursor:pointer;
}
.profile-screen .post-cover {
  width:100%;
  aspect-ratio: 9 / 13;
  min-height:0;
  background-size:cover;
  background-position:center;
  position:relative;
}
.profile-screen .post-overlay-info { position:absolute; left:7px; bottom:7px; background:rgba(0,0,0,.62); border-radius:6px; padding:3px 6px; }
.profile-screen .post-views { color:#fff; font-size:.68rem; font-weight:700; }
.profile-screen .post-title { margin:0; padding:9px 10px 4px; color:#fff; font-size:.8rem; font-weight:700; line-height:1.25; }
.profile-screen .post-description { margin:0; padding:0 10px 10px; color:rgba(255,255,255,.65); font-size:.68rem; line-height:1.35; }
.profile-screen .post-description em { font-style:italic; }
.profile-screen .profile-empty-posts { grid-column:1/-1; padding:40px 20px; text-align:center; color:rgba(255,255,255,.55); }
@media (max-width:520px) {
  .profile-screen { padding-left:12px; padding-right:12px; }
  .profile-screen .tiktok-posts-grid { gap:10px; }
  .profile-screen .post-title { font-size:.75rem; }
}

/* =========================================================
   CREATOR PROFILE GRID (TikTok style: tight 3-column thumbnails)
   Only used for Bombo accounts - YouTube profiles keep the 2-column cards.
========================================================= */
.profile-modal-body { overscroll-behavior: contain; }
.profile-screen .tiktok-bio { padding: 0 8px; box-sizing: border-box; }
.profile-screen .tiktok-bio p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

.profile-screen .tiktok-posts-grid.bombo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 0 0 24px;
}
@media (min-width: 720px) {
  .profile-screen .tiktok-posts-grid.bombo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.bp-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bp-tile video, .bp-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.bp-tile::after {                      /* soft shade so the view count stays readable on bright thumbnails */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
  pointer-events: none;
}
.bp-tile:active { opacity: .82; }
.bp-tile:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.bp-views {
  position: absolute;
  left: 7px;
  bottom: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.85);
  pointer-events: none;
}
.bp-views i { font-size: .62rem; }
.bp-skeleton {
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  background: linear-gradient(100deg, #141414 30%, #222 50%, #141414 70%);
  background-size: 200% 100%;
  animation: bpShimmer 1.2s linear infinite;
}
@keyframes bpShimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .bp-skeleton { animation: none; } }
.bp-more { grid-column: 1 / -1; text-align: center; padding: 14px 0 4px; }
.bp-more-btn {
  min-width: 140px;
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
}
.bp-more-btn:disabled { opacity: .6; cursor: default; }
.bp-more-btn:active { transform: scale(.97); }
.profile-empty-posts .bp-more-btn { margin-top: 12px; }

/* =========================================================
   TILE MENU + DELETE / REPORT SHEET
========================================================= */
.bp-cell { position: relative; min-width: 0; }
.bp-menu-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bp-menu-btn::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .42);
}
.bp-dots {
  position: relative;
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: -7px 0 0 #fff, 7px 0 0 #fff;
}
.bp-menu-btn:active::before { background: rgba(0, 0, 0, .65); }
.bp-menu-btn:focus-visible { outline: 2px solid #fff; outline-offset: -4px; border-radius: 8px; }

.bp-sheet { position: absolute; inset: 0; z-index: 20; }
.bp-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); animation: bpFade .2s ease-out; }
.bp-sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  max-height: 88%;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #1c1c1e;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
  animation: bpRise .26s cubic-bezier(.22, .8, .26, 1);
}
.bp-sheet-title { margin: 0 0 6px; text-align: center; font-size: 1.05rem; font-weight: 800; color: #fff; }
.bp-sheet-note { margin: 0 0 14px; text-align: center; font-size: .9rem; line-height: 1.4; color: rgba(255, 255, 255, .7); }
.bp-sheet-error { margin: 12px 0 0; text-align: center; font-size: .88rem; font-weight: 700; color: #ff6b78; }
.bp-sheet-btn {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 8px 0 0;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .09);
  color: #fff;
  font: inherit;
  font-size: .96rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bp-sheet-btn:active { background: rgba(255, 255, 255, .16); }
.bp-sheet-btn:disabled { opacity: .55; cursor: default; }
.bp-sheet-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bp-sheet-btn.bp-reason { text-align: left; font-weight: 600; }
.bp-sheet-btn.bp-danger { color: #ff4d5e; }
@keyframes bpRise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes bpFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bp-sheet-panel, .bp-sheet-backdrop { animation: none; } }
