/* Floating Contact Button with Form
----------------------------------------*/
.floating-contact-container {
  position: fixed !important;
  bottom: 20px !important;
  left: 30px !important; /* Position on left */
  right: auto !important;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align to left */
  font-family: 'Poppins', sans-serif;
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.floating-contact-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #0D47A1, #03A9F4);
  box-shadow: 0 6px 24px rgba(3, 169, 244, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.floating-contact-button:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 32px rgba(3, 169, 244, 0.6);
}

.floating-contact-button i {
  color: white;
  font-size: 26px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.floating-contact-button:hover i {
  transform: rotate(-15deg);
}

.floating-contact-button:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  transform: scale(0);
  transition: all 0.5s ease;
}

.floating-contact-button:hover:before {
  transform: scale(1.5);
  opacity: 0;
}

/* Glint animation */
.floating-contact-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.floating-contact-button:hover::after {
  opacity: 1;
  animation: glint 1.5s ease-in-out;
}

@keyframes glint {
  0% {
    transform: rotate(45deg) translateX(-100%);
  }
  100% {
    transform: rotate(45deg) translateX(100%);
  }
}

.floating-contact-form {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 25px;
  width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: absolute;
  bottom: 20px; /* Position on top of the button */
  left: 70px !important; /* Position to the right of the button */
  right: auto !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  z-index: 10000;
}

/* Show form on button hover or when has form-visible class */
.floating-contact-container:hover .floating-contact-form,
.floating-contact-form.form-visible {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* Mobile floating buttons */
.mobile-floating-buttons {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  position: fixed;
  bottom: 100px;
  left: 30px;
  z-index: 9998;
}

.mobile-floating-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

.mobile-floating-button a {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-size: 24px;
}

.whatsapp-button {
  background-color: #25d366;
}

.why-us-button {
  background-color: #4a6bdc;
  position: relative;
  z-index: 9998;
}

/* Show mobile buttons only on mobile */
@media (max-width: 991px) {
  .mobile-floating-buttons {
    display: flex !important;
  }
}

/* Override any conflicting styles */
.floating-contact-form.fade-in {
  display: block !important;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.floating-form-header {
  margin-bottom: 20px;
  text-align: center;
  position: relative;
}

.floating-form-header:after {
  content: '';
  position: absolute;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #03A9F4, #0D47A1);
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 3px;
}

.floating-form-header h3 {
  color: #333;
  font-size: 22px;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.floating-form-header p {
  color: #666;
  font-size: 14px;
  margin: 0;
  font-weight: 400;
}

.floating-form-group {
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.floating-form-group label {
  display: block;
  color: #555;
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  transform-origin: left;
}

.floating-form-group input:focus + label,
.floating-form-group textarea:focus + label {
  color: #03A9F4;
  transform: scale(1.05);
}

.floating-form-group input,
.floating-form-group textarea {
  width: 100%;
  padding: 12px 15px;
  background-color: #f7f9fc;
  border: 1px solid #e1e5ee;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.floating-form-group input:focus,
.floating-form-group textarea:focus {
  border-color: #03A9F4;
  box-shadow: 0 0 0 3px rgba(3, 169, 244, 0.1);
  outline: none;
  background-color: #fff;
}

.floating-form-group textarea {
  height: 100px;
  resize: none;
}

.floating-form-button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #03A9F4, #0D47A1);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(3, 169, 244, 0.2);
}

.floating-form-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.4s ease;
}

.floating-form-button:hover:before {
  left: 100%;
}

.floating-form-button:hover {
  background: linear-gradient(135deg, #0288D1, #083A8F);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(3, 169, 244, 0.3);
}

.floating-form-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: #888;
  position: relative;
}

.floating-form-footer:before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

/* Pulse Animation for Button */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(3, 169, 244, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(3, 169, 244, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(3, 169, 244, 0);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Rotate Phone Icon Animation */
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(15deg); }
  50% { transform: rotate(-13deg); }
  75% { transform: rotate(8deg); }
}

.floating-contact-button:hover i {
  animation: wiggle 0.6s ease-in-out;
}

/* Form Fields Animation */
.floating-form-group input,
.floating-form-group textarea {
  transform: translateX(-10px);
  opacity: 0;
  animation: slideIn 0.5s forwards;
}

@keyframes slideIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.floating-form-group:nth-child(1) input { animation-delay: 0.1s; }
.floating-form-group:nth-child(2) input { animation-delay: 0.2s; }
.floating-form-group:nth-child(3) textarea { animation-delay: 0.3s; }

/* Optional: Fade-in for form initial load */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .floating-contact-container {
    bottom: 20px;
    right: 20px;
  }
  
  .floating-contact-form {
    width: 290px;
    right: 0;
    bottom: 70px;
  }
  
  .floating-form-header h3 {
    font-size: 20px;
  }
  
  .floating-form-button {
    padding: 12px;
  }
}

/* Floating Contact Form Container */
.floating-contact-container {
    position: fixed;
    bottom: 30px;
    left: 30px; /* Changed from right to left */
    z-index: 999;
}

/* Floating Contact Form */
.floating-contact-form {
    position: absolute;
    bottom: 80px;
    left: 0; /* Changed from right: 0 */
    width: 320px;
    transform-origin: bottom left; /* Changed from bottom right */
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .floating-contact-form {
        left: 0;
        right: auto;
        width: calc(100vw - 40px);
        margin-left: 10px;
    }
}

.floating-contact-button {
    width: 60px;
    height: 60px;
    background-color: var(--mainColor);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.floating-contact-button i {
    color: white;
    font-size: 24px;
}

.floating-contact-form {
    position: absolute;
    bottom: 80px;
    right: 0; /* Changed from left: 0 to right: 0 */
    width: 320px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: none;
    transform-origin: bottom right; /* Changed from bottom left */
}

/* Mobile Why Us Popup - Redesigned for better mobile interaction */
.mobile-why-us-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  width: 90%;
  max-width: 350px;
  max-height: 90vh; /* Limit height to 90% of viewport height */
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  padding: 25px 20px;
  z-index: 10002;
  display: none;
  border: 1px solid rgba(74, 107, 220, 0.1);
  overflow-y: auto; /* Add scrolling if content is too tall */
}

.mobile-why-us-popup.active {
  display: block;
  animation: popupFadeIn 0.3s ease-out forwards;
}

.mobile-why-us-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6); /* Slightly darker overlay for better contrast */
  z-index: 10001;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-why-us-overlay.active {
  display: block;
  opacity: 1;
}

.popup-header {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #4a6bdc;
  text-align: center;
  position: relative;
}

.popup-header:after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3px;
  background: #4a6bdc;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 3px;
}

.popup-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  padding-bottom: 10px; /* Add padding at the bottom */
}

