/*
 * Plugin Name: Cyntex Remote Support
 * Description: Styles for the Remote Support button and form.
 */

.cyntex-remote-support-container {
  position: relative; /* Changed to relative to contain the absolutely positioned form */
  display: inline-block; /* Allows it to sit next to other inline elements like "Call Us" */
  vertical-align: middle; /* Aligns with other inline elements */
}

.cyntex-button {
  background-color: #7bc143; /* Primary brand colour */
  color: #ffffff; /* White text for contrast */
  cursor: pointer;
  
  
  transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth transition for hover */
  
  text-decoration: none; /* Ensure no underline if used as a link */
  display: inline-block; /* For consistent padding and sizing */
  text-align: center;
	
	
	
	    font-weight: 700;
    color: #ffffff !important;
    line-height: 1.5em !important;
    
    border: 1px solid #7bc143;
    border-radius: 900px;
    overflow: hidden;
    padding: 11px 49px !important;
}

.cyntex-button:hover,
.cyntex-button:focus {
  background-color: #006738; /* Secondary brand colour on hover */
 border-color: #006738;
  outline: none; /* Remove outline on focus for better aesthetics */
}

/* Form wrapper styling for absolute positioning and transitions */
.cyntex-form-hidden,
.cyntex-form-visible {
  position: absolute; /* Absolute positioning relative to .cyntex-remote-support-container */
  right: 0; /* Align the right edge of the form with the right edge of the button container */
  top: calc(100% + 15px); /* Position 15px below the button */
  width: 280px; /* Fixed width for the form */
  max-width: calc(
    100vw - 40px
  ); /* Ensure it doesn't go off-screen on small viewports */
  transform-origin: top right; /* For smooth scaling animations when opening downwards */
}

.cyntex-form-hidden {
  display: none; /* Initially hidden */
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.4s ease-out, max-height 0.4s ease-out,
    transform 0.4s ease-out;
  transform: scale(0.9); /* Slightly scaled down when hidden */
}

.cyntex-form-visible {
  display: block; /* Make visible */
  opacity: 1;
  max-height: 200px; /* Adjust based on form content height */
  transition: opacity 0.4s ease-in, max-height 0.4s ease-in,
    transform 0.4s ease-in;
  transform: scale(1); /* Full scale when visible */
}

.cyntex-form {
  background-color: #f9f9f9;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px; /* Space between form elements */
  align-items: flex-start; /* Align elements to the start */
  width: 100%; /* Ensure form takes full width of its wrapper */
  box-sizing: border-box; /* Include padding in width */
}

.cyntex-form label {
  font-weight: bold;
  color: #333;
  font-size: 15px;
}

.cyntex-form input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box; /* Include padding in width */
}

.cyntex-form input[type="text"]:focus {
  border-color: #006738;
  box-shadow: 0 0 0 2px rgba(0, 103, 56, 0.2);
  outline: none;
}

.cyntex-form .cyntex-button {
  align-self: flex-end; /* Align submit button to the right */
  padding: 8px 15px; /* Slightly smaller button for form */
  font-size: 14px;
}

.cyntex-error-message {
  color: #d9534f; /* Red for error messages */
  font-size: 14px;
  margin-top: 5px;
  font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cyntex-remote-support-container {
    top: auto;
    bottom: auto;
    right: auto;
  }

  .cyntex-button {
    padding: 8px 15px;
    font-size: 14px;
  }

  .cyntex-form-hidden,
  .cyntex-form-visible {
    width: calc(100vw - 20px); /* Adjust width for smaller screens */
    right: 0; /* Keep it aligned to the right within its container */
    top: calc(100% + 10px); /* Form opens downwards from button on mobile too */
    bottom: auto; /* Remove bottom positioning for the form */
    transform-origin: top right; /* Form opens downwards on mobile too */
  }

  .cyntex-form {
    padding: 15px;
  }

  .cyntex-form input[type="text"] {
    font-size: 14px;
  }
}
