/**
 * SwissFans 3.0 — Final Premium Polish
 * UI only. Preserve IDs, data-*, handlers, business logic.
 */

/* ------------------------------------------------------------------ */
/* Overlay-Trigger-Anker (systemischer Fix, Overlay-/Dropdown-Audit)   */
/*                                                                      */
/* inora.js haengt AJAX-Panels (Benachrichtigungen, Nachrichten,        */
/* Nutzermenue, Punkte/Coins-Widget) per .append() direkt als Kind-     */
/* Element in den auslösenden Icon-Button. Ohne "position: relative"    */
/* auf dem Button selbst bestimmt ein weiter aussen liegendes Element   */
/* (z.B. die volle Kopfzeile) das "containing block" fuer die           */
/* absolut positionierten Panels — top/right/Breite berechnen sich dann */
/* falsch. Diese Regel macht jeden bekannten Trigger-Button selbst zum  */
/* Anker, ohne sein Erscheinungsbild zu veraendern (position: relative  */
/* ohne Offset hat keinen visuellen Effekt auf den Button selbst).      */
/* ------------------------------------------------------------------ */
.i_header_btn_item,
.sf-top-bar__wallet,
.sf-top-bar__btn {
  position: relative;
}

/* Global SwissCoin chip icon (home already styles this; other pages were missing it) */
.sf-top-bar__wallet {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.7rem;
  min-height: 40px;
  border-radius: 9999px;
  box-sizing: border-box;
}

.sf-top-bar__wallet-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: rgba(225, 34, 146, 0.18);
  color: #e12292;
}

.sf-top-bar__wallet-icon svg {
  width: 14px !important;
  height: 14px !important;
  display: block;
  fill: currentColor !important;
  stroke: none !important;
  color: inherit;
}

.sf-top-bar__wallet-value {
  display: inline-block;
  font-weight: 650;
  font-size: 0.8rem;
  line-height: 1;
  color: #f7eef8;
}

/* ------------------------------------------------------------------ */
/* Brand mark                                                          */
/* ------------------------------------------------------------------ */

.sf-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #fff;
  text-decoration: none;
  line-height: 0;
}

/* Official PNG logo — height-scaled; dark plate removed via lighten blend on dark UI */
.sf-brand__img {
  display: block;
  width: auto;
  height: 36px;
  object-fit: contain;
  background: transparent;
  border: 0;
}

.sf-brand--sm .sf-brand__img { height: 32px; }
.sf-brand--md .sf-brand__img { height: 40px; }
.sf-brand--lg .sf-brand__img { height: 52px; }

@media (min-width: 768px) {
  .sf-brand--sm .sf-brand__img { height: 36px; }
  .sf-brand--md .sf-brand__img { height: 44px; }
  .sf-brand--lg .sf-brand__img { height: 58px; }
}

/* Compact sidebar: slightly smaller */
.sf-sidebar__brand { gap: 0; padding: 0.75rem 1rem; }
.sf-sidebar__brand .sf-brand__img { height: 34px; }
@media (min-width: 768px) and (max-width: 1199px) {
  .sf-sidebar__brand .sf-brand__img { height: 30px; }
}

.sf-top-bar__brand { display: inline-flex; align-items: center; text-decoration: none; }
.sf-top-bar__logo-mobile,
.sf-sidebar__logo,
.sf-sidebar__wordmark,
.sf-top-bar__title { display: none !important; }

