/* Profili Görüntüle modal */
.profile-readonly-field {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-light, #f5f7fa);
  border: 1px solid var(--border-light, var(--border));
  font-size: 14px;
  font-weight: 600;
  color: var(--dark, var(--text));
  word-break: break-word;
}

body.theme-dark .profile-readonly-field {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.profile-view-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

/* Profil penceresi — sabit yükseklik, içerik sekme içinde kayar */
#modalOverlay > .modal.modal--profile-view,
#modalOverlay > .modal:has(.profile-view-modal) {
  display: flex;
  flex-direction: column;
  height: min(580px, calc(88vh - 2rem));
  min-height: min(580px, calc(88vh - 2rem));
  max-height: min(580px, calc(88vh - 2rem));
  overflow: hidden;
}

#modalOverlay > .modal.modal--profile-view .modal-header,
#modalOverlay > .modal:has(.profile-view-modal) .modal-header {
  flex-shrink: 0;
}

#modalOverlay > .modal.modal--profile-view .modal-body,
#modalOverlay > .modal:has(.profile-view-modal) .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-view-wall-wrap,
.profile-view-gifts-wrap {
  flex: 1;
  min-height: 0;
}

.profile-view-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.profile-view-tab {
  flex: 1 0 auto;
  min-width: 88px;
  min-height: 40px;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--mid, var(--text-muted));
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.profile-view-tab:hover {
  color: var(--dark, var(--text));
}

.profile-view-tab.active {
  background: var(--white, #fff);
  color: var(--primary, #2979ff);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.profile-view-tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-view-tab-panel.active {
  display: flex;
}

.profile-view-tab-panel[data-tab-panel='info'] .profile-view-actions {
  margin-top: auto;
  padding-top: 8px;
  flex-shrink: 0;
}

/* Modal başlığı — avatar + nick + durum */
.modal-header--profile-view {
  align-items: flex-start;
  padding-top: 14px;
  padding-bottom: 14px;
}

.modal-header--profile-view #modalTitle {
  font-weight: 400;
}

.profile-view-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-align: left;
}

.profile-view-header-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.profile-view-header-avatar .avatar-frame-slot {
  --frame-size: 52px;
  width: var(--frame-size);
  height: var(--frame-size);
}

.profile-view-header-avatar .profile-view-avatar-wrap,
.profile-view-header-avatar .profile-view-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.profile-view-header-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.profile-view-header-identity .user-name-meta-block {
  align-items: flex-start;
}

.profile-view-header-identity .profile-view-name,
.profile-view-header-identity .member-name,
.profile-view-header-identity .online-user-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-view-header-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mid, var(--text-muted));
  line-height: 1.3;
  max-width: 100%;
}

.profile-view-header-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-view-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-view-field--styled {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--chat-modal-card-radius, 12px);
  background: var(--bg-light);
  border: 1px solid var(--border);
}

.profile-view-field-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-view-field-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary, #2979ff);
  opacity: 0.88;
}

.profile-view-field--styled .profile-view-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mid, var(--text-muted));
}

.profile-view-field--styled .profile-view-field-value {
  font-size: 14px;
  color: var(--dark, var(--text));
  padding-left: 24px;
}

.profile-view-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--chat-modal-card-radius, 12px);
  background: var(--bg-light);
  border: 1px solid var(--border);
}

.profile-view-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--light, var(--text-muted));
}

.profile-view-field-value {
  font-size: 14px;
  color: var(--dark, var(--text));
  word-break: break-word;
}

.profile-view-actions {
  display: flex;
  justify-content: stretch;
  padding-top: 4px;
}

.profile-view-pm-btn {
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.profile-view-gifts-wrap {
  width: 100%;
}

.profile-view-gifts-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--dark, var(--text));
}

.profile-view-gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

.profile-view-gift-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.profile-gift-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.profile-gift-placeholder {
  font-size: 24px;
  line-height: 1;
}

.profile-gift-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #2979ff);
}

.profile-gift-name {
  font-size: 10px;
  line-height: 1.2;
  color: var(--mid, var(--text-muted));
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-view-gifts-empty,
.profile-view-gifts-loading {
  font-size: 13px;
  color: var(--mid, var(--text-muted));
  padding: 8px 0;
}

body.theme-dark .profile-gift-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .profile-view-field--styled {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .profile-view-field {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .profile-view-tabs {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .profile-view-tab.active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

@media (max-width: 480px) {
  #modalOverlay > .modal.modal--profile-view,
  #modalOverlay > .modal:has(.profile-view-modal) {
    height: min(78dvh, calc(100dvh - 2.5rem));
    min-height: min(78dvh, calc(100dvh - 2.5rem));
    max-height: min(78dvh, calc(100dvh - 2.5rem));
  }

  .modal-header--profile-view {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .profile-view-tab {
    min-height: 44px;
    font-size: 12px;
    padding: 8px 6px;
  }

  .profile-view-modal-header {
    gap: 10px;
  }

  .profile-view-header-avatar .avatar-frame-slot {
    --frame-size: 48px;
  }

  .profile-view-header-avatar .profile-view-avatar-wrap,
  .profile-view-header-avatar .profile-view-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .profile-view-header-identity .profile-view-name,
  .profile-view-header-identity .member-name,
  .profile-view-header-identity .online-user-name {
    font-size: 15px;
  }

  .profile-view-header-status {
    font-size: 11px;
  }
}
