/* FVL Callback Plugin Styles */

:root {
  --fvl-cb-green: #a4c465;
  --fvl-cb-dark-green: #358865;
  --fvl-cb-yellow: rgb(255, 210, 0);
  --fvl-cb-blue: rgb(0, 68, 140);
  --fvl-cb-gray: rgb(128, 128, 128);
  --fvl-cb-font: "Rubik", sans-serif;
  --fvl-cb-font-size: 14px;
  --fvl-cb-z-index: 999999;
}

/* Floating Menu Container */
.fvl-cb-fab-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: var(--fvl-cb-z-index);
}

/* Menu Items (Hidden by Default) */
.fvl-cb-menu-items {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

/* Show Menu Items */
.fvl-cb-fab-container.active .fvl-cb-menu-items {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fvl-cb-menu-item {
  display: flex;
  align-items: center;
  /* Label to the left */
  justify-content: flex-end;
}

/* Main Toggle Button (Agent) */
.fvl-cb-main-toggle {
  width: 60px;
  height: 60px;
  background-color: var(--fvl-cb-green);
  border-radius: 50%;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s;
}

.fvl-cb-main-toggle:hover {
  transform: scale(1.1);
}

.fvl-cb-fab-container.active .fvl-cb-main-toggle {
  background-color: #666;
  /* Gray when open/close */
  /* Removed rotation to simple X transition if desired, or keep it */
  transform: rotate(90deg);
}

/* Fix Agent SVG Size & Centering (No !important on display to allow JS toggle) */
.fvl-cb-main-toggle svg {
  width: 25px;
  height: 25px;
  fill: white;
  /* Remove display: flex to prevent overriding JS hiding */
}

/* Fix Close Icon */
.fvl-cb-close-icon {
  font-size: 28px;
  color: white;
  line-height: 1;
  /* Remove display: flex to prevent overriding JS hiding */
}

/* Ensure Sub-Button Icons are Centered (Keep !important here for sub-buttons only) */
.fvl-cb-sub-btn span,
.fvl-cb-sub-btn i,
.fvl-cb-btn-round span,
.fvl-cb-btn-round i {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
  line-height: normal !important;
  width: auto !important;
  height: auto !important;
}

/* Sub Buttons (Smaller) */
.fvl-cb-sub-btn {
  width: 45px;
  /* Smaller than main */
  height: 45px;
  border-radius: 50%;
  text-align: center;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s;
}

.fvl-cb-sub-btn:hover {
  transform: scale(1.1);
}

/* Label Tooltip */
.fvl-cb-label-tooltip {
  background: white;
  color: #333;
  padding: 6px 12px;
  border-radius: 4px;
  margin-right: 15px;
  font-size: 13px;
  font-family: var(--fvl-cb-font);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  opacity: 0;
  /* Fade label in too */
  transition: opacity 0.3s;
}

.fvl-cb-fab-container.active .fvl-cb-label-tooltip {
  opacity: 1;
}

/* Modal Overlay */
.fvl-cb-modal-overlay {
  display: none;
  /* Hidden by default */
  position: fixed;
  z-index: var(--fvl-cb-z-index);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  align-items: flex-end;
  /* Align to bottom on mobile */
  justify-content: flex-end;
  /* Align to right on desktop */
}

/* Modal Content */
.fvl-cb-modal-content {
  background-color: #fefefe;
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  animation-name: fvl-slideIn;
  animation-duration: 0.4s;
  font-family: var(--fvl-cb-font);
}

@keyframes fvl-slideIn {
  from {
    bottom: -300px;
    opacity: 0
  }

  to {
    bottom: 90px;
    opacity: 1
  }
}

/* Header */
.fvl-cb-header {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fvl-cb-header h4 {
  margin: 0;
  font-size: 16px;
  color: #444a52;
  font-weight: 400;
  flex-grow: 1;
  padding-left: 10px;
}

.fvl-cb-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
}

.fvl-cb-close:hover,
.fvl-cb-close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Form Elements */
.fvl-cb-body {
  padding: 15px;
}

.fvl-cb-form-group {
  margin-bottom: 10px;
}

.fvl-cb-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-sizing: border-box;
  /* Ensures padding doesn't affect width */
  font-family: var(--fvl-cb-font);
  font-size: 12px;
  height: 32px;
}

.fvl-cb-input.is-invalid {
  border-color: #dc3545;
}

.fvl-cb-invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 80%;
  color: #dc3545;
}

.fvl-cb-input.is-invalid~.fvl-cb-invalid-feedback {
  display: block;
}

/* Utilities */
.fvl-cb-label {
  font-size: 11px;
  margin-bottom: 4px;
  display: block;
}

.fvl-cb-btn {
  width: 100%;
  background-color: var(--fvl-cb-green);
  color: white;
  padding: 8px 10px;
  margin: 8px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--fvl-cb-font);
  font-size: 14px;
}

.fvl-cb-btn:hover {
  background-color: var(--fvl-cb-dark-green);
}

.fvl-cb-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.fvl-cb-text-center {
  text-align: center;
}

