* {
  box-sizing: border-box;
  margin: 0;
}

body {
    background-color: rgb(16, 16, 16);
    color: white;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
}

.logo {
    position: absolute;
    top: 10px;
    left: 10px;
}

.logo img {
    width: 180px;
}

h1 {
    margin-bottom: 40px;
}


/* Estilização dos Perfis */
.profiles {
    display: flex;
    gap: 40px;
}

.profile {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
}

.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

.profile:hover {
    transform: scale(1.1);
}

.profile img {
    width: 120px;
    height: 120px;
    border-radius: 10px;
}

.profile p {
    margin-top: 10px;
    font-size: 16px;
    color: #aaa;
}


/* Editar Perfil */
.img-container {
  position: relative;
}

.img-container img {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  transition: 0.3s;
}

.edit-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  font-size: 30px;
  color: white;

  display: none;
}

.editing .edit-icon {
  display: block;
}

.editing .img-container img {
  filter: brightness(0.4) blur(2px);
}


/* Botão Gerenciar Perfis */
.button{
    margin-top: 40px;
    padding: 10px 20px;
    border: 1px solid #aaa;
    background: transparent;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.button:hover {
  color: white;
  border-color: white;
}


/* Popup Adicionar Perfil */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none;
}

.modal-content {
  background: #141414;
  padding: 20px;
  border-radius: 10px;
}

.input-group {
  position: relative;
  width: 300px;
  margin-top: 0px;
}

#profileName {
  width: 100%;
  padding: 20px 10px 10px;
  background: #333;
  border: none;
  outline: none;
  color: white;
  font-size: 16px;
  border-radius: 4px;
}

.input-group label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 16px;
  pointer-events: none;
  transition: 0.2s;
}

#profileName:focus + label,
#profileName:valid + label {
  top: 8px;
  font-size: 12px;
}

#profileName:focus {
  background: #444;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  gap: 10px;
}

.images-grid img {
  width: 80px;
  cursor: pointer;
  border-radius: 5px;

  transition: all 0.1s ease;
  border: 2px solid transparent;
}
  
.images-grid img.selected {
  border: 1px solid #ffffff;
}

.popup-button{
    padding: 10px 15px;
    border: 1px solid #aaa;
    background: transparent;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.popup-button:hover {
  color: white;
  border-color: white;
}



/* ================= RESPONSIVIDADE ================= */

@media (max-width: 768px) {
  h1 {
    font-size: 22px;
    text-align: center;
    margin-bottom: 30px;
  }

  .profiles {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }

  .profile img,
  .img-container img {
    width: 100px;
    height: 100px;
  }

  .logo img {
    width: 140px;
  }

  .button {
    margin-top: 30px;
    font-size: 13px;
  }

  .modal-content {
    width: 90%;
    max-width: 400px;
    padding: 20px;
  }

  .input-group {
    width: 100%;
  }

  .images-grid {
    grid-template-columns: repeat(3, 70px);
    justify-content: center;
  }

  .images-grid img {
    width: 70px;
  }
}


@media (max-width: 480px) {
  body {
    padding: 20px;
    height: auto;
  }

  h1 {
    font-size: 18px;
  }

  .profiles {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .profile img,
  .img-container img {
    width: 90px;
    height: 90px;
  }

  .profile p {
    font-size: 14px;
  }

  .logo {
    position: static;
    margin-bottom: 20px;
  }

  .logo img {
    width: 120px;
  }

  .button {
    width: 100%;
    max-width: 250px;
  }

  .modal {
    align-items: flex-start;
    padding-top: 40px; /* espaço no topo */
  }

  .modal-content {
    width: 95%;
    padding: 15px;
    border-radius: 8px;
  }

  .modal-content h2 {
    font-size: 18px;
  }

  .modal-content h3 {
    font-size: 14px;
  }

  .input-group {
    width: 100%;
  }

  #profileName {
    font-size: 14px;
    padding: 18px 10px 8px;
  }

  .images-grid {
    grid-template-columns: repeat(2, 70px);
    gap: 8px;
    justify-content: center;
  }

  .images-grid img {
    width: 65px;
  }

  .popup-button {
    width: 100%;
    margin-top: 10px;
    font-size: 13px;
  }
}
