/**
 * WhatsApp Widget Styles for BouwenWebsites.nl
 * Modern chat-style interface with website branding
 */

:root {
  --wbio-wa-blue: #FF8E53;
  --wbio-wa-blue-dark: #e67e45;
  --wbio-wa-white: #ffffff;
  --wbio-wa-text: #292940;
  --wbio-wa-text-light: #666666;
  --wbio-wa-bg-light: #f0f2f5;
  --wbio-wa-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
  --wbio-wa-radius: 28px;
  --wbio-wa-green: #4cd964;
}

.wbio-whatsapp-container {
  position: fixed ;
  bottom: 20px ;
  right: 20px ;
  z-index: 2000000 ; /* Higher than preloader (999999) */
  display: flex ;
  flex-direction: column ;
  align-items: flex-end ;
  pointer-events: auto ;
  visibility: visible ;
  opacity: 1 ;
}

/* Trigger Button */
.wbio-whatsapp-trigger {
  width: 65px ;
  height: 65px ;
  background: var(--wbio-wa-blue) ;
  border: 3px solid var(--wbio-wa-white) ;
  border-radius: 50% ;
  box-shadow: 0 8px 25px rgba(255, 142, 83, 0.35) ;
  cursor: pointer ;
  padding: 0 ;
  display: flex ;
  align-items: center ;
  justify-content: center ;
  position: relative ;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) ;
  outline: none ;
}

.wbio-whatsapp-trigger i {
  color: var(--wbio-wa-white) ;
  font-size: 30px ;
  line-height: 1 ;
  transition: transform 0.3s ease, opacity 0.2s ease ;
}

.wbio-whatsapp-trigger:hover {
  transform: scale(1.1) rotate(5deg) ;
  box-shadow: 0 12px 30px rgba(255, 142, 83, 0.45) ;
}

/* Status Indicator */
.wbio-status-indicator {
  position: absolute ;
  bottom: 2px ;
  right: 2px ;
  width: 15px ;
  height: 15px ;
  background: var(--wbio-wa-green) ;
  border: 3px solid var(--wbio-wa-white) ;
  border-radius: 50% ;
  z-index: 100002 ;
}

/* Notification Badge */
.wbio-whatsapp-badge {
  position: absolute ;
  top: -5px ;
  right: -5px ;
  background: #ff3b30 ; /* Red notification color */
  color: #ffffff ;
  width: 22px ;
  height: 22px ;
  border-radius: 50% ;
  display: flex ;
  align-items: center ;
  justify-content: center ;
  font-size: 12px ;
  font-weight: 700 ;
  border: 2px solid #ffffff ;
  box-shadow: 0 2px 10px rgba(255, 59, 48, 0.4) ;
  z-index: 100002 ;
  animation: wbio-pulse-badge 2s infinite ;
}

@keyframes wbio-pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Hide badge when widget is active */
.wbio-whatsapp-container:has(.wbio-whatsapp-widget.active) .wbio-whatsapp-badge {
  display: none ;
}

/* Widget Card */
.wbio-whatsapp-widget {
  position: absolute ;
  bottom: 85px ;
  right: 0 ;
  width: 360px ;
  max-width: 90vw ;
  opacity: 0 ;
  visibility: hidden ;
  transform: scale(0.5) translateY(40px) ;
  transform-origin: bottom right ;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) ;
  z-index: 100003 ;
}

.wbio-whatsapp-widget.active {
  opacity: 1 ;
  visibility: visible ;
  transform: scale(1) translateY(0) ;
}

.wbio-whatsapp-card {
  background: var(--wbio-wa-white) ;
  border-radius: var(--wbio-wa-radius) ;
  box-shadow: var(--wbio-wa-shadow) ;
  padding: 30px ;
  position: relative ;
  overflow: hidden ;
  border: 1px solid rgba(0, 0, 0, 0.03) ;
  min-height: 450px ; /* Force space for form */
  display: flex ;
  flex-direction: column ;
}