.sf-auth__logo-link,
.sf-landing__brand-link,
.sf-brand-link {
  display: inline-flex;
  text-decoration: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sf-landing__logo,
.sf-landing__footer-logo,
.sf-auth__logo { display: none !important; }

.sf-header-brand .sf-brand__img { height: 34px; }
.i_logo_ img.i_logo { display: none !important; }

/* Legacy SVG/wordmark classes (no longer emitted) — keep harmless */
.sf-brand__icon,
.sf-brand__word { display: none !important; }

/* ------------------------------------------------------------------ */
/* Hide online / last-seen UI (backend untouched)                      */
/* ------------------------------------------------------------------ */

.sf-cp-activity,
.sf-cp-activity--muted,
.i_p_lpt_online,
.i_p_lpt_offline,
.userIsOnline,
.userIsOffline,
.c_u_time,
.conversation_box_header .c_u_time,
.i_p_last_login,
.last_seen,
.lastSeen,
.online_status {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* ------------------------------------------------------------------ */
/* Emoji picker — modern popover (same hooks)                          */
/* ------------------------------------------------------------------ */

.emojiBox,
.emojiBoxC,
.i_pb_emojis .emojiBox,
.i_pb_emojisBox .emojiBox {
  position: absolute !important;
  z-index: 80 !important;
  width: min(340px, calc(100% - 1.5rem)) !important;
  max-height: min(360px, 55vh) !important;
  overflow: auto !important;
  padding: 0.65rem !important;
  border-radius: 16px !important;
  border: 1px solid rgba(225, 34, 146, 0.25) !important;
  background: #181025 !important;
  box-shadow: 0 18px 40px rgba(8, 2, 18, 0.55) !important;
  color: #fff !important;
}

.emojis_Container {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.emTitle {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 0.35rem !important;
  padding: 0.35rem 0.45rem !important;
  border-radius: 999px;
  background: rgba(225, 34, 146, 0.14) !important;
  color: #ff8fd0 !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}

.emoji_item,
.emoji_item_c,
.emoji_item_m {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 42px !important;
  height: 42px !important;
  margin: 0.1rem !important;
  border-radius: 10px !important;
  font-size: 1.45rem !important;
  line-height: 1 !important;
  cursor: pointer;
  background: transparent !important;
}

.emoji_item:hover,
.emoji_item_c:hover,
.emoji_item_m:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.sf-emoji-search-wrap {
  display: block;
  margin: 0 0 0.45rem;
}

.sf-emoji-search {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.88rem;
}

.sf-emoji-search:focus {
  outline: 2px solid rgba(225, 34, 146, 0.65);
  outline-offset: 1px;
}

@media (max-width: 767px) {
  .emojiBox,
  .emojiBoxC {
    position: fixed !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    max-height: min(48vh, 380px) !important;
  }
}

/* ------------------------------------------------------------------ */
/* Messenger mobile — force single column, kill legacy offsets         */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
  body.sf-messenger-v2 .wrapper,
  body.sf-messenger-v2 .i_chat_wrapper,
  body.sf-messenger-v2 .chat_right_container,
  body.sf-messenger-v2 .chat_middle_wrapper,
  body.sf-messenger-v2 .chat_left_container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    float: none !important;
  }

  body.sf-messenger-v2 .i_chat_wrapper {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    height: calc(100dvh - 56px) !important;
    min-height: 0 !important;
  }

  body.sf-messenger-v2 .chat_left_container {
    display: none !important;
  }

  body.sf-messenger-v2 .chat_left_container.chatDisplay {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 90 !important;
    background: #0e071a !important;
    padding-top: env(safe-area-inset-top, 0px);
  }

  body.sf-messenger-v2 .chat_right_container,
  body.sf-messenger-v2 .chat_middle_container {
    position: relative !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
    align-items: stretch !important;
  }
}

/* ------------------------------------------------------------------ */
/* Notifications / points / messages — compact under topbar (mobile)   */
/* Full-bleed sheets covered the navbar (z-index 2000) so topbar taps  */
/* stopped working after opening a panel. Keep topbar clickable.       */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
  body.sf-ui-consistency-v2 .i_general_box_notifications_container.generalBox,
  body.sf-notifications-v2 .i_general_box_notifications_container.generalBox,
  .i_general_box_notifications_container.generalBox,
  body.sf-ui-consistency-v2 .i_general_box_message_notifications_container.generalBox,
  .i_general_box_message_notifications_container.generalBox,
  body.sf-ui-consistency-v2 .i_general_box_container.generalBox,
  .i_general_box_container.generalBox {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 62px) !important;
    right: 10px !important;
    left: 10px !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: min(52vh, 420px) !important;
    margin: 0 !important;
    transform: none !important;
    border-radius: 16px !important;
    z-index: 2000 !important;
    overflow: hidden !important;
    background: #1c0f1f !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
  }

  .i_general_box_notifications_container.generalBox .btest,
  .i_general_box_message_notifications_container.generalBox .btest,
  .i_general_box_container.generalBox .btest {
    overflow-y: auto !important;
  }

  body.sf-notifications-v2 .wrapper,
  body.sf-notifications-v2 .pageMiddle,
  body.sf-notifications-v2 .th_middle {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    float: none !important;
    overflow-x: clip !important;
  }
}

/* ------------------------------------------------------------------ */
/* Creator discovery — no clip on infinite list                        */
/* ------------------------------------------------------------------ */

body.sf-creator-discovery-v2 #moreType.sf-cd-grid,
body.sf-creator-discovery-v2 .sf-cd-grid.creators_list_container {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  overflow-y: visible !important;
}

body.sf-creator-discovery-v2 .sf-cd-card,
body.sf-creator-discovery-v2 .creator_list_box_wrp {
  min-height: 280px;
}

/* ------------------------------------------------------------------ */
/* Global overflow / white kill / button consistency                   */
/* ------------------------------------------------------------------ */

html,
body {
  overflow-x: clip;
}

body.sf-ui-consistency-v2 .wrapper,
body.sf-app-body .sf-app-shell {
  overflow-x: clip;
}

@media (max-width: 767px) {
  body.sf-ui-consistency-v2 .th_middle,
  body.sf-ui-consistency-v2 .pageMiddle,
  body.sf-ui-consistency-v2 .leftSticky {
    margin-left: 0 !important;
    left: 0 !important;
    transform: none !important;
  }
}
