/* ===================================================
   STACKMARKET - LOADING SCREEN STYLES
   Exact replica of user's provided screen:
   - Animated concentric ripple/wave background (cream/beige/yellow-green)
   - Circular spinner with rotating arc
   - "Loading... Please wait."
   - "We're preparing your store experience."
   - Dual pill action buttons: [Cancel] [Continue]
   =================================================== */

.loading-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* Base cream/off-white background matching the image */
  background: #f5f0e8;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s ease;
  user-select: none;
  overflow: hidden;
  cursor: pointer;
}

/* ---- Animated concentric ripple rings (the wavy background from the photo) ---- */
.loading-screen-overlay::before,
.loading-screen-overlay::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform-origin: center center;
}

/* Large slow ripple layer 1 */
.loading-screen-overlay::before {
  width: 180vmax;
  height: 180vmax;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse at center,
      transparent 10%,
      rgba(210, 195, 150, 0.08) 11%,
      transparent 12%,
      transparent 16%,
      rgba(195, 185, 130, 0.07) 17%,
      transparent 18%,
      transparent 22%,
      rgba(185, 175, 120, 0.07) 23%,
      transparent 24%,
      transparent 28%,
      rgba(175, 165, 110, 0.06) 29%,
      transparent 30%,
      transparent 34%,
      rgba(195, 185, 130, 0.06) 35%,
      transparent 36%,
      transparent 40%,
      rgba(210, 200, 140, 0.05) 41%,
      transparent 42%,
      transparent 46%,
      rgba(200, 190, 135, 0.05) 47%,
      transparent 48%,
      transparent 52%,
      rgba(190, 180, 125, 0.05) 53%,
      transparent 54%,
      transparent 58%,
      rgba(205, 195, 138, 0.04) 59%,
      transparent 60%,
      transparent 64%,
      rgba(215, 205, 145, 0.04) 65%,
      transparent 66%
    );
  animation: ripple-pulse 8s linear infinite;
}

/* Second ripple layer - offset phase for depth */
.loading-screen-overlay::after {
  width: 160vmax;
  height: 160vmax;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse at center,
      transparent 8%,
      rgba(180, 210, 150, 0.06) 9%,
      transparent 10%,
      transparent 14%,
      rgba(170, 200, 140, 0.055) 15%,
      transparent 16%,
      transparent 20%,
      rgba(160, 195, 135, 0.05) 21%,
      transparent 22%,
      transparent 26%,
      rgba(175, 205, 145, 0.05) 27%,
      transparent 28%,
      transparent 32%,
      rgba(185, 210, 155, 0.045) 33%,
      transparent 34%,
      transparent 38%,
      rgba(190, 215, 158, 0.04) 39%,
      transparent 40%,
      transparent 44%,
      rgba(180, 208, 150, 0.04) 45%,
      transparent 46%,
      transparent 50%,
      rgba(175, 205, 148, 0.035) 51%,
      transparent 52%,
      transparent 56%,
      rgba(185, 212, 152, 0.035) 57%,
      transparent 58%
    );
  animation: ripple-pulse 11s linear infinite reverse;
}

/* SVG ripple canvas rendered by JS sits here as .ripple-canvas */
.ripple-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

@keyframes ripple-pulse {
  0%   { transform: translate(-50%, -50%) scale(0.88); }
  50%  { transform: translate(-50%, -50%) scale(1.00); }
  100% { transform: translate(-50%, -50%) scale(0.88); }
}

.loader-card-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 500px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Spinner design from photo */
.loader-spinner-wrapper {
  margin-bottom: 24px;
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid #e2e8f0; /* Light ring */
  border-top-color: #0284c7; /* Vibrant blue leading edge */
  border-right-color: #0369a1; /* Deep blue arc matching photo */
  animation: spin-exact 0.9s linear infinite;
  box-shadow: 0 0 1px rgba(2, 132, 199, 0.2);
}

@keyframes spin-exact {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Typography matching photo */
.loader-title {
  font-family: "Georgia", "Times New Roman", serif; /* Elegant serif look from photo */
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 10px 0;
  letter-spacing: -0.2px;
}

.loader-subtitle {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: #64748b;
  margin: 0 0 32px 0;
  font-weight: 400;
}

/* Button pill actions */
.loader-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loader-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 9999px; /* Pill shape */
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
  letter-spacing: 0.1px;
  outline: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* The teal-blue pill buttons from the image */
.loader-btn-primary {
  background: #007791; /* Deep ocean teal/blue */
  background: linear-gradient(135deg, #00738c, #005f73);
  color: #ffffff;
}

.loader-btn-primary:hover {
  background: linear-gradient(135deg, #02839f, #006e85);
  box-shadow: 0 4px 12px rgba(0, 115, 140, 0.3);
  transform: translateY(-1px);
}

.loader-btn-primary:active {
  transform: translateY(0);
}

.loader-btn-cancel {
  background: #007791;
  background: linear-gradient(135deg, #00738c, #005f73);
  color: #ffffff;
}

.loader-btn-cancel:hover {
  background: linear-gradient(135deg, #02839f, #006e85);
  box-shadow: 0 4px 12px rgba(0, 115, 140, 0.3);
  transform: translateY(-1px);
}

/* Progress bar indicator below buttons */
.loader-progress-track {
  width: 220px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-top: 24px;
  overflow: hidden;
  position: relative;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00738c, #0ea5e9);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.loader-status-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #94a3b8;
  font-family: monospace;
}

/* Fade out animation state */
.loading-screen-overlay.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
