.profile-page {
  min-height: 80vh;
  display: flex;
  justify-content: center;
  padding: 18px 14px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.profile-card {
  width: min(880px, 100%);
  background: #ffffff;
  border-radius: 26px;
  padding: 40px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.07);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  text-decoration: none;
  font-weight: 600;
  color: #2ea6ff;
  padding: 8px 14px;
  border-radius: 12px;
}

.back-btn:hover {
  background: rgba(46, 166, 255, 0.1);
}

.profile-header {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-bottom: 40px;
}

.avatar-wrapper {
  position: relative;
}

.profile-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #2ea6ff;
  box-shadow: 0 15px 40px rgba(46, 166, 255, 0.25);
}

.avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #2ea6ff;
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.profile-card.editing #profileName,
.profile-card.editing #profileUsername,
.profile-card.editing #heightValue,
.profile-card.editing #weightValue,
.profile-card.editing #genderValue,
.profile-card.editing #experienceValue,
.profile-card.editing #goalValue,
.profile-card.editing #injuriesValue {
  display: none;
}

.profile-input {
  display: none;
}

.profile-card.editing .profile-input {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.profile-card.editing .profile-meta h2 {
  display: none;
}

.profile-actions #saveProfileBtn,
.profile-actions #cancelEditBtn {
  display: none;
}

.profile-card.editing .profile-actions #editProfileBtn {
  display: none;
}

.profile-card.editing .profile-actions #saveProfileBtn,
.profile-card.editing .profile-actions #cancelEditBtn {
  display: inline-flex;
}

.profile-meta h2 {
  margin: 0;
  font-size: 28px;
}

.profile-meta .small {
  font-size: 13px;
  opacity: 0.6;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.profile-box {
  background: rgba(46, 166, 255, 0.05);
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(46, 166, 255, 0.15);
}

.profile-box.full {
  grid-column: span 2;
}

#profileUsername {
  margin: 0px;
}

.profile-label {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

.profile-box strong,
.profile-box p {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.5;
  word-break: break-word;
}

.logout-btn {
  margin-top: 40px;
  width: 100%;
}

.goal-text {
  margin-top: 8px;
  line-height: 1.6;
  font-size: 15px;
  max-width: 100%;
  word-break: break-word;
}

.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.profile-input {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  font-size: 14px;
  font-family: inherit;
}

.profile-input:focus {
  outline: none;
  border-color: #2ea6ff;
  box-shadow: 0 0 0 3px rgba(46, 166, 255, 0.15);
}

.profile-box input,
.profile-box select,
.profile-box textarea {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  font-size: 14px;
}

.profile-box textarea {
  resize: vertical;
}

.profile-warning {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 183, 77, 0.15);
  border: 1px solid rgba(255, 183, 77, 0.35);
  color: #9a5b00;
  font-weight: 600;
  display: flex;
  gap: 10px;
  align-items: center;
  display: none;
  transform: translateY(8px);
  transition: all 0.4s ease;
}

.profile-warning.full {
  grid-column: span 2;
}

.profile-warning.show {
  display: flex;
  transform: translateY(0);
}

.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #111;
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .profile-card {
    padding: 30px;
  }

  .profile-header {
    gap: 20px;
  }

  .profile-avatar {
    width: 110px;
    height: 110px;
  }
}

@media (max-width: 650px) {
  .profile-page {
    padding: 40px 14px;
  }

  .profile-card {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    margin-bottom: 28px;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .avatar-edit {
    width: 32px;
    height: 32px;
  }

  .profile-meta h2 {
    font-size: 22px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profile-box.full,
  .profile-warning.full {
    grid-column: span 1;
  }

  .profile-box {
    padding: 16px;
    border-radius: 16px;
  }

  .profile-warning {
    font-size: 14px;
    padding: 12px 14px;
  }

  .logout-btn {
    margin-top: 30px;
  }
}

@media (max-width: 420px) {
  .profile-page {
    padding: 30px 10px;
  }

  .profile-card {
    padding: 20px 16px;
  }

  .back-btn {
    font-size: 14px;
    padding: 6px 10px;
  }

  .profile-avatar {
    width: 85px;
    height: 85px;
    border-width: 3px;
  }

  .profile-meta h2 {
    font-size: 20px;
  }

  .profile-box strong,
  .profile-box p {
    font-size: 14px;
  }

  .goal-text {
    font-size: 14px;
  }

  .profile-label {
    font-size: 11px;
  }
}
