/* Profile — social-app layout (Instagram / X style), dark theme */

.profile-container {
  max-width: 540px;
  margin: 0 auto;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  padding: 0;
  background: #000 !important;
  overflow: visible;
}

/* Cover banner */
.profile-cover {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: 0;
  overflow: hidden;
  margin: 0;
  background: #121212;
  border: none;
  border-bottom: 1px solid #262626;
}

.profile-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #141414 100%);
}

#profile-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-cover-edit {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Header under cover — avatar overlaps */
.profile-header {
  display: block !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 1rem 1rem !important;
  margin: 0 0 0.5rem !important;
  animation: none !important;
}

.profile-header-top {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  margin-top: -44px;
  margin-bottom: 0.85rem;
}

.profile-avatar {
  width: 88px !important;
  height: 88px !important;
  border-radius: 50%;
  background: #1a1a1a !important;
  border: 3px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: none !important;
}

.profile-avatar img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar.has-photo::before {
  display: none;
}

.profile-avatar::before {
  display: none;
}

.profile-header-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 0.35rem;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-name-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.profile-display-name {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 0 !important;
  line-height: 1.2;
}

.profile-username {
  color: #a8a8a8 !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

.profile-bio {
  color: #dbdbdb;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0.35rem 0 0.15rem;
  white-space: pre-wrap;
}

.profile-stats-section {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 1.25rem !important;
  margin-top: 0.55rem;
}

.profile-post-count,
.profile-join-date {
  font-size: 0.88rem !important;
  color: #a8a8a8 !important;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-post-count::before,
.profile-join-date::before {
  content: none !important;
}

.profile-post-count strong {
  color: #fff;
  font-weight: 700;
  margin-right: 0.2rem;
}

.ep-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #f5f5f5;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  margin-top: 0;
  text-decoration: none;
}

.ep-edit-btn:hover {
  background: #1a1a1a;
  border-color: #555;
}

/* Posts — match home feed cards */
.profile-posts-section {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  animation: none !important;
}

.posts-grid-header {
  margin: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #262626 !important;
  border-top: 1px solid #262626;
}

.posts-grid-header h3 {
  font-size: 0.95rem !important;
  font-weight: 650 !important;
  color: #fff !important;
  margin: 0 !important;
  letter-spacing: 0.02em;
}

.profile-posts-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.profile-post-card {
  background: #000 !important;
  border: none !important;
  border-bottom: 1px solid #262626 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.85rem 0 0.35rem !important;
  margin: 0 !important;
  position: relative;
}

.profile-post-content {
  color: #f5f5f5 !important;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.15rem 0.9rem 0.4rem;
  word-break: break-word;
}

.profile-post-content .highlight {
  color: #60a5fa;
}

.profile-post-media {
  margin: 0.35rem 0;
  background: #111;
}

.profile-post-media img,
.profile-post-media video {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.profile-post-time {
  color: #737373 !important;
  font-size: 0.72rem !important;
  padding: 0 0.9rem 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Same labeled pills as home feed */
.profile-post-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.4rem !important;
  margin: 0.35rem 0 0 !important;
  padding: 0.65rem 0.75rem 0.75rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  justify-content: flex-start !important;
  overflow: visible !important;
}

.profile-post-actions .support-btn,
.profile-post-actions .dislike-btn,
.profile-post-actions .comment-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #1a1a1a !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  white-space: nowrap;
}

.profile-post-actions .support-btn.supported {
  color: #1d4ed8 !important;
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}

.profile-post-actions .dislike-btn.disliked {
  color: #b45309 !important;
  background: #fffbeb !important;
  border-color: #fde68a !important;
}

.profile-post-actions .support-btn i,
.profile-post-actions .dislike-btn i,
.profile-post-actions .comment-btn i {
  font-size: 0.85rem;
}

.three-dot-wrapper {
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  z-index: 10 !important;
}

.three-dot-menu {
  background: #1a1a1a !important;
  border: 1px solid #333 !important;
  color: #fff !important;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 36px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  overflow: hidden;
  min-width: 120px;
}

.delete-menu.open,
.delete-menu[style*="block"] {
  display: block !important;
}

.delete-menu button {
  width: 100%;
  background: transparent;
  border: none;
  color: #f87171;
  padding: 0.65rem 0.85rem;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.no-posts {
  text-align: center;
  color: #888;
  padding: 2.5rem 1rem;
  background: transparent !important;
  border: none !important;
}

.no-posts::before {
  content: none !important;
}

/* Edit profile modal */
.ep-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ep-modal {
  background: #121212;
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding-bottom: 28px;
  border: 1px solid #262626;
}

.ep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #262626;
  position: sticky;
  top: 0;
  background: #121212;
  z-index: 1;
}

.ep-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.ep-cancel {
  background: none;
  border: none;
  color: #a8a8a8;
  font-size: 0.95rem;
  cursor: pointer;
}

.ep-save {
  background: #e63946;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
}

.ep-save:disabled {
  opacity: 0.5;
}

.ep-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.1rem 1rem 0.9rem;
  border-bottom: 1px solid #262626;
  gap: 0.55rem;
}

.ep-cover-preview {
  width: 100%;
  max-width: 420px;
  height: 110px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid #333;
  background: #0a0a0a;
}

.ep-cover-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #1a1a1a, #242424);
}

.ep-cover-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-avatar-wrap {
  position: relative;
  cursor: pointer;
}

.ep-avatar-circle {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e63946;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #e63946;
  font-weight: 700;
}

.ep-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-camera-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: #e63946;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid #121212;
}

.ep-cover-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
}

.ep-upload-btn {
  background: transparent;
  color: #f5f5f5;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ep-upload-btn:hover {
  background: #1a1a1a;
}

.ep-fields {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ep-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ep-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}

.ep-input {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.ep-input:focus {
  border-color: #e63946;
}

.ep-textarea {
  height: 80px;
  resize: none;
}

@media (max-width: 600px) {
  .profile-cover {
    height: 140px;
  }
  .profile-avatar {
    width: 76px !important;
    height: 76px !important;
  }
  .profile-header-top {
    margin-top: -38px;
  }
}
