/* arquivos styles a serem alterados: 
artigo.php 
cadastro
login
escrever artigo
index
meus artigos
muda senha
redefinir senha
topo
*/
/* topo */

/* 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;
}
/*imagem borrada atra do pop-up login */
.blur-background img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center;
    filter: blur(6px);
}

/* 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;
}

#logo{
    width:50%;
    height:50%;
}

.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);
}

/* topo */

.topbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px;
  background:#eee;
}
.topbar__center {
  flex:1;
  display:flex;
  justify-content:center;
}
.topbar__right {
  position:relative;
  display:flex;
  align-items:center;
  gap:15px;
}
.greeting {
  font-weight:bold;
}
.avatar {
  cursor:pointer;
  background:#ccc;
  border-radius:50%;
  width:35px;
  height:35px;
  display:flex;
  justify-content:center;
  align-items:center;
  overflow:hidden;
}
.avatar img {
  width:100%;
  height:100%;
  object-fit:cover;
}
.profile-card {
  position:absolute;
  top:50px;
  right:0;
  background:#fff;
  border:1px solid #ccc;
  border-radius:6px;
  padding:15px;
  min-width:220px;
  box-shadow:0 2px 6px rgba(0,0,0,0.2);
  display:flex;
  flex-direction:column;
  align-items:center;
}
.profile-photo {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: visible; /* permite que o botão apareça fora */
  margin-bottom: 30px; /* espaço extra para não cortar o botão */
  background: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
}
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.edit-photo-btn {
  position: absolute;
  bottom: -12px;  /* joga para fora da borda */
  right: -12px;   /* joga para fora da borda */
  background: #eee;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.edit-photo-btn:hover {
  background: #ddd;
}
.profile-info {
  margin-bottom:10px;
  text-align:center;
}
.profile-info p {
  margin:5px 0;
  color:#333;
}
.profile-actions {
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:5px;
  width:100%;
}
.profile-actions a {
  text-decoration:none;
  color:#333;
  padding:8px;
  border-radius:4px;
  text-align:center;
}
.profile-actions a:hover {
  background:#f0f0f0;
}
.hidden {
  display:none;
}

/* muda senha */

form {
    max-width: 450px;
    margin: 100px auto; /* centraliza no meio da página */
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

td {
    padding: 10px;
}

input[type="password"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

input[type="submit"] {
    width: 100%;
    padding: 10px;
    background: #2196f3;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}

input[type="submit"]:hover {
    background: #1976d2;
}

b {
    font-size: 18px;
}

/* menu */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}
.card {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.card .thumb {
    width: 100%;
    max-height: 150px;
    overflow: hidden;
    margin-bottom: 10px;
}
.card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.card-title {
    font-weight: bold;
    margin: 5px 0;
}
/* artigo */

.conteudo{background:#ffffff;padding:25px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,0.1);line-height:1.6;font-size:16px;}
.galeria { margin-top: 20px; }
.galeria img { max-width: 200px; margin: 5px; border: 1px solid #ccc; }
.comentarios { margin-top:30px; padding:15px; border-top:2px solid #ccc; }
.form-comentario textarea { width:100%; padding:8px; }
.form-comentario button { margin-top:5px; padding:6px 12px; }
.lista-comentarios { margin-top:20px; }
.comentario { border-bottom:1px solid #ddd; padding:10px 0; }
.comentario strong { color:#333; }
.comentario span { color:#666; font-size:12px; margin-left:5px; }
.acoes-comentario { text-align:right; }
.btn-excluir {
  display:inline-block;
  margin-left:10px;
  padding:4px 8px;
  background:#f44336;
  color:#fff;
  border-radius:4px;
  text-decoration:none;
  font-size:12px;
}
.btn-excluir:hover { background:#d32f2f; }
.btn-like {
  display:inline-block;
  margin-left:10px;
  padding:4px 8px;
  background:#2196f3;
  color:#fff;
  border-radius:4px;
  text-decoration:none;
  font-size:12px;
}
.btn-like:hover { background:#1976d2; }

/* AlteraPerfil */

form {
    max-width: 500px;
    margin: 80px auto;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
form h1 {
    text-align: left;
    margin-bottom: 20px;
}

label {
    font-weight: bold;
}

input[type="text"], input[type="email"], input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

input[type="submit"] {
    width: 100%;
    padding: 10px;
    background: #2196f3;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}

input[type="submit"]:hover {
    background: #1976d2;
}

.avatar-preview {
    display: block;
    margin-bottom: 10px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

a {
    color: #2196f3;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}