/* Header */
.wbio-whatsapp-header {
  display: flex ;
  align-items: center ;
  gap: 15px ;
  margin-bottom: 25px ;
}

/* Staggered animations for menu items */
.wbio-whatsapp-widget .wbio-whatsapp-header,
.wbio-whatsapp-widget .wbio-whatsapp-body,
.wbio-whatsapp-widget .wbio-whatsapp-actions .wbio-whatsapp-btn {
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s ease;
}

.wbio-whatsapp-widget.active .wbio-whatsapp-header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.wbio-whatsapp-widget.active .wbio-whatsapp-body {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.wbio-whatsapp-widget.active .wbio-whatsapp-actions .wbio-whatsapp-btn:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.wbio-whatsapp-widget.active .wbio-whatsapp-actions .wbio-whatsapp-btn:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

.wbio-whatsapp-widget.active .wbio-whatsapp-actions .wbio-whatsapp-btn:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

.wbio-whatsapp-widget.active .wbio-whatsapp-actions .wbio-whatsapp-btn:nth-child(4) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.6s;
}

.wbio-whatsapp-avatar-main {
  position: relative ;
  width: 55px ;
  height: 55px ;
}

.wbio-whatsapp-avatar-main img {
  width: 100% ;
  height: 100% ;
  border-radius: 50% ;
  object-fit: cover ;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) ;
}

.wbio-whatsapp-user-info {
  display: flex ;
  flex-direction: column ;
}

.wbio-whatsapp-name {
  font-size: 16px ;
  color: var(--wbio-wa-text) ;
}

.wbio-whatsapp-org {
  font-size: 13px ;
  color: var(--wbio-wa-text-light) ;
}

/* Message Body */
.wbio-whatsapp-body {
  margin-bottom: 25px ;
}

.wbio-whatsapp-message {
  background: var(--wbio-wa-bg-light) ;
  padding: 15px 20px ;
  border-radius: 5px 25px 25px 25px ;
  color: var(--wbio-wa-text) ;
  font-size: 15px ;
  line-height: 1.6 ;
}

.wbio-whatsapp-message p {
  margin: 0;
}

/* Action Buttons */
.wbio-whatsapp-actions {
  display: flex ;
  flex-direction: column ;
  gap: 12px ;
}

.wbio-whatsapp-btn {
  display: flex ;
  align-items: center ;
  justify-content: space-between ;
  padding: 14px 24px ;
  border-radius: 50px ;
  text-decoration: none ;
  font-weight: 600 ;
  font-size: 14px ;
  transition: all 0.3s ease ;
  border: 2px solid var(--wbio-wa-blue) ;
  color: var(--wbio-wa-blue) ;
}

.wbio-whatsapp-btn i {
  font-size: 18px ;
}

.wbio-whatsapp-btn:hover {
  background: #fdf5f0 ;
  transform: translateY(-2px) ;
  box-shadow: 0 5px 15px rgba(255, 142, 83, 0.15) ;
  color: var(--wbio-wa-blue) ;
}

/* Button reset for PC only button */
button.wbio-whatsapp-btn {
  width: 100% ;
  background: var(--wbio-wa-white) ;
  cursor: pointer ;
  font-family: inherit ;
  outline: none ;
  margin: 0 ;
}

.wbio-btn-featured {
  background: var(--wbio-wa-blue) ;
  color: var(--wbio-wa-white) ;
  border-color: var(--wbio-wa-blue) ;
}

.wbio-btn-featured:hover {
  background: var(--wbio-wa-blue-dark) ;
  border-color: var(--wbio-wa-blue-dark) ;
  box-shadow: 0 8px 20px rgba(255, 142, 83, 0.3) ;
}

/* Mobile/PC toggle classes */
.wbio-mobile-only {
  display: none ;
}

.wbio-pc-only {
  display: flex ;
}

@media (max-width: 991px) {
  .wbio-mobile-only {
    display: flex ;
  }
  .wbio-pc-only {
    display: none ;
  }
}

