/* =========================================================
   MEU PERFIL (meuperfil.css) - versão refeita
   Restaura larguras originais de: Sobre mim, Interesses,
   Posts Favoritos (desktop), mantendo correções mobile.
   ========================================================= */

/* 1. CONTAINER GERAL */
.container2 {
  max-width: 950px;
  margin: 20px auto 60px;
  padding: 32px 24px 30px;
  background: rgba(255,255,255,0.16);
  border-radius: 24px;
  box-shadow: 0 6px 36px 8px rgba(0,0,0,0.16);
  backdrop-filter: blur(6px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.profile-sections-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}
.profile-sections-wrapper > * {
  width: 100%;
  max-width: 820px;
  padding: 0 10px;
}
.profile-sections-wrapper h5 {
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #111;
  margin: 0 0 30px;
}

/* 2. PERFIL BOX */
.box {
  background: rgba(255,255,255,0.27);
  border-radius: 18px;
  box-shadow: 0 4px 24px 4px rgba(0,0,0,0.16);
  padding: 30px 48px 24px;
  text-align: center;
  min-width: 250px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.profile-picture-container { position: relative; margin-bottom: 10px; }
.profile-picture {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 2px 15px rgba(0,0,0,0.14);
  background: #f6f6f6;
  transition: box-shadow .3s, transform .3s;
  border: none !important;
}
.profile-picture:hover {
  box-shadow: 0 5px 22px 2px #b2faffc7, 0 2px 15px rgba(0,0,0,0.21);
  transform: scale(1.05);
}
.edit-foto-btn {
  display: none;
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0500007f;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.edit-foto-btn.show { display: flex; }

.box h4 {
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #191919;
  margin: 6px 0 2px;
  text-shadow: 0 1px 3px rgba(255,255,255,0.42), 0 .5px 1px rgba(0,0,0,0.16);
}
.texto-cargo { font-size: 1.02rem; color: #33394d; font-weight: 600; margin-bottom: 3px; }
.box p { font-size: 0.95rem; font-weight: 600; color: #2d2c2cca; margin: 0; }

/* 3. SOBRE MIM (layout base fluido; original restaurado em desktop +900px) */
.form-group-about {
  width: 100%;
  margin: 18px 0 22px;
}
.bordaaboutme {
  width: 100%;
  background: rgba(255,255,255,0.38);
  border-radius: 10px;
  min-height: 100px;
  padding: 12px 14px;
  font-size: 1rem;
  color: #1b1b1b;
  font-family: 'Work Sans', Arial, sans-serif;
  resize: vertical;
  transition: border-color .2s;
  text-align: justify !important;
  white-space: normal;
  overflow: auto;
  box-sizing: border-box;
}
.bordaaboutme:focus { outline: 2px solid #b2faff; }
.aboutme-actions { text-align: right; margin-top: 10px; }
.edit-btn {
  background: transparent;
  color: #ffffff89;
  border: none;
  border-radius: 22px;
  padding: 5px 12px;
  font-size: .85rem;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: .3s;
  text-shadow: 0 1px 3px rgba(5,4,4,.225), 0 .5px 1px rgba(0,0,0,.088);
}
.edit-btn:hover { color: #000000a7; transform: scale(1.09); }
.aboutme-edit { display: none; margin-top: 8px; }
.aboutme-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.cancel-btn,
.save-btn {
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-weight: 600;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: .96rem;
  border: none;
  cursor: pointer;
  background: #00000020;
  color: #000;
  box-shadow: 0 1px 6px #0002;
  transition: background .25s, color .2s;
}
.cancel-btn:hover,
.save-btn:hover { background: #ffffff77; }

/* 4. INTERESSES */
.interesses-pills-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  margin: 0 0 7px;
}
.interesse-pill {
  position: relative;
  background: linear-gradient(90deg,#0000003e 0%,#ffffff78 100%);
  color: #222;
  font-size: .95rem;
  font-family: 'Space Grotesk', Arial, sans-serif;
  border-radius: 22px;
  padding: 5px 16px 5px 14px;
  box-shadow: 0 1px 6px #0001;
  font-weight: 600;
  display: inline-block;
  user-select: none;
  transition: background .2s;
  padding-right: 26px;
}
.remove-pill {
  position: absolute;
  top: 2px;
  right: 6px;
  border: none;
  background: none;
  color: #4f4f4f74;
  font-size: 1.05em;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: background .16s, color .16s;
}
.remove-pill:hover { color: rgba(255,255,255,.805); }
.btn-add-interesse {
  background: transparent;
  color: #ffffff89;
  border: none;
  border-radius: 22px;
  padding: 5px 16px 5px 14px;
  font-size: .95rem;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: .3s;
  text-shadow: 0 1px 3px rgba(5,4,4,.225), 0 .5px 1px rgba(0,0,0,.088);
}
.btn-add-interesse:hover { color: #000000c8; transform: scale(1.07); }
.add-interesse-popover {
  display: none;
  position: absolute;
  margin-top: 10px;
  left: 0;
  z-index: 40;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 16px #0002;
  padding: 15px 18px 8px;
  min-width: 210px;
  animation: fadeIn .18s;
}
.add-interesse-popover select {
  font-size: 1rem;
  margin-bottom: 8px;
  width: 100%;
}
.add-interesse-popover .cancel-btn {
  background: #b2faff2e;
  font-size: .9rem;
  padding: 3px 10px;
  margin-top: 6px !important;
}
.add-interesse-popover .cancel-btn:hover {
  background: #0000002e;
  color: #fffbfb !important;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 5. MODAL FOTO PERFIL */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.64);
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity .25s;
}
.custom-modal-overlay.open { display: flex; }
.custom-modal-content {
  background: #ffffffd7;
  border-radius: 18px;
  box-shadow: 0 8px 32px 12px rgba(0,0,0,0.30);
  padding: 0 2vw 16px;
  min-width: 350px;
  max-width: 20vw;
  animation: popupFadeIn .25s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  box-sizing: border-box;
}
.custom-modal-content .close-btn:hover { border-radius: 20% !important; }
.custom-modal-title {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 12px !important;
  text-align: center;
}
.custom-modal-footer {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  gap: 22px;
}
.modal-input { text-align: center; }
@keyframes popupFadeIn {
  from { transform: scale(.92) translateY(40px); opacity: .2; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.close-btn {
  padding: .25em;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 16 16'%3e%3cpath d='M2.146 2.146a.5.5 0 0 1 .708 0L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") center/1em no-repeat;
  border: none;
  cursor: pointer;
  width: 1.6em;
  height: 1.6em;
  opacity: .65;
  align-self: flex-end;
  margin: 10px 0 0;
}
.close-btn:hover { opacity: 1; background-color: #eee; }
.profile-picture-modal,
#preview {
  border-radius: 50%;
  background: #f6f6f6;
  box-shadow: 0 2px 8px #0002;
  width: 200px;
  height: 220px;
  margin-bottom: 20px;
  object-fit: cover;
}
.modal-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.form-label { margin-bottom: 8px; text-align: center; }

/* 6. FAVORITOS (CARROSSEL BASE) */
.favoritos-carousel {
  margin-top: 4px;
  width: 100%;
  position: relative;
  padding: 10px 0;
}
.favoritos-carousel .carousel-btn {
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
  background: #000;
  color: #fff;
  opacity: 0.75;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity .25s;
}
.favoritos-carousel .carousel-btn:hover { opacity: 1; }
.favoritos-carousel .carousel-btn[disabled] { visibility: hidden; }
.carousel-viewport {
  overflow: hidden;
  width: 100%; /* valor base (desktop original restaurado via media query abaixo) */
  border-radius: 2%;
}
.favoritos .carousel-track {
  display: flex;
  align-items: stretch;
  gap: 8px;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.favoritos .carousel-track .post {
  box-shadow: none !important;
  flex: 0 0 auto;
}

/* 7. HAMBURGER FIX */
.hamburger {
  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0px) + 40px) !important;
  left: 40px !important;
  z-index: 400 !important;
}
@media (max-width:600px) {
  .hamburger {
    top: calc(env(safe-area-inset-top, 0px) + 32px) !important;
    left: 28px !important;
  }
}

/* 8. BREAKPOINTS INTERMEDIÁRIOS (originais) */
@media (max-width: 820px) {
  .favoritos .carousel-track .post {
    flex: 0 0 48%;
    min-width: 48%;
  }
}
@media (max-width: 560px) {
  .favoritos .carousel-track .post {
    flex: 0 0 96%;
    min-width: 96%;
    margin: 0 2%;
  }
  /* Restaurar comportamento original do viewport em 560px se desejar */
  .carousel-viewport {
    width: 120%;
    margin-left: -28px;
  }
}

/* 9. MOBILE GERAL <=600px (manter correções anti-overflow) */
@media (max-width: 600px) {
  body, html { 
    max-width: 100%; }
  .container2 {
    width: 100%;
    max-width: 100%;
    padding: 28px 16px 30px;
  }
  .profile-sections-wrapper > * {
    padding: 0 !important;
    max-width: 100%;
  }

  .interesses-pills-wrapper {
    margin-left: 0 !important;
    padding-left: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .form-group-about { min-width: 0 !important; }
  .bordaaboutme {
    min-width: 0 !important;
    margin-left: 0 !important;
  }
  .favoritos-carousel .carousel-btn {
    right: 8px;
    left: auto;
  }
  .carousel-viewport {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .favoritos .carousel-track .post {
    margin: 0 auto;
    box-sizing: border-box;
    transform: none !important;
    margin-bottom: 15px !important;
    padding: 20px !important;
  }
  .custom-modal-content {
    min-width: 0 !important;
    max-width: 92vw !important;
    width: 92vw !important;
    padding: 12px 16px 22px !important;
  }
  .aboutme-edit-actions { justify-content: flex-start; }
}

/* 10. MOBILE MUITO PEQUENO <=400px */
@media (max-width: 400px) {
  .container2 { padding: 24px 12px 26px; }
  .custom-modal-content {
    max-width: 94vw !important;
    width: 94vw !important;
  }
}

/* 11. RESTAURAÇÃO DOS WIDTHS ORIGINAIS (DESKTOP) */
/* Aplica a partir de 900px (ajuste se quiser antes). */
@media (min-width: 900px) {

  .favoritos .post h2 {
    font-size: 1.28rem;   /* antes: 1.5rem */
    line-height: 115%;
  }
  .form-group-about {
    min-width: 520px;
  }
  .bordaaboutme {
    min-width: 250px;
    margin-left: 78px;
  }
  .interesses-pills-wrapper {
    margin-left: 78px;
  }
  .carousel-viewport {
    width: 110%;
  }
}

@media (min-width:1024px) {
  .favoritos .carousel-track {
    gap: 4px;
  }
  .favoritos .carousel-track .post {
    flex: 0 0 calc((100% - 48px)/3);
    max-width: calc((100% - 48px)/3);
  }
  .bordaaboutme.aboutme-view {
    min-width: 420px;      
    max-width: 720px; }
}
.favoritos-carousel .carousel-btn-right{
    right: -12%;
  }

/* 13. KEYFRAMES */
@keyframes popupFadeIn {
  from { transform: scale(.92) translateY(40px); opacity: .2; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === INTERESSES + REDES SOCIAIS (layout combinado) === */
.interesses-social-row {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  margin-bottom: 10px;
}

/* Mantém a semântica existente da seção de interesses */
.interesses,
.social-links {
  position: relative;
}

/* Para alinhar visualmente com o estilo existente (usa o h5 global) */
.social-links h5 {
  margin-bottom: 18px;
}

/* Ícones sociais */
.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  margin-left: 0;
  padding-left: 0;
}

.social-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 10px 14px;
  position: relative;
  transition: transform .28s;
}

.social-icon-link:hover,
.social-icon-link:focus-visible {
  transform: translateY(-2px) scale(1.04);
  outline: none;
}

.social-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.18));
  transition: transform .3s;
}

.social-icon-link:hover .social-icon-img,
.social-icon-link:focus-visible .social-icon-img {
  transform: scale(1.08);
}

/* Texto somente para leitores de tela */
.sr-only {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Desktop: lado a lado (Interesses 2/3 – Redes 1/3) */
@media (min-width: 900px) {
  .interesses-social-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
  }

  .interesses {
    flex: 0 0 66.666%;
    max-width: 66.666%;
  }

  .social-links {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }

  /* Para manter o recuo esquerdo dos conteúdos igual aos pills (78px) */
  .social-links .social-icons {
    margin-left: -10px;
  }
}

/* Ajuste fino em telas muito largas (opcional) */
@media (min-width: 1400px) {
  .interesses-social-row {
    gap: 56px;
  }
}

/* Mobile já fica empilhado naturalmente. Se quiser aumentar o toque nos ícones: */
@media (max-width: 600px) {
  .social-icon-link {
    padding: 8px 10px;
  }
  .social-icon-img {
    width: 44px;
    height: 44px;
  }
}
