/* Profile Page Styles */
.profile-header {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-picture-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
}

.profile-info {
  flex: 1;
}

.profile-info h2 {
  margin: 0 0 5px 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.username {
  color: var(--gray);
  margin-bottom: 10px;
  font-size: 1rem;
}

.bio {
  margin-bottom: 15px;
  line-height: 1.5;
  color: var(--dark-gray);
}

.profile-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-number {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--dark-gray);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--gray);
}

.follow-btn {
  padding: 8px 24px;
  font-size: 0.9rem;
}

.follow-btn.following {
  background-color: var(--light-gray);
  color: var(--dark-gray);
  border: 1px solid var(--border-color);
}

.follow-btn.following:hover {
  background-color: #dc3545;
  color: var(--white);
  border-color: #dc3545;
}

.follow-btn.following:hover::after {
  content: " Unfollow";
}

.settings-btn {
  color: var(--gray);
  font-size: 1.2rem;
  text-decoration: none;
  padding: 5px;
  transition: color 0.3s ease;
}

.settings-btn:hover {
  color: var(--primary-color);
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.tab-btn {
  flex: 1;
  padding: 15px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray);
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: rgba(0, 166, 90, 0.05);
}

.tab-btn:hover {
  background-color: var(--light-gray);
}

/* Profile Content */
.profile-content {
  min-height: 300px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.post-thumbnail {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--light-gray);
}

.post-thumbnail img,
.post-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-thumbnail:hover img,
.post-thumbnail:hover video {
  transform: scale(1.05);
}

.video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  pointer-events: none;
}

.post-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-thumbnail:hover .post-overlay {
  opacity: 1;
}

.post-stats {
  color: var(--white);
  font-weight: bold;
  display: flex;
  gap: 15px;
}

/* Comments Section */
.comments-section {
  margin-top: 15px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

.comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.comment-author {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--dark-gray);
}

.comment-time {
  font-size: 0.8rem;
  color: var(--gray);
}

.comment-text {
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.comment-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.comment-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  resize: none;
  max-height: 80px;
  min-height: 36px;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.comment-submit {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.comment-submit:hover {
  background: var(--primary-dark);
}

.comment-submit:disabled {
  background: var(--gray);
  cursor: not-allowed;
}

.load-comments-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 5px 0;
  text-decoration: underline;
}

.load-comments-btn:hover {
  color: var(--primary-dark);
}

/* Responsive Design for Profile */
@media (max-width: 480px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .profile-picture-large {
    width: 80px;
    height: 80px;
  }

  .profile-stats {
    justify-content: center;
  }

  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
  }

  .comment-form {
    flex-direction: column;
    gap: 8px;
  }

  .comment-submit {
    align-self: flex-end;
  }
}
