/* Profile Page Styles */

.header-simple {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  z-index: 100;
  height: 56px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.btn-back,
.btn-share {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #333;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-back:hover,
.btn-share:hover {
  background: #f0f0f0;
}

.header-title {
  flex: 1;
  text-align: center;
}

.header-title h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #333;
}

.header-title p {
  font-size: 12px;
  color: #666;
  margin: 2px 0 0;
}

/* Profile Main */
.profile-main {
  margin-top: 56px;
  padding-bottom: 80px;
  width: 100%;
  max-width: 720px;
  min-height: 1360px;
  margin-left: auto;
  margin-right: auto;
  background: white;
}

/* Cover Photo */
.profile-cover {
  position: relative;
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #c2c2c2 0%, #3e3d40 100%);
  overflow: hidden;
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-edit-cover {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
}

.btn-edit-cover:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Profile Header Section */
.profile-header-section {
  padding: 0 20px;
  margin-top: -50px;
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.profile-avatar-wrapper {
  position: relative;
  pointer-events: auto;
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
  background: #f0f0f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-edit-avatar {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: #545c8000;
  border: 2px solid #ffffff00;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
}

.btn-edit-avatar:hover {
  background: #ded8d8;
}

/* Profile Actions */
.profile-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  pointer-events: auto;
}

.btn-follow,
.btn-message,
.btn-edit-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-follow {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.btn-follow:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-follow.following {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-message {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-message:hover {
  background: #f8f9fa;
}

.btn-edit-profile {
  background: white;
  color: #333;
  border: 2px solid #ddd;
}

.btn-edit-profile:hover {
  background: #f8f9fa;
  border-color: #667eea;
  color: #667eea;
}

/* Profile Info Section */
.profile-info-section {
  padding: 16px 20px;
}

.profile-name-verified {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-name-verified h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  color: #333;
}

.verified-badge {
  flex-shrink: 0;
}

.profile-username {
  font-size: 15px;
  color: #666;
  margin: 4px 0 12px;
}

.profile-bio {
  font-size: 15px;
  line-height: 1.5;
  color: #333;
  margin: 12px 0;
  white-space: pre-wrap;
}

/* Profile Meta */
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #666;
}

.meta-item svg {
  flex-shrink: 0;
}

.meta-item a {
  color: #101113;
  text-decoration: none;
}

.meta-item a:hover {
  text-decoration: underline;
}

/* Profile Stats Detailed */
.profile-stats-detailed {
  display: flex;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  margin: 16px 0;
}

.stat-item-detailed {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s;
}

.stat-item-detailed:hover {
  transform: translateY(-2px);
}

.stat-number {
  font-size: 22px;
  font-weight: 800;
  color: #333;
  background: linear-gradient(135deg, #171717, #141313);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: #666;
  margin-top: 2px;
}

/* Tabs */
.profile-tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  background: white;
  position: sticky;
  top: 56px;
  z-index: 90;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #f8f9fa;
  color: #ffc4f9;
}

.tab-btn.active {
  color: #1c1c1a;
  border-bottom-color: #16161a;
}

.tab-btn svg {
  stroke-width: 2;
}

/* Tab Content */
.profile-tab-content {
  min-height: 400px;
}

.tab-pane {
  display: none;
  padding: 16px;
}

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

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

.post-item {
  aspect-ratio: 1;
  background: #f0f0f0;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.post-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.post-item:hover img {
  transform: scale(1.05);
}

.post-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.2s;
  color: white;
  font-weight: 600;
}

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

.post-item-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.media-item {
  aspect-ratio: 1;
  background: #f0f0f0;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item-video-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  font-size: 12px;
}

/* Saved Grid */
.saved-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner p {
  margin-top: 16px;
  color: #666;
  font-size: 14px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.empty-state svg {
  margin-bottom: 16px;
}

.empty-state p {
  color: #999;
  font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
  .profile-cover {
    height: 160px;
  }
  
  .profile-avatar-large {
    width: 100px;
    height: 100px;
  }
  
  .profile-header-section {
    margin-top: -40px;
  }
  
  .profile-actions {
    flex-direction: column;
  }
  
  .btn-follow,
  .btn-message,
  .btn-edit-profile {
    width: 100%;
    justify-content: center;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
}

.profile-info-section,
.profile-stats-detailed,
.tab-pane {
  animation: fadeIn 0.3s ease-out;
}
