/* Shell de navegação compartilhado (sidebar desktop + bottom nav mobile) */

:root {
  --app-nav-h: 66px; /* altura aproximada da bottom nav (mobile) */
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  background: var(--color-cream); /* base sólida do design system */
}

/* ══════════════════════════════════════════════════════════════
   CAMADA ÚNICA DA MARCA — uma só animação, fixa, embaixo de tudo.
   Os orbs ficam parados e só o ciclo de cor (translúcido) desliza,
   preservando o creme como base. Sidebar / lista do chat / bottom nav
   são "janelas" translúcidas para ESTA camada (não animam sozinhos),
   então tudo se move em sincronia. Cards e botões são opacos → intactos.
   ══════════════════════════════════════════════════════════════ */
@keyframes rgcFundo {
  0%, 100% { background-position: 0% 0%, 0% 0%, 0% 0%, 50% 0%; }
  50%      { background-position: 0% 0%, 0% 0%, 0% 0%, 50% 100%; }
}
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 900px at 34% 6%,  rgba(221, 177, 247, 0.30), transparent 60%),
    radial-gradient(780px 780px at 90% 84%, rgba(255, 110, 31, 0.18), transparent 58%),
    radial-gradient(680px 680px at 62% 48%, rgba(180, 181, 54, 0.12), transparent 60%),
    linear-gradient(165deg,
      rgba(221, 177, 247, 0.24) 0%,
      rgba(255, 110, 31, 0.13) 34%,
      rgba(180, 181, 54, 0.13) 66%,
      rgba(132, 153, 183, 0.16) 100%);
  background-size: auto, auto, auto, 100% 280%;
  animation: rgcFundo 22s ease-in-out infinite;
}
/* Conteúdo e sidebar ficam acima da camada (que continua visível pelas transparências). */
.app-sidebar,
.app-main { position: relative; z-index: 1; }

/* ── Sidebar (desktop) ── */
.app-sidebar {
  width: 248px;
  flex-shrink: 0;
  /* Janela para a MESMA camada animada: véu leve + saturação do que está atrás,
     pra o ciclo de cor aparecer no painel sem precisar tingir o conteúdo. */
  background: rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: saturate(1.8);
  backdrop-filter: saturate(1.8);
  border-right: 1px solid rgba(221, 177, 247, 0.30);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

/* Logo colorido + estrelas verdes animadas */
.app-logo {
  display: flex;
  justify-content: center;
  padding: 4px 8px 26px;
  cursor: pointer;
}

/* Itens de navegação */
.app-navitem {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: background 0.15s;
}
.app-navitem svg { color: var(--color-text-muted); }
.app-navitem:hover { background: rgba(255, 255, 255, 0.7); }
.app-navitem.active {
  background: var(--color-orange-light);
  color: var(--color-orange);
  font-weight: 700;
}
.app-navitem.active svg { color: var(--color-orange); }

/* Botão "Criar encontro" (primário laranja) */
.app-criar-btn {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-orange);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 13px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn-primary);
  transition: opacity 0.15s;
}
.app-criar-btn:hover { opacity: 0.92; }

/* Rodapé: avatar + nome + sair */
/* Rodapé da sidebar: card branco pra destacar do wash animado atrás. */
.app-rodape {
  margin-top: auto;
  background: #fff;
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}
.app-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.app-user:hover { background: var(--color-cream); }
.app-user-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-user-sub { font-size: 12px; color: var(--color-text-muted); }
.app-sair {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-secondary); /* era muted (#8499b7) — apagado demais */
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
}
.app-sair:hover { background: var(--color-cream); }

/* ── Conteúdo ── */
.app-main {
  flex: 1;
  min-width: 0;
}

/* ── Painel de notificações (sininho) ── */
.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
  z-index: 300;
}
.notif-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: var(--radius-modal);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  z-index: 301;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}
.notif-marcar {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-orange);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  white-space: nowrap;
}
.notif-list { overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 13px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(132, 153, 183, 0.10);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}
.notif-item:hover { background: var(--color-cream); }
.notif-item.nao-lida { background: var(--color-orange-light); }
.notif-item.nao-lida:hover { background: #ffe9dc; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-orange);
  margin-top: 6px;
  flex-shrink: 0;
}
.notif-titulo { display: block; font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--color-text); }
.notif-msg { display: block; font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; line-height: 1.4; }
.notif-time { display: block; font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }

/* ── Bottom nav só no mobile ── */
.app-bottomnav { display: none; }

@media (max-width: 820px) {
  .app-sidebar { display: none; }
  .app-bottomnav { display: flex; } /* .bottom-nav já é position:fixed */
  .app-main { padding-bottom: 0; }

  /* No chat com sala aberta, a barra vira tela cheia (esconde a bottom nav). */
  body.sala-aberta .app-bottomnav { display: none; }

  /* Painel de notificações vira uma folha no topo, acima da bottom nav. */
  .notif-panel {
    top: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 16px - var(--app-nav-h));
  }
}
