/*
 * Optimistic modal loader: the skeleton + error shell shown while a modal is
 * fetched. Mirrors the .booking-modal-overlay look (dark backdrop, centered
 * card) so the transition to real content is seamless. See modal_loader.js.
 */

.modal-loading-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: modal-loading-overlay-in 0.15s ease;
}

@keyframes modal-loading-overlay-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-loading-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.modal-loading-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #9aa0a6;
  cursor: pointer;
}

.modal-loading-close:hover {
  color: #444;
}

/* The loading indicator is the TripGoGo logo loader, injected by
   modal_loader.js via the shared builder (tripgogo/js/tripgogo_loader.js);
   it carries its own styles. */

/* Shimmer placeholder lines */
.modal-loading-lines {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-loading-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ececec 25%, #f5f5f5 37%, #ececec 63%);
  background-size: 400% 100%;
  animation: modal-loading-shimmer 1.4s ease infinite;
}

.modal-loading-line.short {
  width: 60%;
}

@keyframes modal-loading-shimmer {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0 50%;
  }
}

/* Error state */
.modal-loading-card--error {
  gap: 10px;
  text-align: center;
}

.modal-error-icon {
  font-size: 32px;
  color: #e0703a;
}

.modal-error-title {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: #1a1a1a;
}

.modal-error-sub {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.modal-error-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .modal-loading-overlay,
  .modal-loading-line {
    animation: none;
  }
}