.fvl-cb-terms {
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fvl-cb-terms input {
  margin-right: 5px;
}

/* Schedule View */
.fvl-cb-schedule-grid {
  display: flex;
}

.fvl-cb-schedule-days {
  width: 40%;
  border-right: 1px solid #eee;
  padding-right: 5px;
}

.fvl-cb-schedule-hours {
  width: 60%;
  padding-left: 5px;
  max-height: 200px;
  overflow-y: auto;
}

.fvl-cb-hour-item {
  padding: 5px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
}

.fvl-cb-hour-item:hover {
  background-color: #f1f1f1;
}

/* Success View */
.fvl-cb-success-title {
  color: var(--fvl-cb-green);
  font-size: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.fvl-cb-success-details {
  text-align: center;
  font-size: 13px;
  margin-bottom: 20px;
}

/* Flag Input Group */
.fvl-cb-input-group {
  display: flex;
  align-items: center;
}

.fvl-cb-flag-icon {
  padding: 2px 8px;
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-right: none;
  border-radius: 4px 0 0 4px;
  height: 38px;
  display: flex;
  align-items: center;
}

.fvl-cb-input-group input {
  border-radius: 0 4px 4px 0;
}

/* Mobile Responsiveness */
@media screen and (max-width: 600px) {
  .fvl-cb-floating-btn {
    bottom: 10px;
    right: 10px;
  }

  .fvl-cb-modal-content {
    width: 100%;
    bottom: 0;
    right: 0;
    border-radius: 8px 8px 0 0;
    max-height: 90vh;
    animation-name: fvl-slideInMobile;
  }

  @keyframes fvl-slideInMobile {
    from {
      bottom: -100%;
      opacity: 0
    }

    to {
      bottom: 0px;
      opacity: 1
    }
  }
}

/* Spinner */
.fvl-cb-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--fvl-cb-green);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: fvl-spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes fvl-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Form Elements */
.fvl-cb-body {
  padding: 15px;
}

.fvl-cb-form-group {
  margin-bottom: 10px;
}

.fvl-cb-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-sizing: border-box;
  /* Ensures padding doesn't affect width */
  font-family: var(--fvl-cb-font);
  font-size: var(--fvl-cb-font-size);
  height: auto;
  min-height: 38px;
}

.fvl-cb-input.is-invalid {
  border-color: #dc3545;
}

.fvl-cb-invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 80%;
  color: #dc3545;
}

.fvl-cb-input.is-invalid~.fvl-cb-invalid-feedback {
  display: block;
}

/* Utilities */
.fvl-cb-label {
  font-size: 11px;
  margin-bottom: 4px;
  display: block;
}

.fvl-cb-btn {
  width: 100%;
  background-color: var(--fvl-cb-green);
  color: white;
  padding: 8px 10px;
  margin: 8px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--fvl-cb-font);
  font-size: var(--fvl-cb-font-size);
}

.fvl-cb-btn:hover {
  background-color: var(--fvl-cb-dark-green);
}

.fvl-cb-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.fvl-cb-text-center {
  text-align: center;
}

.fvl-cb-terms {
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fvl-cb-terms input {
  margin-right: 5px;
}

/* Schedule View */
.fvl-cb-schedule-grid {
  display: flex;
}

.fvl-cb-schedule-days {
  width: 40%;
  border-right: 1px solid #eee;
  padding-right: 5px;
}

.fvl-cb-schedule-hours {
  width: 60%;
  padding-left: 5px;
  max-height: 200px;
  overflow-y: auto;
}

.fvl-cb-hour-item {
  padding: 5px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
}

.fvl-cb-hour-item:hover {
  background-color: #f1f1f1;
}

/* Success View */
.fvl-cb-success-title {
  color: var(--fvl-cb-green);
  font-size: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.fvl-cb-success-details {
  text-align: center;
  font-size: 13px;
  margin-bottom: 20px;
}

/* Mobile Responsiveness */
@media screen and (max-width: 600px) {
  .fvl-cb-floating-btn {
    bottom: 10px;
    right: 10px;
  }

  .fvl-cb-modal-content {
    width: 100%;
    bottom: 0;
    right: 0;
    border-radius: 8px 8px 0 0;
    max-height: 90vh;
    animation-name: fvl-slideInMobile;
  }

  @keyframes fvl-slideInMobile {
    from {
      bottom: -100%;
      opacity: 0
    }

    to {
      bottom: 0px;
      opacity: 1
    }
  }
}

/* Spinner */
.fvl-cb-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--fvl-cb-green);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: fvl-spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes fvl-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Static positioning for Shortcode */
.fvl-cb-static {
  position: static !important;
  width: 100% !important;
  max-width: 400px !important;
  margin: 0 auto !important;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1) !important;
  bottom: auto !important;
  right: auto !important;
  animation: none !important;
  display: block !important;
  /* Ensure it is visible */
}

/* Ensure inner modal content behaves well in static mode */
#fvl-cb-app .fvl-cb-static {
  /* Override any app specific styles if needed */
}