/* Fase 8: consistent public profiles, focused catalog and polished surfaces. */

/* The former informational footer is intentionally absent from every route.
   The fixed mobile navigation remains the primary navigation control. */
.phase-eight .site-footer { display: none !important; }

/* Both the owner and visitors render the same profile template. Keeping the
   avatar above the cover in the shared CSS prevents two different layouts. */
.phase-eight .modern-profile .person-header {
  margin-top: -72px;
  position: relative;
  z-index: 3;
}

.phase-eight .modern-profile .person-avatar-wrap > img {
  box-shadow: 0 12px 30px rgb(17 27 44 / .18);
}

.phase-eight .business-profile .business-profile-main {
  margin-top: -72px;
  position: relative;
  z-index: 3;
}

.phase-eight .business-profile .profile-identity {
  position: relative;
  z-index: 1;
}

/* The type filter is still supported in routes and search logic, but it is no
   longer shown as four repeated buttons in public catalogs. */
.phase-eight :is(.business-profile .offer-type-tabs, .search-page .offer-type-tabs) {
  display: none !important;
}

/* Product detail: remove remaining white cards and low-contrast text in dark mode. */
html[data-theme="dark"] .phase-eight .detail-page :is(
  .detail-media,
  .detail-media-main,
  .detail-thumbs button,
  .seller-box,
  .direct-sale-note,
  .safety-note,
  .status-banner,
  .offer-details > div
) {
  color: var(--hc-text);
  border-color: var(--hc-border) !important;
  background: var(--hc-surface) !important;
  box-shadow: none;
}

html[data-theme="dark"] .phase-eight .detail-page :is(.seller-box small, .detail-info > p, .direct-sale-note span, .safety-note span, .offer-details dt) {
  color: var(--hc-text-2) !important;
}

