/**
 * Booking Submission Styles
 * Styles for loading states, messages, and submission flow
 */

/* Loading States */
.md-btn.loading {
  position: relative;
  color: transparent;
}

.md-btn.loading .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Loading Overlay */
#booking-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.loading-content {
  background: white;
  padding: 2rem 3rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.spinner-large {
  width: 50px;
  height: 50px;
  border: 3px solid #e0e0e0;
  border-top-color: #1e88e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.loading-content p {
  margin: 0;
  color: #424242;
  font-size: 1.1rem;
}

/* Booking Messages */
.booking-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.booking-message.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.booking-message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.booking-message .material-symbols-outlined {
  font-size: 1.5rem;
}

.booking-message .close-message {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.booking-message .close-message:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.booking-message .close-message .material-symbols-outlined {
  font-size: 1.25rem;
}

/* Form field error states */
.md-form-field.has-error .md-input,
.md-form-field.has-error .md-select,
.md-form-field.has-error .md-textarea {
  border-color: #f44336;
}

.md-form-field.has-error .md-input-label {
  color: #f44336;
}

.md-form-field.has-error .md-input-icon {
  color: #f44336;
}

/* Price section with message */
#price-section {
  position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .loading-content {
    padding: 1.5rem 2rem;
    margin: 1rem;
  }
  
  .booking-message {
    font-size: 0.875rem;
    padding: 0.75rem;
  }
  
  .booking-message .material-symbols-outlined {
    font-size: 1.25rem;
  }
}

/* Button disabled state */
.md-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Success animation for price box */
.md-price-box.success {
  animation: successPulse 0.5s ease-out;
}

@keyframes successPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Payment redirect message */
.payment-redirect-message {
  text-align: center;
  padding: 2rem;
  background: #f5f5f5;
  border-radius: 8px;
  margin: 1rem 0;
}

.payment-redirect-message h3 {
  color: #1e88e5;
  margin-bottom: 0.5rem;
}

.payment-redirect-message p {
  color: #616161;
  margin: 0;
}