/* Contact Modal Styles */
.contact-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.contact-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Ensure modal respects sticky header */
.contact-modal-overlay {
  padding-top: 70px; /* Account for mobile header height */
}

@media (min-width: 768px) {
  .contact-modal-overlay {
      padding-top: 100px; /* Account for desktop header height */
  }
}

.contact-modal-content {
  background: white;
  border-radius: 12px;
  width: 95%;
  max-width: 700px;
  max-height: calc(100vh - 140px); /* Account for header padding */
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.contact-modal-overlay.show .contact-modal-content {
  transform: translateY(0);
}

.contact-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px 12px 0 0;
}

.contact-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.contact-modal-header h3 .center-name-display {
  color: #97155e;
  font-weight: 500;
}

.contact-modal-close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.contact-modal-close:hover {
  color: #333;
}

.contact-modal-body {
  padding: 16px 20px;
}

.contact-modal-body .form-group {
  margin-bottom: 12px;
}

.contact-modal-body .form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #333;
  font-size: 13px;
}

.contact-modal-body .form-group input,
.contact-modal-body .form-group select,
.contact-modal-body .form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
  line-height: 1.4;
}

/* Responsive form layout for larger screens */
@media (min-width: 768px) {
  .contact-modal-body .form-row {
      display: flex;
      gap: 15px;
      align-items: flex-start;
      justify-content: space-between;
  }
  
  .contact-modal-body .form-row .form-group {
      flex: 1;
      margin-bottom: 12px;
  }
  
  .contact-modal-body .form-row .form-group.half-width {
      flex: 0 0 48%;
  }
}

.contact-modal-body .form-group input:focus,
.contact-modal-body .form-group select:focus,
.contact-modal-body .form-group textarea:focus {
  border-color: #007cba;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.contact-modal-body .form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  margin-bottom: 0;
}

.contact-modal-body .form-group input[type="checkbox"] + label {
  display: inline;
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}

.contact-modal-body .form-group textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 120px;
}

.contact-modal-body .form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.contact-modal-body .btn-cancel,
.contact-modal-body .btn-submit,
.contact-modal-body .btn-close-success,
.contact-modal-body .btn-retry {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.contact-modal-body .btn-cancel {
  background-color: #6c757d;
  color: white;
}

.contact-modal-body .btn-cancel:hover {
  background-color: #545b62;
}

.contact-modal-body .btn-submit {
  background-color: var(--e-global-color-1ee0146, #007cba);
  color: white;
  border: 2px solid var(--e-global-color-1ee0146, #007cba);
  transition: all 0.3s ease;
}

.contact-modal-body .btn-submit:hover {
  background-color: transparent;
  color: var(--e-global-color-1ee0146, #007cba);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.contact-modal-body .btn-submit:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.contact-modal-body .btn-close-success,
.contact-modal-body .btn-retry {
  background-color: #6c757d;
  color: white;
  margin: 0 auto;
  display: block;
}

.contact-modal-body .success-message,
.contact-modal-body .error-message {
  text-align: center;
  padding: 20px;
}

.contact-modal-body .success-message h4 {
  color: #97155e;
  margin-bottom: 10px;
}

.contact-modal-body .error-message h4 {
  color: #dc3545;
  margin-bottom: 10px;
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
  .contact-modal-content {
      width: 95%;
      margin: 10px;
      max-height: calc(100vh - 100px);
  }
  
  .contact-modal-header {
      padding: 12px 16px;
  }
  
  .contact-modal-header h3 {
      font-size: 16px;
  }
  
  .contact-modal-header h3 .center-name-display {
      display: block;
      font-size: 14px;
      margin-top: 2px;
  }
  
  .contact-modal-body {
      padding: 12px 16px;
  }
  
  .contact-modal-body .form-row {
      flex-direction: column;
      justify-content: space-between;
      gap: 0;
  }
  
  .contact-modal-body .form-row .form-group.half-width {
      flex: none;
      width: 100%;
  }
  
  .contact-modal-body .form-actions {
      flex-direction: column;
      gap: 8px;
  }
  
  .contact-modal-body .btn-cancel,
  .contact-modal-body .btn-submit {
      width: 100%;
      padding: 10px;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
  .contact-modal-content {
      max-width: 650px;
  }
}

.wpgmza-panel-info-window.wpgmza-panel-view {
  display: none;
}

/* Prevent body scrolling when modal is open */
body.modal-open {
  overflow: hidden;
  height: 100vh;
}

.field-required {
  color: red;
}

/* Admin page styles */
.ma-leads-admin .search-box input[type="search"] {
  width: 300px;
  margin-right: 10px;
}

.ma-leads-admin .wp-list-table th {
  font-weight: 600;
}

.ma-leads-admin .wp-list-table td {
  vertical-align: top;
}

.ma-leads-admin .displaying-num {
  font-style: italic;
  color: #666;
}

.wpmgza-open-contact-modal {
  border: 2px solid var(--e-global-color-1ee0146) !important;
  background: var(--e-global-color-1ee0146) !important;
  color: #fff !important;
}

.wpmgza-open-contact-modal:hover {
  background: #fff !important;
  color: var(--e-global-color-1ee0146) !important;
}