.popup-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin-bottom: 5px; /* Add margin between items */
}

.popup-item:last-child {
  margin-bottom: 0; /* Remove margin from last item */
}

.popup-item i {
  margin-right: 0;
  font-size: 22px;
  color: #4a6bdc;
  flex-shrink: 0;
}

.popup-item span {
  font-size: 15px;
  line-height: 1.4;
  color: #555;
  flex: 1;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Only show Why Us button on mobile */
@media (min-width: 992px) {
  .why-us-button {
    display: none !important;
  }
}

/* Hide the inline popup that might be inside the button */
.mobile-floating-button .mobile-why-us-popup {
  display: none !important;
}

/* For mobile devices only - adjust floating contact button position */
@media (max-width: 991px) {
  .floating-contact-container {
    position: fixed !important;
    bottom: 20px !important;
    left: auto !important; /* Reset left positioning */
    right: 20px !important; /* Position on right side */
    transform: none !important; /* Remove transform that was centering */
  }
  
  /* Adjust form positioning to appear from the right side */
  .floating-contact-form {
    bottom: 80px !important;
    left: auto !important;
    right: 0 !important;
    transform: none !important;
  }
}

/* Further adjustments for smaller mobile screens */
@media (max-width: 480px) {
  .floating-contact-container {
    bottom: 20px;
    right: 20px !important;
    left: auto !important;
    transform: none !important;
  }
  
  .floating-contact-form {
    width: 90% !important;
    max-width: 320px !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    margin-right: 10px;
    bottom: 80px !important;
    position: fixed !important;
  }
  
  /* Ensure the popup takes sufficient screen width */
  .mobile-why-us-popup {
    padding: 25px 20px;
  }
}