/* RD Subscribe — Frontend Styles */

/* ========== Inline Form ========== */
.rd-subscribe-form-wrap {
  width: 100%;
}

.rd-subscribe-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rd-subscribe-email-input {
  flex: 1;
  min-width: 220px;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255,255,255,0.7);
  color: #fff;
  font-size: 15px;
  padding: 10px 4px;
  outline: none;
  transition: border-color 0.2s;
}

.rd-subscribe-email-input::placeholder {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
}

.rd-subscribe-email-input:focus {
  border-bottom-color: #fff;
}

.rd-subscribe-btn {
  background: #fff;
  color: #E8541E;
  border: none;
  border-radius: 30px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.5px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.rd-subscribe-btn:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.rd-subscribe-btn:active {
  transform: translateY(0);
}

.rd-subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.rd-subscribe-message {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  min-height: 18px;
}

/* ========== Overlay / Popover ========== */
.rd-subscribe-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 16px;
}

.rd-subscribe-overlay.rd-visible {
  opacity: 1;
}

/* ---- Input popover (before submit) ---- */
.rd-subscribe-popover {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px 40px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
  opacity: 0;
}

.rd-subscribe-overlay.rd-visible .rd-subscribe-popover {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.rd-subscribe-popover__close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.rd-subscribe-popover__close:hover {
  color: #333;
  background: #f4f4f4;
}

.rd-subscribe-popover__accent {
  width: 44px;
  height: 5px;
  background: #E8541E;
  border-radius: 4px;
  margin-bottom: 24px;
}

.rd-subscribe-popover h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px;
  line-height: 1.3;
}

.rd-subscribe-popover h2 .rd-heading-black {
  color: #1a1a1a !important;
}

.rd-subscribe-popover p {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  margin: 0 0 28px;
}

.rd-subscribe-popover__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rd-subscribe-popover__email-input {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 15px;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.rd-subscribe-popover__email-input:focus {
  border-color: #E8541E;
}

.rd-subscribe-popover__submit {
  background: #E8541E;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.3px;
}

.rd-subscribe-popover__submit:hover {
  background: #d14918;
  transform: translateY(-1px);
}

.rd-subscribe-popover__submit:active {
  transform: translateY(0);
}

.rd-subscribe-popover__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.rd-subscribe-popover__message {
  font-size: 13px;
  color: #d14918;
  min-height: 16px;
  text-align: center;
}

/* ---- Success popover ---- */
.rd-subscribe-success-popover {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
  opacity: 0;
}

.rd-subscribe-overlay.rd-visible .rd-subscribe-success-popover {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.rd-subscribe-success-popover__checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #E8541E;
  color: #fff;
  font-size: 28px;
  margin-bottom: 24px;
  animation: rd-pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes rd-pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.rd-subscribe-success-popover h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 16px;
}

.rd-subscribe-success-popover p {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  margin: 0 0 8px;
}

.rd-subscribe-success-popover__close-btn {
  margin-top: 28px;
  background: none;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.rd-subscribe-success-popover__close-btn:hover {
  border-color: #E8541E;
  color: #E8541E;
}

/* ========== Unsubscribe notice ========== */
.rd-subscribe-unsubscribe-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  padding: 16px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-width: 480px;
  text-align: center;
  animation: rd-slide-up 0.35s ease forwards;
}

@keyframes rd-slide-up {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.rd-subscribe-unsubscribe-success {
  background: #1a1a1a;
  color: #fff;
}

.rd-subscribe-unsubscribe-error {
  background: #c0392b;
  color: #fff;
}

/* ========== Category selection popover ========== */
.rd-subscribe-category-popover {
  background: #fff;
  border-radius: 16px;
  padding: 40px 40px 36px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
  opacity: 0;
}

.rd-subscribe-overlay.rd-visible .rd-subscribe-category-popover {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.rd-subscribe-category-popover__close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.rd-subscribe-category-popover__close:hover {
  color: #333;
  background: #f4f4f4;
}

.rd-subscribe-category-popover__accent {
  width: 44px;
  height: 5px;
  background: #E8541E;
  border-radius: 4px;
  margin-bottom: 20px;
}

.rd-subscribe-category-popover h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
  line-height: 1.3;
}

.rd-subscribe-category-popover > p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 20px;
}

.rd-subscribe-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.rd-subscribe-category-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rd-subscribe-category-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #d0d0d0;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
  position: relative;
}

.rd-subscribe-category-item input[type="checkbox"]:checked {
  background: #E8541E;
  border-color: #E8541E;
}

.rd-subscribe-category-item input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.rd-subscribe-category-item label {
  font-size: 14px;
  color: #333;
  cursor: pointer;
  line-height: 1.4;
}

.rd-subscribe-category-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rd-subscribe-category-submit {
  background: #E8541E;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.3px;
  width: 100%;
}

.rd-subscribe-category-submit:hover {
  background: #d14918;
  transform: translateY(-1px);
}

.rd-subscribe-category-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.rd-subscribe-category-skip {
  background: none;
  border: none;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  text-decoration: underline;
  transition: color 0.15s;
}

.rd-subscribe-category-skip:hover {
  color: #555;
}

.rd-subscribe-category-loading {
  text-align: center;
  color: #888;
  font-size: 14px;
  padding: 20px 0;
}

/* ========== Admin styles ========== */
.rd-subscribe-admin h1 {
  margin-bottom: 20px;
}

.rd-subscribe-stats-bar {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.rd-stat {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

.rd-stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #E8541E;
  line-height: 1;
  margin-bottom: 4px;
}

.rd-stat-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rd-subscribe-actions-bar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.rd-next-send {
  margin: 0;
  font-size: 13px;
  color: #555;
}

.rd-subscribers-table th {
  font-weight: 600;
}

.rd-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.rd-status-active {
  background: #e8f5e9;
  color: #2e7d32;
}

.rd-status-unsubscribed {
  background: #fce4ec;
  color: #c62828;
}
