/* =====================================================
   PROPERTY COMMUNICATION STYLES
   ===================================================== */

/* Communication Panel */
.communication-panel {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.communication-panel h3 {
  margin: 0 0 20px 0;
  color: #495057;
  font-size: 1.2rem;
  font-weight: 600;
}

.communication-panel h3 i {
  color: #007bff;
  margin-right: 8px;
}

/* Communication Content in Tabs */
.communication-content {
  background: transparent;
  padding: 0;
  margin: 0;
}

/* Loading message in communication tab */
.loading-message {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  font-size: 1rem;
}

.loading-message i {
  margin-right: 8px;
  color: #007bff;
}

/* Communication Groups */
.communication-group {
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.communication-group:last-child {
  margin-bottom: 0;
}

.communication-group h4 {
  margin: 0 0 12px 0;
  color: #343a40;
  font-size: 1rem;
  font-weight: 500;
}

.communication-group h4 i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.communication-group small {
  color: #6c757d;
  font-size: 0.875rem;
  display: block;
  margin-top: 8px;
}

/* Communication Buttons Row */
.communication-buttons-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Communication Row - holds buttons and contact details side by side */
.communication-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.communication-row .communication-buttons-row {
  flex: 0 0 auto;
  min-width: 280px;
}

.communication-row .contact-details {
  flex: 1;
  min-width: 200px;
}

/* Contact Details */
.contact-details {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  color: #495057;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.contact-details span {
  white-space: nowrap;
}

.contact-details span:not(:last-child)::after {
  content: " | ";
  color: #6c757d;
  margin-left: 15px;
}

.contact-details strong {
  color: #343a40;
  font-weight: 500;
  margin-right: 6px;
}

/* Communication Buttons */
.comm-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
  justify-content: center;
}

.comm-btn i {
  margin-right: 6px;
}

.comm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.comm-btn:disabled,
.comm-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  background-color: #6c757d !important;
  border-color: #6c757d !important;
}

.comm-btn:disabled:hover,
.comm-btn.disabled:hover {
  background-color: #6c757d !important;
  transform: none !important;
  box-shadow: none !important;
}

/* SMS Button */
.comm-btn-sms {
  background: #28a745;
  color: white;
}

.comm-btn-sms:hover {
  background: #218838;
  color: white;
}

/* Email Button */
.comm-btn-email {
  background: #007bff;
  color: white;
}

.comm-btn-email:hover {
  background: #0056b3;
  color: white;
}

/* =====================================================
   COMMUNICATION MODAL STYLES
   ===================================================== */

/* Modal Overlay */
.comm-modal,
.comm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.comm-modal.show,
.comm-modal-overlay.show {
  display: flex;
}

/* Modal Content */
.comm-modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Header */
.comm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.comm-modal-header h3 {
  margin: 0;
  color: #495057;
  font-size: 1.3rem;
  font-weight: 600;
}

.comm-modal-close {
  font-size: 1.5rem;
  font-weight: bold;
  color: #adb5bd;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.comm-modal-close:hover {
  color: #495057;
  background: #e9ecef;
}

