/**
 * Airbnb-style Inquiry Form States
 * Provides smooth transitions between form, loading, success, and error states
 */

/* Success State Component */
.inquiry-success-state {
  display: none;
  text-align: center;
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.5s ease-out;
}

.inquiry-success-state.active {
  display: block;
}

.inquiry-success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.5rem;
  background: #3B71FE;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.inquiry-success-icon svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.inquiry-success-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #484848;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.inquiry-success-message {
  font-size: 0.875rem;
  color: #767676;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.inquiry-state-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 0 1rem;
}

.inquiry-state-actions .btn-primary-cta,
.inquiry-state-actions .btn-secondary-cta {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  border: 1px solid;
}

.inquiry-state-actions .btn-primary-cta {
  background: #3B71FE;
  border-color: #3B71FE;
  color: white;
}

.inquiry-state-actions .btn-primary-cta:hover {
  background: #2c5bdc;
  border-color: #2c5bdc;
}

.inquiry-state-actions .btn-secondary-cta {
  background: transparent;
  color: #484848;
  border-color: #dddddd;
}

.inquiry-state-actions .btn-secondary-cta:hover {
  background: #f8f9fa;
  border-color: #c6c6c6;
}

/* Error State Component */
.inquiry-error-state {
  display: none;
  text-align: center;
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.5s ease-out;
}

.inquiry-error-state.active {
  display: block;
}

.inquiry-error-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: #c13515;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.inquiry-error-icon svg {
  width: 32px;
  height: 32px;
  fill: white;
}

.inquiry-error-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: #484848;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.inquiry-error-message {
  font-size: 1rem;
  color: #767676;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* Loading State Enhancements */
.inquiry-form.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.inquiry-form.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Inline Field Validation */
.form-control.is-invalid {
  border-color: #c13515 !important;
  box-shadow: 0 0 0 0.2rem rgba(193, 53, 21, 0.25) !important;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #c13515;
  animation: fadeIn 0.3s ease-out;
}

.form-control.is-invalid ~ .invalid-feedback {
  display: block;
}

/* Form State Transitions */
.inquiry-view-transition {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.inquiry-form-container {
  position: relative;
  overflow: hidden;
}

.inquiry-form,
.inquiry-success-state,
.inquiry-error-state {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.inquiry-form.slide-out {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.inquiry-state-enter {
  transform: translateX(100%);
  opacity: 0;
}

.inquiry-state-enter.active {
  transform: translateX(0);
  opacity: 1;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .inquiry-success-state,
  .inquiry-error-state {
    padding: 1.5rem 1rem;
  }
  
  .inquiry-success-icon,
  .inquiry-error-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
  }
  
  .inquiry-success-icon svg,
  .inquiry-error-icon svg {
    width: 18px;
    height: 18px;
  }
  
  .inquiry-success-title,
  .inquiry-error-title {
    font-size: 1.25rem;
  }
}