/* Form Container Styles */
#triggervox_popup_form,
#triggervox_widget_form {
  max-width: 500px;
  padding: 20px 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  transition: all 0.3s ease;
  box-sizing: border-box;
  overflow: hidden; /* Prevent content from overflowing */
  background-color: #ffffff;
}

#triggervox_popup_form {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: none;
  width: 420px;
  animation: fadeInScale 0.4s ease-out;
}

#triggervox_widget_form {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: none;
  width: 340px;
  animation: slideInRight 0.4s ease-out;
}

/* Modal Overlay */
#triggervox_modal_overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-out;
}

/* Form Elements */
#triggervox_form {
  width: 100%;
  box-sizing: border-box;
  display: block;
  padding: 0;
  margin: 0;
}

.triggervox_form_row {
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.triggervox_form_row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ecf2248-text-color);
  transition: color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.triggervox_form_row input[type="text"],
.triggervox_form_row input[type="email"],
.triggervox_form_row textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s ease;
  background-color: #ffffff;
  box-sizing: border-box;
  display: block;
  margin: 0;
}

.triggervox_form_row input[type="text"]:focus,
.triggervox_form_row input[type="email"]:focus,
.triggervox_form_row textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background-color: #fff;
}

.triggervox_form_row textarea {
  resize: vertical;
  min-height: 80px;
}

/* Form Headers */
#triggervox_popup_form h2,
#triggervox_widget_form h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
  text-align: center;
}

#triggervox_popup_form p,
#triggervox_widget_form p {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 15px;
  color: #4b5563;
  line-height: 1.5;
  text-align: center;
}

/* Disclaimer */
.triggervox_disclaimer {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.triggervox_disclaimer input[type="checkbox"] {
  margin-top: 3px;
}

.triggervox_disclaimer label {
  font-size: 11px;
  line-height: 1.1;
  cursor: pointer;
  color: #666; /* Light gray color for disclaimer text */
}

/* Close Buttons */
#triggervox_close_popup,
#triggervox_close_widget {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ecf2248-button-color, #4f46e5);
  border: none;
  font-size: 20px;
  line-height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: white;
  padding: 0;
  margin: 0;
  text-align: center;
}

#triggervox_close_popup:hover,
#triggervox_close_widget:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

/* Submit Button */
#triggervox_submit {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0;
}

#triggervox_submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#triggervox_submit:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#triggervox_message_display {
  margin-top: 16px;
  text-align: center;
  font-weight: 500;
  display: none;
}

/* Loading spinner for submit button */
#triggervox_submit.loading {
  padding-right: 40px;
}

#triggervox_submit.loading::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Reopen Buttons */
#triggervox_reopen_button,
#triggervox_reopen_widget {
  position: fixed;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #4f46e5;
  color: white;
  font-size: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transition: all 0.3s;
  z-index: 9997;
  animation: pulse 2s infinite;
}

#triggervox_reopen_button {
  bottom: 30px;
  right: 30px;
}

#triggervox_reopen_widget {
  bottom: 30px;
  right: 30px;
}

#triggervox_reopen_button:hover,
#triggervox_reopen_widget:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

/* Admin Settings Styles */
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
}

.ecf2248-settings-card {
  background: #fff;
  padding: 24px;
  margin-top: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.ecf2248-settings-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.ecf2248-settings-card h2 {
  margin-top: 0;
  font-size: 18px;
  color: #1f2937;
  font-weight: 600;
}

.ecf2248-settings-card p {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
}

.ecf2248-page-list {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.ecf2248-page-item {
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
}

.ecf2248-page-item:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
}

.ecf2248-page-item input {
  margin-right: 12px;
  accent-color: #4f46e5;
  width: 18px;
  height: 18px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

/* Responsive Styles */
@media only screen and (max-width: 480px) {
  /* Mobile styles */
  #triggervox_popup_form,
  #triggervox_widget_form {
    padding: 15px 20px;
    width: 90%;
    max-width: 320px;
    box-sizing: border-box;
  }

  #triggervox_popup_form h2,
  #triggervox_widget_form h2 {
    font-size: 20px;
    margin-bottom: 4px;
  }

  #triggervox_popup_form p,
  #triggervox_widget_form p {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .triggervox_form_row {
    margin-bottom: 8px;
  }

  .triggervox_form_row input[type="text"],
  .triggervox_form_row input[type="email"],
  .triggervox_form_row textarea {
    padding: 8px 12px;
    font-size: 14px;
  }

  #triggervox_submit {
    padding: 10px 16px;
    font-size: 15px;
  }

  .triggervox_disclaimer {
    margin-bottom: 8px;
  }

  #triggervox_widget_form {
    width: 280px;
    right: 20px;
    bottom: 20px;
  }

  #triggervox_reopen_button,
  #triggervox_reopen_widget {
    width: 50px;
    height: 50px;
    font-size: 20px;
    right: 20px;
    bottom: 20px;
  }
}

@media only screen and (min-width: 481px) and (max-width: 768px) {
  /* Tablet styles */
  #triggervox_popup_form {
    width: 80%;
    max-width: 500px;
    padding: 24px;
  }

  #triggervox_widget_form {
    width: 320px;
    bottom: 25px;
    right: 25px;
  }
}

@media only screen and (min-width: 769px) {
  /* Desktop styles */
  #triggervox_popup_form {
    width: 420px;
  }

  #triggervox_widget_form {
    width: 340px;
  }
}