/* Transition menu items when form is active */
.wbio-whatsapp-card.wbio-wa-show-form .wbio-whatsapp-header,
.wbio-whatsapp-card.wbio-wa-show-form .wbio-whatsapp-body,
.wbio-whatsapp-card.wbio-wa-show-form .wbio-whatsapp-actions {
  opacity: 0 ;
  visibility: hidden ;
  transform: translateY(-20px) ;
  pointer-events: none ;
}

.wbio-whatsapp-card.wbio-wa-show-form {
  min-height: 480px ; /* Fixed height when form is active for better mobile experience */
}

/* Phone Box Inside Widget */
.wbio-wa-phone-container {
  position: absolute ;
  top: 0 ;
  left: 0 ;
  width: 100% ;
  height: 100% ;
  background: var(--wbio-wa-white) ;
  z-index: 100010 ;
  padding: 50px 30px 30px 30px ;
  display: flex ;
  flex-direction: column ;
  opacity: 0 ;
  visibility: hidden ;
  transform: translateY(20px) ;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) ;
  pointer-events: none ;
  border-radius: var(--wbio-wa-radius) ;
}

.wbio-whatsapp-card.wbio-wa-show-phone .wbio-wa-phone-container {
  opacity: 1 ;
  visibility: visible ;
  transform: translateY(0) ;
  pointer-events: auto ;
}

/* Hide menu items when phone box is active */
.wbio-whatsapp-card.wbio-wa-show-phone .wbio-whatsapp-header,
.wbio-whatsapp-card.wbio-wa-show-phone .wbio-whatsapp-body,
.wbio-whatsapp-card.wbio-wa-show-phone .wbio-whatsapp-actions {
  opacity: 0 ;
  visibility: hidden ;
  transform: translateY(-20px) ;
  pointer-events: none ;
}

.wbio-wa-phone-content {
  flex: 1 ;
  display: flex ;
  align-items: center ;
  justify-content: center ;
}

.wbio-wa-phone-link {
  display: flex ;
  flex-direction: column ;
  align-items: center ;
  gap: 20px ;
  text-decoration: none ;
  color: var(--wbio-wa-text) ;
  transition: transform 0.3s ease ;
}

.wbio-wa-phone-link:hover {
  transform: scale(1.05) ;
}

.wbio-wa-phone-icon-circle {
  width: 80px ;
  height: 80px ;
  background: var(--wbio-wa-blue) ;
  color: #fff ;
  border-radius: 50% ;
  display: flex ;
  align-items: center ;
  justify-content: center ;
  font-size: 35px ;
  box-shadow: 0 10px 25px rgba(255, 142, 83, 0.3) ;
  animation: wbio-phone-ring 2s infinite ;
}

.wbio-wa-phone-number {
  font-size: 24px ;
  font-weight: 700 ;
  color: var(--wbio-wa-text) ;
}

@keyframes wbio-phone-ring {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 142, 83, 0.4); }
  10% { transform: scale(1.1) rotate(-10deg); }
  20% { transform: scale(1.1) rotate(10deg); }
  30% { transform: scale(1.1) rotate(-10deg); }
  40% { transform: scale(1.1) rotate(10deg); }
  50% { transform: scale(1); box-shadow: 0 0 0 20px rgba(255, 142, 83, 0); }
  100% { transform: scale(1); }
}

/* Dark mode phone box */
body.dark .wbio-wa-phone-container {
  background: #1d1d1f ;
}

body.dark .wbio-wa-phone-number {
  color: #ffffff ;
}

/* Contact Form Inside Widget - Absolute over entire card */
.wbio-wa-form-container {
  position: absolute ;
  top: 0 ;
  left: 0 ;
  width: 100% ;
  height: 100% ;
  background: var(--wbio-wa-white) ;
  z-index: 100010 ;
  padding: 50px 30px 30px 30px ; /* Increased top padding to push form down */
  display: flex ;
  flex-direction: column ;
  opacity: 0 ;
  visibility: hidden ;
  transform: translateY(20px) ;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) ;
  pointer-events: none ;
  border-radius: var(--wbio-wa-radius) ;
}

