/* Plugin: InstructorPro Suite | File Version: 2016v4 */
/* EZ2D Email Settings - Standardized module styling */

.ez2d-email-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ez2d-email-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.ez2d-email-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ez2d-email-header-actions {
  margin-left: auto;
}

.ez2d-email-header-actions .ez2d-btn-modern {
  background: #fff;
  color: #1d4ed8;
  border: 0;
}

.ez2d-email-header-actions .ez2d-btn-modern:hover {
  background: #eff6ff;
}

.ez2d-email-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  flex-shrink: 0;
}

.ez2d-email-icon .dashicons {
  width: 28px;
  height: 28px;
  font-size: 28px;
}

.ez2d-email-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.ez2d-email-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0.25rem 0 0;
}

.ez2d-email-settings .ez2d-email-card {
  border-radius: 16px;
  border: 1px solid #dbe3f2;
}

.ez2d-email-settings .ez2d-card-header-inline {
  margin-bottom: 10px;
}

.ez2d-email-settings .ez2d-card-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ez2d-email-settings .ez2d-card-title-with-icon .dashicons {
  color: #2563eb;
}

.ez2d-email-settings .ez2d-section-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a;
}

.ez2d-email-settings .ez2d-field {
  margin-bottom: 14px;
}

.ez2d-email-settings .ez2d-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.45rem;
}

.ez2d-email-settings .ez2d-input,
.ez2d-email-settings select,
.ez2d-email-settings textarea,
.ez2d-email-settings input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  width: 100%;
  max-width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.ez2d-email-settings .ez2d-input:focus,
.ez2d-email-settings select:focus,
.ez2d-email-settings textarea:focus,
.ez2d-email-settings input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus {
  outline: none;
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.ez2d-email-settings .ez2d-email-wide {
  width: 100%;
}

.ez2d-email-settings .ez2d-email-to {
  width: min(100%, 640px);
}

.ez2d-email-settings .ez2d-help,
.ez2d-email-settings .ez2d-text-muted {
  font-size: 0.85rem;
  color: #64748b;
}

.ez2d-email-settings .ez2d-email-editor-box {
  border: 2px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
}

.ez2d-email-settings .ez2d-email-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ez2d-email-settings .ez2d-email-editor-toolbar button {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.ez2d-email-settings .ez2d-email-editor-toolbar button:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.ez2d-email-settings .ez2d-email-save-wrap {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ez2d-email-settings #ez2d-email-save-msg {
  margin-left: 10px;
}

.ez2d-email-settings .ez2d-btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.ez2d-email-settings .ez2d-btn-secondary:hover {
  background: #cbd5e1;
}

.ez2d-email-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: none;
}

.ez2d-email-modal.open {
  display: block;
}

.ez2d-email-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.ez2d-email-modal-dialog {
  position: relative;
  width: min(900px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  z-index: 1;
}

.ez2d-email-modal-busy {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  z-index: 50;
  pointer-events: all;
}

.ez2d-email-modal-dialog.is-busy .ez2d-email-modal-busy {
  display: flex;
}

.ez2d-email-modal-busy-text {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.ez2d-email-modal-header,
.ez2d-email-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.ez2d-email-modal-footer {
  border-bottom: 0;
  border-top: 1px solid #e2e8f0;
}

.ez2d-email-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.ez2d-email-modal-close {
  border: 0;
  background: #f1f5f9;
  color: #334155;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.ez2d-email-modal-body {
  padding: 16px;
}

.ez2d-email-reminder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.ez2d-email-reminder-grid .ez2d-field {
  margin-bottom: 0;
}

.ez2d-email-reminder-grid .ez2d-field--full {
  grid-column: 1 / -1;
}

.ez2d-email-reminder-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.ez2d-email-reminder-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ez2d-email-settings .ez2d-reminder-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.ez2d-email-settings .ez2d-reminder-action-btn .dashicons {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

.ez2d-email-settings .ez2d-reminder-action-send {
  background: #2563eb;
  color: #fff;
}

.ez2d-email-settings .ez2d-reminder-action-send:hover {
  background: #1d4ed8;
}

.ez2d-email-settings .ez2d-reminder-action-reset {
  background: #e2e8f0;
  color: #334155;
}

.ez2d-email-settings .ez2d-reminder-action-reset:hover {
  background: #cbd5e1;
}

.ez2d-email-reminder-debug {
  margin-top: 10px;
}

.ez2d-email-balance-reminder-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ez2d-email-balance-reminder-scope {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ez2d-email-balance-reminder-scope label,
.ez2d-email-balance-reminder-controls > label {
  font-size: 0.9rem;
  color: #334155;
}

.ez2d-email-balance-reminder-list {
  border: 1px solid #dbe3f2;
  border-radius: 12px;
  max-height: 380px;
  overflow: auto;
}

.ez2d-email-balance-reminder-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) minmax(160px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.ez2d-email-balance-reminder-row:last-child {
  border-bottom: 0;
}

.ez2d-email-balance-reminder-row.is-unsubscribed {
  background: #f8fafc;
}

.ez2d-email-balance-reminder-name {
  font-weight: 700;
  color: #0f172a;
}

.ez2d-email-balance-reminder-meta {
  color: #64748b;
  font-size: 0.9rem;
}

.ez2d-email-balance-reminder-tags {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ez2d-email-settings .ez2d-email-balance-reminder-tags .tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.ez2d-email-settings .ez2d-email-balance-reminder-tags .tag-lessons {
  background: #dbeafe;
  color: #0369a1;
}

.ez2d-email-settings .ez2d-email-balance-reminder-tags .tag-balance {
  background: #fee2e2;
  color: #b91c1c;
}

.ez2d-email-settings .ez2d-email-balance-reminder-tags .tag-upcoming {
  background: #e2e8f0;
  color: #475569;
}

.ez2d-email-settings .ez2d-email-balance-reminder-tags .tag-unsubscribed {
  background: #e5e7eb;
  color: #374151;
}

.ez2d-email-balance-reminder-empty {
  padding: 14px;
  color: #64748b;
}

@media (max-width: 768px) {
  .ez2d-email-header {
    padding: 1rem;
    border-radius: 14px;
    flex-wrap: wrap;
  }

  .ez2d-email-title {
    font-size: 1.25rem;
  }

  .ez2d-email-header-actions {
    margin-left: 0;
    width: 100%;
  }

  .ez2d-email-header-actions .ez2d-btn-modern {
    width: 100%;
  }

  .ez2d-email-settings .ez2d-email-to {
    width: 100%;
  }

  .ez2d-email-settings .ez2d-btn-modern {
    width: 100%;
  }

  .ez2d-email-settings #ez2d-email-save-msg {
    display: block;
    margin-left: 0;
    margin-top: 8px;
  }

  .ez2d-email-reminder-grid {
    grid-template-columns: 1fr;
  }

  .ez2d-email-modal {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ez2d-email-modal-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
  }

  .ez2d-email-modal-footer {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .ez2d-email-reminder-actions .ez2d-reminder-action-btn {
    width: 100%;
    justify-content: center;
  }

  .ez2d-email-balance-reminder-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ez2d-email-balance-reminder-meta {
    grid-column: 2;
  }

  .ez2d-email-balance-reminder-tags {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
