/**
 * Shared popup chrome: header row (title left, close right) and in-header close buttons.
 * Loaded site-wide from includes/header.php.
 */

.popup-header {
  padding: 1.5rem 1.5rem 1rem 1rem !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
}

.popup-header h2,
.popup-header .popup-header-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

/* Close control lives inside .popup-header (not absolutely positioned on the wrapper). */
.popup-header > [class$="_close"],
.popup-header > .popup-close-btn {
  position: static;
  flex: 0 0 auto;
  top: auto;
  right: auto;
  margin: 0;
  padding: 0;
  cursor: pointer;
  border: none;
  color: transparent;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-family: sans-serif;
  text-indent: -9000px;
  overflow: hidden;
  background: url(../get_media.php?path=bg/close.png) no-repeat center;
  background-size: contain;
  transform: rotate(45deg);
}

/* Login / tribe invite styled popups */
#inviteFormWrapper .popup-header,
#resendFormWrapper .popup-header,
#tribeInviteFormWrapper .popup-header,
#exploreDiscoverPopup .popup-header {
  padding: 0 0 1rem !important;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

#inviteFormWrapper .popup-header h2,
#resendFormWrapper .popup-header h2,
#tribeInviteFormWrapper .popup-header h2,
#exploreDiscoverPopup .popup-header h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: #38439e;
  font-family: 'freight-display-pro', serif;
  padding-left: 1rem;
}

#systemMailDraftPopup {
  position: relative;
  background: #fff;
  width: 90%;
  max-width: 40rem;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  color: #75779a;
  font-family: 'freight-display-pro', serif;
}

#systemMailDraftPopup .popup-content {
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: inherit;
}

#systemMailDraftPopup .popup-body {
  overflow: auto;
  padding: 0 1.5rem 1.5rem;
}

#systemMailDraftPopup .email-draft-to,
#systemMailDraftPopup .email-draft-from,
#systemMailDraftPopup .email-draft-subject {
  margin: 0.35rem 0;
  font-size: 1rem;
}

#systemMailDraftPopup .email-draft-preview-wrap {
  margin: 1rem 0;
}

#systemMailDraftPopup .email-draft-preview-wrap strong {
  display: block;
  margin-bottom: 0.5rem;
}

#systemMailDraftPopup .email-draft-preview {
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  background: #fcfcfa;
  max-height: 240px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

#systemMailDraftPopup .email-draft-status {
  min-height: 1.2rem;
  margin: 0.5rem 0 0;
  color: #c62828;
}

#systemMailDraftPopup .email-draft-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

#systemMailDraftPopup .email-draft-btn {
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  border-radius: 0.5rem;
  font-family: inherit;
  background: #91dde9;
  color: #fff;
  border: none;
  font-size: 0.95rem;
}

#systemMailDraftPopup .email-draft-btn:hover {
  opacity: 0.9;
}

#systemMailDraftPopup .email-draft-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
