/* ============================================================
   Conexão Cosmópolis — Social System Styles v1.0
   Perfis, seguidores, menções, category flyout.
   ============================================================ */

/* ── Category Flyout Sidebar ─────────────────────────────────── */

.nos-cat-flyout {
  position: fixed;
  left: var(--nos-sidebar-left-w);
  top: var(--nos-navbar-h);
  height: calc(100vh - var(--nos-navbar-h));
  width: 16rem;
  background: var(--nos-white);
  border-right: 1px solid var(--nos-border);
  box-shadow: 4px 0 20px rgb(0 0 0 / 0.08);
  z-index: 145;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1), opacity 220ms ease;
  pointer-events: none;
}

.nos-cat-flyout.nos-cat-flyout--open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.nos-cat-flyout__backdrop {
  display: none;
}

.nos-cat-flyout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--nos-border);
  flex-shrink: 0;
}

.nos-cat-flyout__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--nos-text);
  letter-spacing: -0.01em;
}

.nos-cat-flyout__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--nos-radius);
  color: var(--nos-text-muted);
  transition: background var(--nos-transition), color var(--nos-transition);
}
.nos-cat-flyout__close:hover {
  background: var(--nos-surface);
  color: var(--nos-text);
}

.nos-cat-flyout__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--nos-border) transparent;
}
.nos-cat-flyout__nav::-webkit-scrollbar { width: 3px; }
.nos-cat-flyout__nav::-webkit-scrollbar-track { background: transparent; }
.nos-cat-flyout__nav::-webkit-scrollbar-thumb { background: var(--nos-border); border-radius: 3px; }

.nos-cat-flyout__group {
  padding: 0.25rem 0 0.5rem;
}

.nos-cat-flyout__group + .nos-cat-flyout__group {
  border-top: 1px solid var(--nos-border);
  margin-top: 0.25rem;
  padding-top: 0.5rem;
}

.nos-cat-flyout__group-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--nos-text-faint);
  padding: 0.25rem 1rem 0.5rem;
}

.nos-cat-flyout__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nos-text-2);
  text-align: left;
  border-radius: 0;
  transition: background var(--nos-transition), color var(--nos-transition);
  position: relative;
}

.nos-cat-flyout__item:hover {
  background: var(--nos-surface);
  color: var(--nos-text);
}

.nos-cat-flyout__item.nos-cat-flyout__item--active {
  background: var(--nos-accent-light);
  color: var(--nos-accent);
  font-weight: 600;
}

.nos-cat-flyout__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--nos-border-2);
  flex-shrink: 0;
  transition: background var(--nos-transition);
}

.nos-cat-flyout__item:hover .nos-cat-flyout__dot { background: var(--nos-accent); }
.nos-cat-flyout__item.nos-cat-flyout__item--active .nos-cat-flyout__dot { background: var(--nos-accent); }

.nos-cat-flyout__count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--nos-text-faint);
  font-weight: 400;
}

/* Indicador de categoria ativa na filter-bar */
.nos-filter-cat-indicator {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--nos-radius-full);
  background: var(--nos-accent-light);
  border: 1px solid rgb(8 145 178 / 0.3);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--nos-accent);
  margin-left: 0.5rem;
  white-space: nowrap;
}

.nos-filter-cat-indicator[hidden] { display: none !important; }

.nos-filter-cat-indicator__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nos-accent);
  flex-shrink: 0;
}

.nos-filter-cat-indicator__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: rgb(8 145 178 / 0.15);
  color: var(--nos-accent);
  transition: background var(--nos-transition);
  flex-shrink: 0;
}
.nos-filter-cat-indicator__clear:hover {
  background: rgb(8 145 178 / 0.3);
}

/* Sidebar left — botão de ação (não é link) */
.nos-sidebar-left__item--btn {
  background: none;
  border: none;
  cursor: pointer;
}

/* ── Perfil de Usuário ───────────────────────────────────────── */

.nos-profile {
  max-width: var(--nos-max-feed);
  margin: 0 auto;
}

/* Imagem de capa */
.nos-profile__cover {
  height: 12rem;
  background-size: cover;
  background-position: center;
  background-color: var(--nos-accent-light);
  position: relative;
  overflow: hidden;
}

.nos-profile__cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--nos-accent-light) 0%, #e0f2fe 50%, #bae6fd 100%);
}

/* Header do perfil */
.nos-profile__header {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid var(--nos-border);
  flex-wrap: wrap;
  position: relative;
  margin-top: -2.5rem;
}

.nos-profile__avatar-wrap {
  flex-shrink: 0;
  border: 3px solid var(--nos-white);
  border-radius: 50%;
  background: var(--nos-white);
  box-shadow: var(--nos-shadow);
  margin-top: 0;
}

.nos-profile__avatar {
  width: 5rem !important;
  height: 5rem !important;
  border-radius: 50%;
  display: block;
}

.nos-profile__info {
  flex: 1;
  min-width: 0;
  padding-top: 2.75rem;
}

.nos-profile__name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--nos-text);
  line-height: 1.2;
  margin-bottom: 0.125rem;
}

.nos-profile__username {
  font-size: 0.875rem;
  color: var(--nos-text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.nos-profile__bio {
  font-size: 0.875rem;
  color: var(--nos-text-2);
  line-height: 1.5;
  margin-bottom: 0.625rem;
}

.nos-profile__stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--nos-text-muted);
}

