/* Email Marketing - Contacts & Campaigns */

.email-contacts-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  margin-top: 20px;
}

.email-contacts-sidebar {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.email-contacts-sidebar h4 {
  margin: 0 0 15px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a202c;
}

.email-contact-groups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-contact-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.email-contact-group:hover {
  background: #e2e8f0;
}

.email-contact-group.active {
  background: #3b82f6;
  color: white;
}

.email-contact-group i {
  font-size: 14px;
}

.email-contact-group .group-count {
  margin-left: auto;
  font-size: 12px;
  background: rgba(0,0,0,0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.email-contacts-main {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.email-contacts-header {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.email-contacts-header input {
  flex: 1;
}

.email-contacts-list {
  overflow-x: auto;
}

/* Campaign Modal */
.email-campaign-modal .modal-content {
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.email-campaign-modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.email-campaign-modal-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.email-campaign-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.email-campaign-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
}

.email-campaign-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  opacity: 0.4;
  pointer-events: none;
}

.email-campaign-step.active {
  opacity: 1;
}

.email-campaign-step.completed {
  opacity: 1;
}

.email-campaign-step .step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #cbd5e0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s;
}

.email-campaign-step.active .step-number {
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.email-campaign-step.completed .step-number {
  background: #10b981;
}

.email-campaign-step.completed .step-number::before {
  content: '✓';
}

.email-campaign-step .step-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.email-campaign-step.active .step-label {
  color: #1a202c;
  font-weight: 600;
}

.email-campaign-step-line {
  width: 7px;
  height: 2px;
  background: #cbd5e0;
  margin: 0 10px;
  margin-bottom: 28px;
}

.email-campaign-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.email-campaign-step-content {
  display: none;
}

.email-campaign-step-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

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

.email-campaign-step-content h4 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
}

.form-group input[type="radio"] {
  margin-right: 8px;
}

.email-recipient-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.email-recipient-group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.email-recipient-group-item:hover {
  background: #e2e8f0;
}

.email-recipient-group-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.email-recipient-group-item .group-count {
  margin-left: auto;
  font-size: 12px;
  color: #64748b;
}

.email-recipient-summary {
  padding: 15px;
  background: #eff6ff;
  border-radius: 6px;
  border-left: 4px solid #3b82f6;
}

.email-recipient-summary strong {
  margin-right: 8px;
}

.email-template-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.email-template-card {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.email-template-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.email-template-card.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.template-card-preview {
  height: 150px;
  background: #f8f9fa;
  overflow: hidden;
}

.template-card-info {
  padding: 12px;
  background: white;
}

.template-card-info h5 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a202c;
}

.email-template-preview {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-campaign-review {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.review-item {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  display: flex;
  gap: 10px;
}

.review-item strong {
  min-width: 150px;
  color: #64748b;
}

.review-item span {
  color: #1a202c;
  font-weight: 500;
}

.email-campaign-modal-footer {
  padding: 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .email-contacts-layout {
    grid-template-columns: 1fr;
  }
  
  .email-campaign-steps {
    overflow-x: auto;
    justify-content: flex-start;
  }
  
  .email-template-selector {
    grid-template-columns: 1fr;
  }
}
