/* =====================================================
   PROFILE - Profile card, stats, buttons, badges
   ===================================================== */

/* Compensar header fixed en vistas de perfil */

/* Profile Card */
.profile-card {
  background: #fff;
  padding: 24px 16px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.avatar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 10;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e0e0e0;
  position: relative;
  z-index: 10;
}

.avatar-loader {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #eee;
  border-top: 4px solid #2196f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.profile-name-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin: 0;
}

.profile-bio {
  font-size: 14px;
  color: #666;
  margin: 0 0 20px 0;
  line-height: 1.4;
}

/* Profile Stats */
.profile-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 0 20px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 20px;
  font-weight: 700;
  color: #000;
}

.stat-label {
  font-size: 13px;
  color: #666;
  margin-top: 2px;
  z-index: 1002 !important;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

/* Profile Action Buttons */
.profile-buttons {
  display: flex;
  gap: 12px;
  padding: 0 16px;
}

.profile-buttons-centered {
  justify-content: center;
}

.btn-profile-action {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-black {
  z-index: 1002 !important;
  background: #000;
  color: #fff;
}

.btn-black:hover {
  background: #333;
}

.btn-gray {
  background: #e0e0e0;
  color: #000;
}

.btn-gray:hover {
  background: #d0d0d0;
}

/* Icon button (share button) */
.btn-profile-icon {
  width: 44px;
  height: 44px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-profile-icon:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.btn-icon-svg {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Follow Button Fix */
#btnFollowOtherProfile {
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: flex;
  flex-direction: column;
}

/* Verified Badge */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  vertical-align: middle;
}

.profile-name-container .verified-badge {
  width: 22px;
  height: 22px;
}

.search-user-name .verified-badge {
  width: 16px;
  height: 16px;
}

.verified-badge-small {
  width: 14px;
  height: 14px;
  margin-left: 0.5px;
  vertical-align: middle;
}

.post-username .verified-badge-small {
  vertical-align: text-bottom;
}

/* Profile Loading State */
.profile-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: #666;
  font-size: 14px;
}

/* Tabs Bar */
.tabs-bar {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
  flex: 1;
  padding: 16px;
  background: #fff;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 700;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  color: #000;
  border-bottom-color: #000;
}

/* Profile CTA for anonymous users */
.public-profile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  padding: 10px 16px 10px 16px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.10);
  z-index: 1002;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: inherit;
  font-size: 16px;
  animation: slideUpCta 0.3s cubic-bezier(.23,1.01,.32,1);
}

.public-profile-cta-text {
  color: #222;
  font-weight: 500;
  margin: 0;
  padding: 0;
}

.public-profile-cta .btn-primary {
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  margin: 0;
}

.public-profile-cta .btn-primary:hover {
  background: #333;
}

.public-profile-cta h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #222;
}

/* Followers View */
#view-followers {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#view-followers .feed-header {
  flex-shrink: 0;
}

#followersList {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

/* Other Profile View */
#view-otherprofile {
  flex-direction: column !important;
  width: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#view-otherprofile[style*="display: flex"],
#view-otherprofile[style*="display:flex"] {
  display: flex !important;
}

#view-otherprofile > * {
  width: 100% !important;
  flex-shrink: 0 !important;
}

#view-otherprofile .feed-header,
#view-otherprofile .profile-card,
#view-otherprofile .tabs-bar,
#view-otherprofile #otherFeedGrid {
  width: 100% !important;
  flex-shrink: 0 !important;
}

@media (max-width: 480px) {
  .profile-card {
    padding: 16px 12px;
  }

  .profile-buttons {
    padding: 0 12px;
  }

  .avatar {
    width: 80px;
    height: 80px;
  }
}