/* Modal Body */
.comm-modal-body {
  padding: 20px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  margin-bottom: 5px;
  color: #495057;
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Preview Styles */
.comm-preview {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.comm-preview h5 {
  margin: 0 0 10px 0;
  color: #495057;
  font-size: 1rem;
  font-weight: 600;
}

.preview-subject {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.preview-content {
  color: #495057;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Modal Footer */
.comm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

.btn {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.btn i {
  margin-right: 6px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border-color: #6c757d;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
  border-color: #545b62;
  color: white;
}

/* AI Generate Button */
.btn-ai-generate {
  background: #9c27b0;
  color: white;
  border: 1px solid #9c27b0;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ai-generate:hover:not(:disabled) {
  background: #7b1fa2;
  border-color: #7b1fa2;
}

.btn-ai-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ai-generate i {
  font-size: 0.9rem;
}

.btn-primary {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.btn-primary:hover:not(:disabled) {
  background: #0056b3;
  border-color: #004085;
  color: white;
}

.btn-success {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
  border-color: #1e7e34;
  color: white;
}

/* =====================================================
   MESSAGE NOTIFICATIONS
   ===================================================== */

.comm-message-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1060;
  max-width: 400px;
}

.comm-message {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: messageSlideIn 0.3s ease;
  position: relative;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.comm-message i {
  margin-right: 10px;
  font-size: 1.1rem;
}

.comm-message-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.comm-message-close:hover {
  opacity: 1;
}

.comm-message-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.comm-message-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.comm-message-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
  .communication-buttons-row {
    flex-direction: column;
  }

  .comm-btn {
    width: 100%;
    min-width: auto;
  }

  .comm-modal {
    padding: 10px;
  }

  .comm-modal-content {
    max-height: 95vh;
  }

  .comm-modal-header,
  .comm-modal-body,
  .comm-modal-footer {
    padding: 15px;
  }

  .comm-modal-footer {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .comm-message-container {
    left: 10px;
    right: 10px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .communication-panel {
    padding: 15px;
    margin: 15px 0;
  }

  .communication-group {
    padding: 12px;
  }

  .comm-modal-header h3 {
    font-size: 1.1rem;
  }
}

/* Communication History */
.comm-history-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.comm-history-item {
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.comm-history-item:hover {
  border-color: #007bff;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

/* Direction-specific styling */
.comm-history-item.inbound {
  border-left: 4px solid #28a745;
  background: #f8fff9;
}

.comm-history-item.outbound {
  border-left: 4px solid #007bff;
  background: #f8f9ff;
}

.comm-history-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.comm-history-direction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.875rem;
}

.comm-history-item.inbound .comm-history-direction {
  color: #28a745;
}

.comm-history-item.outbound .comm-history-direction {
  color: #007bff;
}

.comm-history-direction i {
  font-size: 0.75rem;
}

.comm-history-type {
  background: #6c757d;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.comm-history-status {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.comm-history-status.sent {
  background: #007bff;
  color: white;
}

.comm-history-status.delivered {
  background: #28a745;
  color: white;
}

.comm-history-status.failed {
  background: #dc3545;
  color: white;
}

.comm-history-status.responded {
  background: #17a2b8;
  color: white;
}

.comm-history-status.read {
  background: #6f42c1;
  color: white;
}

.comm-history-timestamp {
  color: #6c757d;
  font-size: 0.8rem;
  margin-left: auto;
}

.comm-history-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
}

.comm-history-details p {
  margin: 4px 0;
  color: #495057;
  font-size: 0.9rem;
  line-height: 1.4;
}

.comm-history-details strong {
  color: #212529;
  font-weight: 600;
}

/* AI Generate Response Button */
#commAiGenerateBtn {
  background: linear-gradient(135deg, #6f42c1, #8e5cc2);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(111, 66, 193, 0.2);
}

#commAiGenerateBtn:hover {
  background: linear-gradient(135deg, #5a3490, #7c4dae);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
  color: white;
}

#commAiGenerateBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(111, 66, 193, 0.2);
}

#commAiGenerateBtn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

#commAiGenerateBtn i {
  margin-right: 6px;
  font-size: 0.9rem;
}

/* AI Loading Animation */
#commAiGenerateBtn .fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* AI Response Indicator */
.ai-generated-indicator {
  background: linear-gradient(135deg, #6f42c1, #8e5cc2);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-generated-indicator i {
  margin-right: 4px;
  font-size: 0.7rem;
}

/* =====================================================
   CONVERSATION TEST STYLES
   ===================================================== */

.conversation-test-section {
  border-top: 2px solid #e9ecef;
  margin-top: 30px;
  padding-top: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.conversation-test-section h4 {
  color: #495057;
  margin-bottom: 15px;
}

.conversation-test-section h4 i {
  color: #28a745;
  margin-right: 8px;
}

.test-description {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.scenario-selection {
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scenario-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.scenario-dropdown {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

.scenario-dropdown:hover {
  border-color: #6366f1;
  background: #ffffff;
}

.scenario-dropdown:focus {
  outline: none;
  border-color: #6366f1;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.test-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.comm-btn-test {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comm-btn-test:hover {
  background: linear-gradient(135deg, #218838 0%, #1ba085 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.comm-btn-test:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.comm-btn-test:last-child {
  background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.comm-btn-test:last-child:hover {
  background: linear-gradient(135deg, #c82333 0%, #e8650e 100%);
}

.test-results {
  margin-top: 20px;
  border-top: 1px solid #dee2e6;
  padding-top: 20px;
}

.test-results h5 {
  color: #495057;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-conversation-content {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  max-height: 600px;
  overflow-y: auto;
}

.test-loading {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.test-loading i {
  color: #28a745;
  margin-right: 8px;
}

.test-error {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #f5c6cb;
  text-align: center;
}

.test-error i {
  margin-right: 8px;
  color: #dc3545;
}

.test-conversation {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.conversation-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.conversation-header h6 {
  color: #495057;
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: 600;
}

.conversation-info {
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.conversation-summary {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.conversation-summary h6 {
  color: #495057;
  margin-bottom: 12px;
  font-size: 1rem;
}

.summary-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 500;
}

.stat-value {
  font-size: 1.2rem;
  color: #495057;
  font-weight: 600;
}

.summary-note {
  color: #6c757d;
  font-size: 0.85rem;
  font-style: italic;
}

.summary-note i {
  margin-right: 6px;
  color: #17a2b8;
}

.conversation-messages {
  space-y: 12px;
}

.test-message {
  margin-bottom: 15px;
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid;
}

.test-message.wholesaler {
  background: #e3f2fd;
  border-left-color: #2196f3;
  margin-right: 20px;
}

.test-message.agent {
  background: #f3e5f5;
  border-left-color: #9c27b0;
  margin-left: 20px;
}

.test-message.owner {
  background: #e8f5e8;
  border-left-color: #4caf50;
  margin-left: 20px;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.message-sender {
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-sender.wholesaler {
  color: #1976d2;
}

.message-sender.agent {
  color: #7b1fa2;
}

.message-sender.owner {
  color: #388e3c;
}

.message-number {
  font-size: 0.75rem;
  color: #6c757d;
  background: #ffffff;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #dee2e6;
}

.message-content {
  color: #495057;
  line-height: 1.5;
  font-size: 0.95rem;
}

/* =====================================================
   AVATAR INVITATION STYLES
   ===================================================== */

/* Avatar invitation group */
.avatar-invitation-group {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  border: none;
}

/* Manual email instructions */
.manual-email-instructions {
  padding: 1rem 0;
}

.instruction-step {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.instruction-step h5 {
  color: #667eea;
  margin-bottom: 0.5rem;
}

.instruction-step h5 i {
  margin-right: 0.5rem;
}

.message-to-copy {
  margin-top: 0.5rem;
}

.message-to-copy textarea {
  font-family: monospace;
  font-size: 0.9rem;
  background: #ffffff;
  border: 1px solid #ddd;
  resize: vertical;
}

.form-check {
  padding: 0.5rem;
  background: #f0f8ff;
  border-radius: 6px;
  border: 1px solid #e3f2fd;
}

.form-check-label {
  font-weight: 500;
  color: #1976d2;
}

.form-check-label i {
  margin-right: 0.5rem;
}

.avatar-invitation-group h4 {
  color: white;
  margin-bottom: 1rem;
}

.avatar-invitation-info {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.avatar-invitation-info p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.comm-btn-avatar {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  transition: all 0.3s ease;
}

.comm-btn-avatar:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.comm-btn-test-avatar {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  transition: all 0.3s ease;
}

.comm-btn-test-avatar:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  color: white;
}

.avatar-benefits {
  margin-top: 1rem;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 0.85rem;
}

.benefit-item i {
  width: 16px;
  text-align: center;
}

/* Avatar invitation modal styles */
.avatar-invitation-content {
  max-width: 500px;
}

.avatar-info-section {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.avatar-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.avatar-info-section h4 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.avatar-info-section p {
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
}

.recipient-info-section {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.recipient-details h5 {
  margin-bottom: 0.5rem;
  color: #2d3748;
}

.recipient-details p {
  margin: 0.25rem 0;
  color: #4a5568;
  font-size: 0.9rem;
}

.recipient-details i {
  width: 16px;
  margin-right: 0.5rem;
  color: #667eea;
}

.avatar-session-info {
  background: #f0f8ff;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  margin-top: 1rem;
}

.avatar-session-info h5 {
  margin-bottom: 0.75rem;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.avatar-session-info i {
  color: #667eea;
}

.avatar-session-info ul {
  margin: 0;
  padding-left: 1.25rem;
}

.avatar-session-info li {
  margin-bottom: 0.5rem;
  color: #4a5568;
  line-height: 1.4;
}

/* Responsive design for avatar elements */
@media (max-width: 768px) {
  .benefit-grid {
    grid-template-columns: 1fr;
  }

  .avatar-invitation-group {
    padding: 1rem;
  }

  .avatar-info-section {
    padding: 1rem;
  }
}

/* Owner Analysis Section - Single Page Layout */
.owner-analysis-section {
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 8px;
  overflow: hidden;
}

.owner-analysis-section .analysis-header {
  background: #f8f9fa;
  padding: 12px 14px;
  border-bottom: 1px solid #e9ecef;
}

.owner-analysis-section .analysis-header h3 {
  margin: 0 0 8px 0;
  color: #343a40;
  font-size: 1.35rem;
  font-weight: 600;
}

.owner-analysis-section .analysis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.owner-analysis-section .motivation-level,
.owner-analysis-section .motivation-score,
.owner-analysis-section .ethnic-background {
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.owner-analysis-section .motivation-level.high {
  background: #dff1e2;
  color: #155724;
  border: 1px solid #cfe8d4;
}

.owner-analysis-section .motivation-level.medium {
  background: #fff6d6;
  color: #856404;
  border: 1px solid #ffeaaf;
}

.owner-analysis-section .motivation-level.low {
  background: #fae1e3;
  color: #721c24;
  border: 1px solid #f2c7cb;
}

.owner-analysis-section .motivation-score {
  background: #eceeef;
  color: #383d41;
  border: 1px solid #dee1e3;
}

.owner-analysis-section .ethnic-background {
  background: #d9eff4;
  color: #0c5460;
  border: 1px solid #c7e7ee;
}

.owner-analysis-section .analysis-content {
  padding: 10px;
}

.owner-analysis-section .ethnic-background-section,
.owner-analysis-section .communication-strategy-section,
.owner-analysis-section .full-analysis-section {
  margin-bottom: 12px;
  padding: 10px;
  background: #fafbfc;
  border-radius: 6px;
  border-left: 2px solid #007bff;
}

.owner-analysis-section .ethnic-background-section {
  border-left-color: #28a745;
}

.owner-analysis-section .communication-strategy-section {
  border-left-color: #ffc107;
}

.owner-analysis-section .full-analysis-section {
  border-left-color: #6f42c1;
}

.owner-analysis-section h4 {
  margin: 0 0 6px 0;
  color: #495057;
  font-size: 1.05rem;
  font-weight: 600;
}

.owner-analysis-section .strategy-content,
.owner-analysis-section .analysis-content {
  line-height: 1.45;
  color: #495057;
}

.owner-analysis-section .strategy-content p,
.owner-analysis-section .analysis-content p {
  margin-bottom: 6px;
}

.owner-analysis-section .strategy-content h5,
.owner-analysis-section .analysis-content h5 {
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 1em;
}

.owner-analysis-section .strategy-content li,
.owner-analysis-section .analysis-content li {
  margin-bottom: 4px;
  color: #495057;
}

/* Compact overrides for Owner Analysis tab */
#owner-analysis.tab-content {
  padding: 8px 0; /* reduce vertical padding of tab content */
}

/* Section containers */
.owner-analysis-section {
  margin-bottom: 8px; /* was 12px */
}

.owner-analysis-section .analysis-content {
  padding: 10px; /* was 14px */
}

/* Individual blocks inside analysis */
.owner-analysis-section .ethnic-background-section,
.owner-analysis-section .communication-strategy-section,
.owner-analysis-section .full-analysis-section {
  margin-bottom: 12px; /* was 16px */
  padding: 10px; /* was 14px */
  border-left-width: 2px; /* was 3px */
}

/* Reduce padding of green strategy box defined in property.css */
.owner-analysis-section .strategy-content {
  background: #edf7ee; /* keep subtle background */
  padding: 10px !important; /* override property.css 1.5em */
  border-radius: 4px;
  line-height: 1.45; /* was 1.5 */
}

/* Reduce full analysis padding as well */
.owner-analysis-section .full-analysis-section .analysis-content,
.owner-analysis-section .full-analysis-content {
  padding: 10px !important; /* override property.css */
  line-height: 1.45;
}

/* Tighter headings */
.owner-analysis-section h4 {
  margin: 0 0 6px 0; /* was 8px */
  font-size: 1.05rem; /* was 1.1rem */
}

/* Tighter text spacing */
.owner-analysis-section .strategy-content p,
.owner-analysis-section .analysis-content p {
  margin-bottom: 6px; /* was 8px/12px */
}

.owner-analysis-section .strategy-content h5,
.owner-analysis-section .analysis-content h5 {
  margin-top: 10px; /* was 14px */
  margin-bottom: 6px; /* was 8-10px */
  font-size: 1em; /* was 1.02em */
}

/* Lists */
.owner-analysis-section .strategy-content li,
.owner-analysis-section .analysis-content li {
  margin-bottom: 4px; /* was 6-8px */
}

/* Remove extra space before first/after last elements */
.owner-analysis-section .strategy-content > :first-child,
.owner-analysis-section .analysis-content > :first-child { margin-top: 0; }
.owner-analysis-section .strategy-content > :last-child,
.owner-analysis-section .analysis-content > :last-child { margin-bottom: 0; }

/* Additional compacting specific to Owner Analysis tab */
#owner-analysis .section-title {
  margin: 4px 0 8px 0; /* reduce vertical space around the H2 title */
}

#owner-analysis .owner-analysis-section {
  padding: 12px; /* tighter container padding vs default 20px */
}

#owner-analysis .owner-analysis-section .analysis-header {
  padding: 8px 10px; /* smaller header padding */
  margin-bottom: 0; /* remove gap below badges row */
}

#owner-analysis .owner-analysis-section .analysis-content {
  padding: 0 10px 8px 10px; /* remove top padding to eliminate space */
}

/* Eliminate space at the top of the full analysis box */
#owner-analysis .full-analysis-section .analysis-content {
  padding: 0 8px 8px 8px !important; /* remove top padding inside full analysis */
}

#owner-analysis .full-analysis-section .analysis-content > :first-child {
  margin-top: 0; /* remove top margin of first element from Markdown */
}

#owner-analysis .loading-message {
  padding: 16px 10px; /* reduce loading state vertical space */
}

/* Even tighter spacing for sections inside Owner Analysis */
#owner-analysis .owner-analysis-section .ethnic-background-section,
#owner-analysis .owner-analysis-section .communication-strategy-section,
#owner-analysis .owner-analysis-section .full-analysis-section {
  margin-bottom: 8px; /* was 12px */
  padding: 8px;      /* was 10px */
}

/* Compact Markdown output inside strategy and full analysis */
#owner-analysis .strategy-content,
#owner-analysis .full-analysis-section .analysis-content,
#owner-analysis .full-analysis-content {
  line-height: 1.35; /* slightly tighter */
}

#owner-analysis .strategy-content h1,
#owner-analysis .strategy-content h2,
#owner-analysis .strategy-content h3,
#owner-analysis .strategy-content h4,
#owner-analysis .strategy-content h5,
#owner-analysis .strategy-content h6,
#owner-analysis .full-analysis-section .analysis-content h1,
#owner-analysis .full-analysis-section .analysis-content h2,
#owner-analysis .full-analysis-section .analysis-content h3,
#owner-analysis .full-analysis-section .analysis-content h4,
#owner-analysis .full-analysis-section .analysis-content h5,
#owner-analysis .full-analysis-section .analysis-content h6 {
  margin-top: 6px;
  margin-bottom: 6px;
}

#owner-analysis .strategy-content p,
#owner-analysis .full-analysis-section .analysis-content p {
  margin: 4px 0; /* reduce paragraph gaps */
}

#owner-analysis .strategy-content ul,
#owner-analysis .strategy-content ol,
#owner-analysis .full-analysis-section .analysis-content ul,
#owner-analysis .full-analysis-section .analysis-content ol {
  margin: 4px 0 4px 1.1em; /* reduce list outer spacing */
}

#owner-analysis .strategy-content li,
#owner-analysis .full-analysis-section .analysis-content li {
  margin: 2px 0; /* reduce spacing between list items */
}

/* =====================================================
   LEAD SCORING STYLES
   ===================================================== */

/* Lead Score Badges in Header */
.lead-score-badges {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}

.lead-score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  min-width: 24px;
  line-height: 1.2;
}

/* Grade Badges */
.grade-badge.grade-a {
  background-color: #28a745;
  color: white;
}

.grade-badge.grade-b {
  background-color: #17a2b8;
  color: white;
}

.grade-badge.grade-c {
  background-color: #ffc107;
  color: #212529;
}

.grade-badge.grade-d {
  background-color: #fd7e14;
  color: white;
}

.grade-badge.grade-f {
  background-color: #dc3545;
  color: white;
}

.grade-badge.grade-unknown {
  background-color: #6c757d;
  color: white;
}

/* Priority Badges */
.priority-badge.priority-high {
  background-color: #dc3545;
  color: white;
}

.priority-badge.priority-medium {
  background-color: #ffc107;
  color: #212529;
}

.priority-badge.priority-low {
  background-color: #28a745;
  color: white;
}

.priority-badge.priority-disqualify {
  background-color: #6c757d;
  color: white;
}

/* Score Badge */
.score-badge {
  background-color: #007bff;
  color: white;
  font-weight: 700;
}

/* Lead Scoring Section */
.lead-scoring-section {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  margin: 10px 0;
}

.lead-scoring-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.lead-scoring-header h5 {
  margin: 0;
  color: #495057;
  font-size: 1rem;
}

.lead-scoring-header i {
  color: #007bff;
  margin-right: 6px;
}

.toggle-scoring-details {
  font-size: 0.8rem;
  padding: 4px 8px;
}

/* Scoring Summary */
.lead-scoring-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.scoring-metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metric-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress {
  flex: 1;
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  transition: width 0.3s ease;
}

.metric-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  min-width: 35px;
  text-align: right;
}

/* Scoring Details */
.lead-scoring-details {
  border-top: 1px solid #dee2e6;
  padding-top: 15px;
  transition: all 0.3s ease;
}

.lead-scoring-details.collapsed {
  display: none;
}

.score-breakdown h6 {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  color: #495057;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 15px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.85rem;
}

.breakdown-label {
  color: #495057;
  font-weight: 500;
}

.breakdown-score {
  color: #007bff;
  font-weight: 600;
}

.scoring-metadata {
  font-size: 0.85rem;
  color: #6c757d;
}

.scoring-metadata p {
  margin: 4px 0;
}

/* Lead scoring responsive adjustments */
@media (max-width: 768px) {
  .lead-score-badges {
    flex-wrap: wrap;
    margin-left: 0;
    margin-top: 8px;
  }

  .lead-scoring-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .progress-container {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .metric-value {
    text-align: left;
  }
}