.wbio-whatsapp-card.wbio-wa-show-form .wbio-wa-form-container {
  opacity: 1 ;
  visibility: visible ;
  transform: translateY(0) ;
  pointer-events: auto ;
}

.wbio-wa-form-container.active {
  /* Class still used by JS, logic handled by wbio-wa-show-form on parent */
}

.wbio-wa-form-back {
  background: none ;
  border: none ;
  color: var(--wbio-wa-blue) ;
  font-weight: 600 ;
  font-size: 14px ;
  padding: 0 ;
  margin-bottom: 20px ;
  cursor: pointer ;
  display: flex ;
  align-items: center ;
  gap: 5px ;
  text-align: left ;
}

.wbio-wa-field {
  margin-bottom: 15px ;
  display: flex ;
  flex-direction: column ;
  gap: 5px ;
}

/* Animations for form fields when active */
.wbio-wa-form-container.active .wbio-wa-field {
  animation: wbio-slide-up 0.4s ease forwards;
  opacity: 0;
}

.wbio-wa-form-container.active .wbio-wa-field:nth-child(2) { animation-delay: 0.1s; }
.wbio-wa-form-container.active .wbio-wa-field:nth-child(3) { animation-delay: 0.2s; }
.wbio-wa-form-container.active .wbio-wa-field:nth-child(4) { animation-delay: 0.3s; }

@keyframes wbio-slide-up {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.wbio-wa-field label {
  font-size: 13px ;
  font-weight: 600 ;
  color: var(--wbio-wa-text) ;
  text-align: left ;
}

.wbio-wa-field input,
.wbio-wa-field textarea {
  width: 100% ;
  padding: 12px 15px ;
  border: 1.5px solid #e2e4e7 ;
  border-radius: 12px ;
  font-size: 14px ;
  outline: none ;
  transition: border-color 0.2s ease ;
  background: #fcfcfc ;
}

.wbio-wa-field input:focus,
.wbio-wa-field textarea:focus {
  border-color: var(--wbio-wa-blue) ;
}

.wbio-wa-submit {
  width: 100% ;
  background: var(--wbio-wa-blue) ;
  color: #fff ;
  border: none ;
  padding: 14px ;
  border-radius: 50px ;
  font-weight: 600 ;
  font-size: 14px ;
  cursor: pointer ;
  margin-top: 10px ;
  transition: all 0.3s ease ;
}

.wbio-wa-submit:hover {
  background: var(--wbio-wa-blue-dark) ;
  transform: translateY(-2px) ;
}

#wbio-wa-form-status {
  font-size: 13px ;
  margin-top: 10px ;
  text-align: center ;
}

/* Dark Mode Form */
body.dark .wbio-wa-form-container {
  background: #1d1d1f ;
}

body.dark .wbio-wa-field label {
  color: #ffffff ;
}

body.dark .wbio-wa-field input,
body.dark .wbio-wa-field textarea {
  background: #2c2c2e ;
  border-color: #3a3a3c ;
  color: #ffffff ;
}

/* Dark Mode Support */
body.dark .wbio-whatsapp-card,
body.dark-mode .wbio-whatsapp-card,
[data-theme="dark"] .wbio-whatsapp-card {
  background: #1d1d1f ;
  border-color: rgba(255, 255, 255, 0.1) ;
}

body.dark .wbio-whatsapp-name,
body.dark-mode .wbio-whatsapp-name,
[data-theme="dark"] .wbio-whatsapp-name {
  color: var(--wbio-wa-white) ;
}

body.dark .wbio-whatsapp-message,
body.dark-mode .wbio-whatsapp-message,
[data-theme="dark"] .wbio-whatsapp-message {
  background: #2c2c2e ;
  color: var(--wbio-wa-white) ;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .wbio-whatsapp-widget {
    width: calc(100vw - 40px);
    bottom: 80px;
  }
  
  .wbio-whatsapp-card {
    padding: 25px;
    min-height: auto ;
  }
}







