/* Reset simples */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  --bg: #e6e6e6;
  --topbar: #cfcfcf;
  --muted: #9b9b9b;
  --card-bg: #ffffff;
  --accent: #222;
}

/* Página */
body{
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: #111;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Top bar: grid com 3 colunas (left, center, right) */
.topbar{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: var(--topbar);
  height: 68px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* left */
.topbar__left { display:flex; align-items:center; gap:12px; }
.logo{
  width:46px;
  height:46px;
  border-radius:50%;
  background:#111;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* center: search centralizado */
.topbar__center { display:flex; justify-content:center; }
.search{
  width: min(680px, 60vw);
  max-width: 720px;
  min-width: 220px;
  height:40px;
  border-radius:999px;
  padding: 8px 18px;
  border: none;
  outline: none;
  background: #e9e9e9;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03) inset;
  font-size: 15px;
}

/* right */
.topbar__right{
  display:flex;
  align-items:center;
  gap:12px;
  justify-self: end;
}
.icon-btn{
  background:transparent;
  border: none;
  font-size:18px;
  cursor:pointer;
}
.greeting{
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.avatar{
  width:42px;
  height:42px;
  border-radius:50%;
  background: #666;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Layout principal: sidebar + conteúdo */
.app{ display:flex; min-height: calc(100vh - 68px); }

/* Sidebar: colapsada por padrão, expande no hover */
.sidebar{
  width:72px;             /* largura inicial (ícones em coluna) */
  background: var(--topbar);
  padding: 18px 8px;
  transition: width 250ms ease, box-shadow 250ms ease;
  box-shadow: 2px 0 6px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* Expande quando hover do próprio aside ou quando focado (acessibilidade) */
.sidebar:hover,
.sidebar:focus-within{
  width:220px;
  box-shadow: 6px 0 18px rgba(0,0,0,0.08);
}

/* items */
.sidebar nav{ display:flex; flex-direction:column; gap:12px; }
.sidebar__item{
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  color: #111;
  transition: background 160ms ease, transform 160ms ease;
}

/* default visual só ícone centralizado */
.sidebar__item .icon{
  display:inline-flex;
  width:36px;
  height:36px;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background: rgba(0,0,0,0.04);
  font-size:18px;
}

.sidebar__item.active {
  background: rgba(0,0,0,0.08);
  font-weight: bold;
}

.sidebar__item.active .icon {
  background: rgba(0,0,0,0.12);
}

/* o label fica invisível (mas ocupa espaço) e aparece quando a sidebar expande */
.sidebar__item .label{
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
  white-space:nowrap;
  font-weight:600;
  color: var(--accent);
}

/* quando a sidebar expande (hover), mostra o label */
.sidebar:hover .sidebar__item .label,
.sidebar:focus-within .sidebar__item .label{
  opacity: 1;
  transform: translateX(0);
}

/* hover em cada item */
.sidebar__item:hover{
  background: rgba(0,0,0,0.03);
  transform: translateX(4px);
}

/* Conteúdo principal */
.content{
  flex:1;
  padding: 26px;
}

/* Cards */
h2{
  margin-bottom:10px;
  font-size:18px;
  color:#222;
}
.card-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap:18px;
  margin-bottom: 28px;
}
.card{
  background: var(--card-bg);
  border-radius:14px;
  padding:12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.card:hover{
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.08);
}
.thumb{
  width:100%;
  height:110px;
  border-radius:10px;
  background: linear-gradient(120deg,#d8d8d8,#cfcfcf);
  margin-bottom:10px;
}
.card-title{
  font-size:13px;
  color:#333;
  line-height:1.25;
}

/* Responsividade simples */
@media (max-width: 900px){
  .topbar{ grid-template-columns: auto 1fr auto; padding:10px; }
  .search{ width: 60vw; }
  .sidebar{ display:flex; align-items:flex-start; gap:6px; padding:12px; width:64px; }
  .sidebar:hover{ width:180px; }
}
@media (max-width: 600px){
  .topbar{ height:64px; grid-template-columns: auto 1fr auto; }
  .search{ display:none; } /* esconder campo grande no mobile */
  .greeting{ display:none; }
  .card-grid{ grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap:12px; }
}
/* Fundo borrado atrás do pop-up */
.blur-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(6px);
    background: rgba(0,0,0,0.25);
    z-index: 5;
}

/* Caixa de login estilo pop-up */
.login-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    padding: 30px;
    background: #c1c1c1;
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.30);
    text-align: left;
    z-index: 10;
}

.login-logo {
    display: block;
    margin: 0 auto 10px auto;
    width: 80px;
    opacity: .9;
}

.login-popup label {
    font-size: 14px;
    font-weight: bold;
}

.login-popup input {
    width: 100%;
    margin-top: 4px;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 6px;
    border: none;
    outline: none;
    background: #e8e8e8;
}

/* Link: Esqueceu sua senha */
.forgot {
    display: inline-block;
    margin-bottom: 15px;
    font-size: 13px;
    color: #1a73e8;
    text-decoration: none;
}

/* Botão de login */
.btn-login {
    width: 100%;
    padding: 10px;
    border: none;
    background: white;
    color: #000;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.btn-login:hover {
    background: #f2f2f2;
}

/* Link: cadastrar-se */
.register {
    text-align: center;
    font-size: 13px;
    margin-top: 10px;
}

.register a {
    color: #1a73e8;
    text-decoration: none;
}

/* Página de amigos */
.amigos-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Lista de amigos */
.amigos-list {
  position: absolute;
  top: 26px;
  right: 26px;
  width: 220px;
  background: var(--card-bg);
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.amigos-list h3 {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--accent);
}

.amigos-list ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 16px;
}

.amigos-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
  color: #333;
}

.status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status.online {
  background: #4caf50;
}

.status.offline {
  background: #9b9b9b;
}

/* Botão adicionar amigo */
.btn-adicionar {
  width: 100%;
  padding: 10px;
  border: none;
  background: #1a73e8;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 180ms ease;
}

.btn-adicionar:hover {
  background: #155fc0;
}

/* Modal */
.modal {
  position: fixed;
  top: 80px;          /* distância do topo, ajuste conforme altura do header */
  right: 0;           /* fixa na direita */
  width: 360px;       /* largura semelhante ao aside */
  max-height: calc(100% - 100px); /* limite de altura */
  overflow-y: auto;   /* cria scroll interno se passar da altura */
  background: var(--card-bg);
  border-left: 1px solid #ddd;
  box-shadow: -4px 0 12px rgba(0,0,0,0.2);
  z-index: 200;
  border-radius: 0;   /* sem arredondar, como barra lateral */
}

.modal.hidden { 
  display: none; 
}

.modal-content {
  padding: 24px;
  position: relative;
}

.modal-content h2 { 
  margin-bottom: 16px; 
  font-size: 18px; 
  color: var(--accent); 
}

.close { 
  position: absolute; 
  top: 12px; 
  right: 16px; 
  font-size: 22px; 
  cursor: pointer; 
}
.search-input {
  width: 100%; padding: 10px; border-radius: 8px;
  border: none; background: #f0f0f0; margin-bottom: 12px;
}
.btn-search {
  width: 100%; padding: 10px; border: none;
  background: #1a73e8; color: #fff; border-radius: 8px;
  font-size: 14px; font-weight: bold; cursor: pointer;
}
.btn-search:hover { background: #155fc0; }

/* Resultados da busca */
.resultado-list { list-style: none; padding: 0; margin-top: 12px; }
.resultado-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid #eee; font-size: 14px;
}
.btn-add {
  padding: 4px 8px; border: none; background: #4caf50;
  color: #fff; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.btn-add:hover { background: #3d8b40; }

/* Paginação */
.paginacao { margin-top: 12px; display: flex; gap: 6px; }
.paginacao a {
  padding: 4px 8px; border-radius: 4px; background: #f0f0f0;
  text-decoration: none; color: #333; font-size: 13px;
}
.paginacao a.ativo { background: #1a73e8; color: #fff; }

.btn-disabled {
  padding: 4px 8px;
  border: none;
  background: #9b9b9b;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: not-allowed;
}
.amigo-item {
  margin-bottom: 8px;
  cursor: pointer;
}

.opcoes {
  margin-top: 4px;
  display: flex;
  gap: 6px;
}

.opcoes.hidden {
  display: none;
}

.btn-ver {
  padding: 4px 8px;
  border: none;
  background: #1a73e8;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.btn-remove {
  padding: 4px 8px;
  border: none;
  background: #e53935;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.btn-remove:hover { background: #c62828; }

.amigos-list h3 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--accent);
}

.amigos-list ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.amigos-list li {
  margin-bottom: 8px;
}

.btn-add {
  padding: 4px 8px;
  border: none;
  background: #4caf50;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.btn-add:hover { background: #43a047; }

.btn-remove {
  padding: 4px 8px;
  border: none;
  background: #e53935;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.btn-remove:hover { background: #c62828; }

.btn-ver {
  padding: 4px 8px;
  border: none;
  background: #1a73e8;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.btn-ver:hover { background: #1565c0; }

.status-pendente {
  font-size: 12px;
  color: #999;
  margin-left: 8px;
}

.amigos-list h3 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--accent);
}