/* Enhanced Contact Form Styles */

/* Phone input mask styling */
.form-control.phone-masked {
  font-family: monospace;
}

/* File upload styling */
.form-control[type="file"] {
  padding: 0.5rem;
  border: 2px dashed #dee2e6;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.form-control[type="file"]:hover {
  border-color: #007bff;
  background-color: #e3f2fd;
}

.form-control[type="file"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* File preview */
.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-preview-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.875rem;
}

.file-preview-item .file-name {
  margin-right: 8px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-item .file-size {
  color: #6c757d;
  margin-right: 8px;
}

.file-preview-item .remove-file {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
}

.file-preview-item .remove-file:hover {
  color: #c82333;
}

/* Captcha styling */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.captcha-input {
  max-width: 100px;
  margin: 0;
}

#captcha-question {
  font-weight: bold;
  color: #495057;
  min-width: 80px;
}

#refresh-captcha {
  padding: 4px 8px;
  font-size: 0.875rem;
}

/* Auto-save indicator */
.auto-save-indicator {
  display: none;
  align-items: center;
  gap: 5px;
  color: #28a745;
  font-size: 0.875rem;
  margin-top: 10px;
}

.auto-save-indicator.show {
  display: flex;
}

.auto-save-indicator i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Field validation styling */
.field-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 5px;
  display: none;
}

.field-error.show {
  display: block;
}

.form-control.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Service type select styling */
.form-control option {
  padding: 8px;
}

/* Enhanced form security info */
.form-security-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background-color: #e8f5e8;
  border: 1px solid #c3e6c3;
  border-radius: 4px;
  color: #155724;
  font-size: 0.875rem;
  margin-top: 15px;
}

.form-security-info i {
  color: #28a745;
  font-size: 1.1rem;
}

/* Loading state improvements */
.loading {
  display: none;
  text-align: center;
  padding: 10px;
  color: #007bff;
}

.loading.show {
  display: block;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Success/Error message improvements */
.sent-message, .error-message {
  padding: 12px;
  border-radius: 4px;
  margin: 10px 0;
  display: none;
  text-align: center; /* Center the content */
}

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

.sent-message i.bi-check-circle-fill {
  font-size: 1.5em; /* Increase icon size */
  vertical-align: middle; /* Align with text */
  margin-right: 5px; /* Space between icon and text */
}

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

.sent-message.show, .error-message.show {
  display: block;
}

/* Submit button improvements */
button[type="submit"] {
  position: relative;
  transition: all 0.3s ease;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button[type="submit"].loading::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .captcha-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .captcha-input {
    max-width: 100%;
  }
  
  .file-preview-item .file-name {
    max-width: 120px;
  }
}
