/* ==================== USER PROFILE STYLES ==================== */

.profile-container {
  padding: 30px 20px 0;
  width: 100%;
}

/* Profile Header Section */
.profile-header {
  display: grid;
  grid-template-columns: 290px 1fr;
  margin-bottom: 44px;
  gap: 20px;
}

/* Avatar Upload Hover Overlay */
.profile-avatar-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-edit-overlay {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: var(--border-radius-pill);
  cursor: pointer;
  overflow: hidden;
}

.avatar-edit-overlay img {
  width: 150px;
  height: 150px;
  border-radius: var(--border-radius-pill);
  object-fit: cover;
  border: 1px solid var(--border-primary);
  transition: transform var(--transition-smooth);
}

.avatar-edit-overlay:hover img {
  transform: scale(1.05);
}

.avatar-edit-overlay.disabled-avatar-upload {
  cursor: default;
}

.avatar-edit-overlay.disabled-avatar-upload:hover img {
  transform: none;
}

.avatar-edit-overlay.disabled-avatar-upload:hover .overlay-text {
  opacity: 0;
}

.avatar-edit-overlay .overlay-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.avatar-edit-overlay:hover .overlay-text {
  opacity: 1;
}

.avatar-edit-overlay .overlay-text i {
  width: 24px;
  height: 24px;
}

/* Profile details (username, stats, bio) */
.profile-details-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text-primary);
}

.profile-username-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.profile-username-row h2 {
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.profile-username-row button {
  background-color: var(--bg-secondary-hover);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-md);
  padding: 6px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-username-row button:hover {
  background-color: var(--border-secondary);
}

/* Stats list */
.profile-stats {
  display: flex;
  gap: 40px;
  font-size: 1rem;
}

.profile-stats strong {
  font-weight: 600;
}

/* Bio */
.profile-bio-info h1 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-bio-info p {
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Profile Post grids togglers */
.profile-tabs {
  border-top: 1px solid var(--border-primary);
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-bottom: 20px;
}

.profile-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  border-top: 1px solid transparent;
  margin-top: -1px;
}

.profile-tab.active {
  color: var(--text-primary);
  border-top: 1px solid var(--text-primary);
}

.profile-tab i {
  width: 12px;
  height: 12px;
}

/* Profile 3-column posts list grid */
.profile-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  width: 100%;
}

.profile-grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: var(--bg-secondary);
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-secondary);
}

.profile-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.profile-grid-item:hover img {
  transform: scale(1.03);
}

/* Post Likes/Comments hover overlay */
.grid-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 2;
}

.profile-grid-item:hover .grid-item-overlay {
  opacity: 1;
}

.grid-item-overlay span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.grid-item-overlay i {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-state i {
  width: 64px;
  height: 64px;
  stroke-width: 1;
}

/* ==================== RESPONSIVE PROFILE VIEWS ==================== */

/* Mobile responsive profiles layout */
@media (max-width: 767px) {
  .profile-container {
    padding: 10px 0;
  }

  .profile-header {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 16px;
    margin-bottom: 24px;
  }

  .avatar-edit-overlay {
    width: 90px;
    height: 90px;
  }

  .avatar-edit-overlay img {
    width: 90px;
    height: 90px;
  }

  .profile-username-row {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .profile-stats {
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
    width: 100%;
    font-size: 0.9rem;
  }

  .profile-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
  }

  .profile-stats strong {
    color: var(--text-primary);
    font-size: 1.05rem;
  }

  .profile-posts-grid {
    gap: 3px; /* Grid spacing is extremely tight like Instagram mobile */
  }

  .profile-grid-item {
    border-radius: 0;
    border: none;
  }
}