.nos-profile__stat strong {
  font-weight: 700;
  color: var(--nos-text);
}

.nos-profile__stat-sep {
  color: var(--nos-text-faint);
}

.nos-profile__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding-top: 2.75rem;
}

/* Posts do perfil */
.nos-profile__posts {
  padding: 1.25rem 0 0;
}

.nos-profile__posts-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--nos-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 1.25rem 0.75rem;
  border-bottom: 1px solid var(--nos-border);
}

.nos-profile__pagination {
  padding: 1rem 1.25rem;
}

/* ── Botão Seguir ───────────────────────────────────────────── */

.nos-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 1.125rem;
  border-radius: var(--nos-radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--nos-transition);
  border: 1.5px solid transparent;
}

.nos-follow-btn:not(.nos-follow-btn--following) {
  background: var(--nos-accent);
  color: #fff;
  border-color: var(--nos-accent);
}

.nos-follow-btn:not(.nos-follow-btn--following):hover {
  background: var(--nos-accent-hover);
  border-color: var(--nos-accent-hover);
}

.nos-follow-btn--following {
  background: transparent;
  color: var(--nos-text-2);
  border-color: var(--nos-border-2);
}

.nos-follow-btn--following:hover {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}

.nos-follow-btn--following:hover .nos-follow-btn__label::before {
  content: 'Deixar de seguir';
}

.nos-follow-btn--following .nos-follow-btn__label {
  font-size: 0;
}

.nos-follow-btn--following .nos-follow-btn__label::before {
  content: 'Seguindo';
  font-size: 0.875rem;
}

/* ── Menções @usuario ────────────────────────────────────────── */

.nos-mention {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--nos-accent);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--nos-radius-sm);
  padding: 0 0.125rem;
  transition: background var(--nos-transition);
}

.nos-mention:hover {
  background: var(--nos-accent-light);
  color: var(--nos-accent-hover);
}

.nos-mention__avatar {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  display: inline-block;
}

/* ── Popover de perfil (hover) ───────────────────────────────── */

.nos-user-popover {
  position: absolute;
  z-index: 400;
  background: var(--nos-white);
  border: 1px solid var(--nos-border);
  border-radius: var(--nos-radius-lg);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.14);
  width: 18rem;
  overflow: hidden;
  animation: nos-dropdown-in 150ms ease;
}

.nos-user-popover__cover {
  height: 4.5rem;
  background-size: cover;
  background-position: center;
  background-color: var(--nos-accent-light);
}

.nos-user-popover__body {
  padding: 0.75rem 1rem 1rem;
  position: relative;
}

.nos-user-popover__avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 3px solid var(--nos-white);
  object-fit: cover;
  display: block;
  margin-top: -2rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--nos-shadow-sm);
}

.nos-user-popover__name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--nos-text);
  display: block;
}

.nos-user-popover__username {
  font-size: 0.8125rem;
  color: var(--nos-text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.nos-user-popover__bio {
  font-size: 0.8125rem;
  color: var(--nos-text-2);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nos-user-popover__stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--nos-text-muted);
  margin-bottom: 0.875rem;
}

.nos-user-popover__stat strong {
  font-weight: 700;
  color: var(--nos-text);
}

.nos-user-popover__actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Autocomplete de menção (@) no textarea / comentários ─────── */

.nos-mention-dropdown {
  position: absolute;
  background: var(--nos-white);
  border: 1px solid var(--nos-border);
  border-radius: var(--nos-radius-lg);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  z-index: 500;
  min-width: 14rem;
  overflow: hidden;
  animation: nos-dropdown-in 120ms ease;
}

.nos-mention-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background var(--nos-transition);
  width: 100%;
  text-align: left;
}

.nos-mention-dropdown__item:hover,
.nos-mention-dropdown__item.nos-mention-dropdown__item--active {
  background: var(--nos-surface);
}

.nos-mention-dropdown__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nos-mention-dropdown__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--nos-text);
  display: block;
}

.nos-mention-dropdown__username {
  font-size: 0.75rem;
  color: var(--nos-text-muted);
  display: block;
}

/* ── Card Social: mini info de usuário ───────────────────────── */

.nos-card__author-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--nos-text);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--nos-transition);
}

.nos-card__author-link:hover {
  color: var(--nos-accent);
}

.nos-card__follow-inline {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  border-radius: var(--nos-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--nos-border);
  color: var(--nos-text-muted);
  transition: all var(--nos-transition);
  margin-left: 0.25rem;
}

.nos-card__follow-inline:hover {
  background: var(--nos-accent);
  color: #fff;
  border-color: var(--nos-accent);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nos-cat-flyout {
    left: 0;
    width: 80vw;
    max-width: 20rem;
    z-index: 250;
    transform: translateX(-100%);
  }

  .nos-cat-flyout__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.4);
    z-index: 240;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .nos-cat-flyout__backdrop.nos-cat-flyout__backdrop--visible {
    opacity: 1;
    pointer-events: auto;
  }

  .nos-profile__header {
    flex-wrap: wrap;
  }

  .nos-profile__info {
    width: 100%;
    padding-top: 0.75rem;
  }

  .nos-profile__actions {
    padding-top: 0;
    width: 100%;
  }
}