html[data-theme="dark"] .phase-eight .detail-page .detail-price { color: #ff9abb; }
html[data-theme="dark"] .phase-eight .detail-page .seller-box > b { color: var(--hc-brand); }
html[data-theme="dark"] .phase-eight .detail-page .detail-media { background: #0b1018 !important; }

/* Notifications use the same readable surface both in the dedicated page and drawer. */
html[data-theme="dark"] .phase-eight :is(.notifications-page, .notification-drawer) .notification-row {
  color: var(--hc-text);
  border-color: var(--hc-border);
  background: var(--hc-surface);
}

html[data-theme="dark"] .phase-eight :is(.notifications-page, .notification-drawer) .notification-row.unread {
  border-color: color-mix(in srgb, var(--hc-brand) 55%, var(--hc-border));
  background: color-mix(in srgb, var(--hc-brand-soft) 68%, var(--hc-surface));
}

html[data-theme="dark"] .phase-eight :is(.notifications-page, .notification-drawer) .notification-row :is(p, small) {
  color: var(--hc-text-2) !important;
}

html[data-theme="dark"] .phase-eight :is(.notifications-page, .notification-drawer) .notification-row > span:not(:has(img)) {
  color: var(--hc-brand);
  background: var(--hc-surface-2);
}

/* Messenger receives its own header tone only while the Messenger route is open. */
.phase-eight.chat-route .app-header,
.phase-eight.chat-route .app-header .topbar-inner {
  color: var(--msg-text);
  border-color: var(--msg-line) !important;
  background: radial-gradient(ellipse at 92% -120%, rgb(219 96 176 / .22), transparent 58%), var(--msg-side) !important;
}

.phase-eight.chat-route .app-header :is(.brand, .brand strong, .mobile-header-actions > a, .header-menu-toggle, .header-round-action) {
  color: var(--msg-text) !important;
}

.phase-eight.chat-route .app-header :is(.mobile-header-actions > a, .header-menu-toggle, .header-round-action) {
  border: 1px solid var(--msg-line) !important;
  border-radius: 12px;
  background: var(--msg-surface) !important;
  box-shadow: 0 5px 14px rgb(59 34 75 / .08);
}

.phase-eight.chat-route .app-header .notification-trigger b {
  color: #fff;
  border-color: var(--msg-surface);
  background: var(--msg-pink);
}

.phase-eight.chat-route .app-header .top-search {
  border-color: var(--msg-line) !important;
  background: var(--msg-surface) !important;
}

.phase-eight.chat-route .app-header .top-search :is(input, .search-icon) { color: var(--msg-text) !important; }

/* Symmetric quick actions with distinctive, useful color cues. */
.phase-eight .new-chat-dialog {
  width: min(440px, calc(100% - 28px));
  overflow: hidden;
  padding: 22px;
}

.phase-eight .new-chat-dialog header { margin-bottom: 12px; }

.phase-eight .new-chat-choice {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  min-height: 78px;
  gap: 14px;
  margin: 0;
  padding: 12px 4px !important;
  border-radius: 15px;
  border-bottom: 1px solid var(--msg-line) !important;
  transition: background .18s ease, transform .18s ease;
}

.phase-eight .new-chat-choice:hover,
.phase-eight .new-chat-choice:focus-visible {
  background: var(--msg-elevated);
  transform: translateX(3px);
}

.phase-eight .new-chat-choice > .app-icon {
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: 15px;
}

.phase-eight .new-chat-choice[data-new-chat-choice="message"] > .app-icon { color: #1674b7; background: #e1f2ff; }
.phase-eight .new-chat-choice[data-new-chat-choice="group"] > .app-icon { color: #7a43b3; background: #efe2ff; }
.phase-eight .new-chat-choice[data-new-chat-choice="community"] > .app-icon { color: #bd3d82; background: #ffe2f0; }
.phase-eight .new-chat-choice > b { justify-self: end; color: var(--msg-purple); }

html[data-theme="dark"] .phase-eight .new-chat-choice[data-new-chat-choice="message"] > .app-icon { color: #8ed4ff; background: #17384f; }
html[data-theme="dark"] .phase-eight .new-chat-choice[data-new-chat-choice="group"] > .app-icon { color: #d9adff; background: #36244a; }
html[data-theme="dark"] .phase-eight .new-chat-choice[data-new-chat-choice="community"] > .app-icon { color: #ffb1d5; background: #4a233b; }

/* One shared, gentle entrance for floating option panels. */
@keyframes hc-float-in {
  from { opacity: 0; transform: translateY(14px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hc-choice-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.phase-eight :is(.new-chat-dialog, .message-context-dialog, .feed-tools-dialog, .profile-photo-dialog, .global-search-dialog, .share-dialog)[open] {
  animation: hc-float-in .24s cubic-bezier(.2, .8, .2, 1) both;
}

.phase-eight .new-chat-dialog[open] .new-chat-choice {
  animation: hc-choice-in .32s cubic-bezier(.2, .8, .2, 1) both;
}

.phase-eight .new-chat-dialog[open] .new-chat-choice[data-new-chat-choice="group"] { animation-delay: .05s; }
.phase-eight .new-chat-dialog[open] .new-chat-choice[data-new-chat-choice="community"] { animation-delay: .1s; }

.phase-eight .header-mobile-menu:not([hidden]) .header-mobile-menu-card,
.phase-eight .notification-drawer:not([hidden]) > section {
  animation: hc-float-in .24s cubic-bezier(.2, .8, .2, 1) both;
}

/* Published-media overview. Direct-message and private-community attachments are never rendered here. */
.admin-media-card { min-width: 0; }
.admin-media-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 20px; }
.admin-media-summary > div { min-width: 0; padding: 14px; border: 1px solid var(--hc-border); border-radius: 14px; background: var(--hc-surface-2); }
.admin-media-summary strong { display: block; font-size: 23px; color: var(--hc-text); }
.admin-media-summary span { display: block; margin-top: 4px; color: var(--hc-text-2); font-size: 11px; }
.admin-media-groups { display: grid; gap: 18px; }
.admin-media-group { min-width: 0; }
.admin-media-group > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.admin-media-group > header h3 { margin: 0; font-size: 16px; }
.admin-media-group > header small { color: var(--hc-text-2); }
.admin-media-list { display: grid; gap: 8px; }
.admin-media-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--hc-border); border-radius: 14px; background: var(--hc-surface); }
.admin-media-preview { display: grid; width: 72px; height: 58px; place-items: center; overflow: hidden; border-radius: 10px; background: var(--hc-surface-2); color: var(--hc-brand); font-size: 11px; font-weight: 700; }
.admin-media-preview :is(img, video) { width: 100%; height: 100%; object-fit: cover; }
.admin-media-copy { min-width: 0; }
.admin-media-copy strong,.admin-media-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-media-copy small { margin-top: 4px; color: var(--hc-text-2); font-size: 11px; }
.admin-media-copy a { color: var(--hc-brand); }
.admin-media-size { max-width: 145px; color: var(--hc-text-2); font-size: 11px; text-align: right; line-height: 1.45; }
.admin-media-empty { margin: 0; padding: 13px; color: var(--hc-text-2); border: 1px dashed var(--hc-border); border-radius: 12px; font-size: 12px; }

@media (max-width: 767px) {
  .phase-eight .modern-profile .person-header { margin-top: -62px; }
  .phase-eight .business-profile .business-profile-main { margin-top: -62px; }
  .phase-eight .new-chat-dialog { margin: auto 12px 16px; padding: 18px; }
  .phase-eight .new-chat-choice { grid-template-columns: 44px minmax(0, 1fr) 24px; min-height: 72px; gap: 11px; }
  .phase-eight .new-chat-choice > .app-icon { width: 42px; height: 42px; padding: 10px; border-radius: 13px; }
  .admin-media-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-media-item { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .admin-media-preview { width: 58px; height: 52px; }
  .admin-media-size { grid-column: 2; max-width: none; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .phase-eight :is(.new-chat-dialog, .message-context-dialog, .feed-tools-dialog, .profile-photo-dialog, .global-search-dialog, .share-dialog)[open],
  .phase-eight .new-chat-dialog[open] .new-chat-choice,
  .phase-eight .header-mobile-menu:not([hidden]) .header-mobile-menu-card,
  .phase-eight .notification-drawer:not([hidden]) > section {
    animation: none !important;
  }

  .phase-eight .new-chat-choice { transition: none; }
}
