/* ============================================================
   MESSAGES ENHANCED CSS
   ============================================================ */

/* ======================== TYPING INDICATOR ======================== */
.typing-indicator-bubble {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 18px;
  width: fit-content;
  margin-bottom: 12px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* ======================== PROFILE STATUS ======================== */
#profileStatus {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ======================== PROFILE MODAL ======================== */
#screen-profile {
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--card) 100%);
}

.profile-header {
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-soft) 100%);
}

.profile-dp-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.profile-username {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.profile-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
  padding: 0 16px;
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.profile-stat-label {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}

.profile-action-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.2s;
}

.profile-action-btn.following {
  background: var(--bg-alt);
  color: var(--ink);
  border: 1px solid var(--line);
}

.profile-action-btn:active {
  opacity: 0.8;
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.profile-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profile-list {
  padding: 8px 0;
}

.profile-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.profile-user-item:active {
  background: var(--bg-alt);
}

.profile-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  overflow: hidden;
}

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

.profile-user-info {
  flex: 1;
  min-width: 0;
}

.profile-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.profile-user-username {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ======================== MESSAGE ACTION MENU ======================== */
#messageActionsMenu {
  position: fixed;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 150;
  min-width: 180px;
  display: none;
  bottom: 20px;
  right: 20px;
  animation: slideUp 0.2s ease;
}

#messageActionsMenu.show {
  display: block;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-action-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.msg-action-item:last-child {
  border-bottom: none;
}

.msg-action-item:active {
  background: var(--bg-alt);
}

.msg-action-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.msg-action-label {
  flex: 1;
  color: var(--ink);
  font-weight: 500;
}

/* ======================== DP ZOOM VIEW ======================== */
.dp-zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.dp-zoom-overlay.show {
  display: flex;
}

.dp-zoom-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.dp-zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-zoom-close:active {
  background: rgba(255, 255, 255, 0.4);
}

/* ======================== PROFILE TOPBAR ======================== */
.profile-topbar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.profile-topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.profile-topbar-btn:active {
  background: var(--line);
}