/**
 * ========================================
 * BOOKING CONFIRMATION SCREEN (STEP 4)
 * ========================================
 * Styles for the "All set — let's roll!" confirmation screen
 * Shown after successful dumpster rental booking payment
 */

/* Keyframe Animations */
@keyframes checkmark-draw {
  from {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
  }
  to {
    stroke-dasharray: 60;
    stroke-dashoffset: 0;
  }
}

@keyframes icon-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes icon-glow-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.15);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Step 4 Container */
.three-step__step--confirmation {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 0;
  background: radial-gradient(
    ellipse at top center,
    rgba(1, 176, 187, 0.03) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  min-height: 600px;
}

.three-step__step--confirmation.active {
  display: flex;
  animation: fade-in 0.3s ease;
}

/* Junk Removal Confirmation - Hidden by default */
#junk-confirmation.three-step__step--confirmation {
  display: none;
}

/* Junk Removal Confirmation - When visible, use flex layout */
#junk-confirmation.three-step__step--confirmation[style*="display: flex"],
#junkRemovalModal.showing-confirmation #junk-confirmation.three-step__step--confirmation {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  /* Fill the modal-content container completely */
  min-height: 100%;
  height: 100%;
  /* Center all children vertically and horizontally */
  justify-content: center;
  align-items: center;
}

/* Ensure junk confirmation body is centered and scrollable */
#junk-confirmation .three-step-modal__body--confirmation {
  flex: 0 1 auto;  /* Don't expand, just take needed space */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 480px;
}

/* Ensure junk confirmation content is visible - override any animations */
#junkRemovalModal #junk-confirmation .confirmation__heading {
  opacity: 1 !important;
  transform: translateY(0) !important;
  color: #111418 !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  display: block !important;
  visibility: visible !important;
  animation: none !important; /* Disable all animations */
  margin: 0 0 1rem !important;
}

#junkRemovalModal #junk-confirmation .confirmation__description {
  opacity: 1 !important;
  transform: translateY(0) !important;
  color: #3d4855 !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  display: block !important;
  visibility: visible !important;
  animation: none !important; /* Disable all animations */
  margin: 0 0 2.5rem !important;
  max-width: 420px !important;
}

#junkRemovalModal #junk-confirmation .confirmation__details-card {
  opacity: 1 !important;
  transform: translateY(0) !important;
  background: #e8f9fa !important;
  border: 1px solid #b3e5e9 !important;
  border-radius: 0.75rem !important;
  padding: 1.25rem 1.5rem !important;
  display: block !important;
  visibility: visible !important;
  animation: none !important; /* Disable all animations */
  width: 100% !important;
  margin-bottom: 2rem !important;
  box-shadow: 0 2px 8px rgba(1, 176, 187, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

#junkRemovalModal #junk-confirmation .confirmation__detail-value {
  color: #111418 !important; /* Black text for detail values */
  font-weight: 600 !important;
}

/* Header with Close Button */
.three-step-modal__header--confirmation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1rem 1rem 0;
  background: transparent;
  border-bottom: none;
}

.three-step-modal__header-spacer {
  width: 48px; /* Balance the close button */
}

.three-step-modal__close-btn--confirmation {
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #111418;
  cursor: pointer;
  padding: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.three-step-modal__close-btn--confirmation:hover {
  color: #617589;
}

/* Confirmation Body */
.three-step-modal__body--confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Icon Wrapper - Dumpster with Checkmark */
.confirmation__icon-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: icon-bounce 0.6s ease 0.3s both;
}

/* Glowing background effect */
.confirmation__icon-wrapper::before {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(1, 176, 187, 0.15), transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: icon-glow-pulse 3s ease-in-out infinite;
}

.confirmation__icon-dumpster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(1, 176, 187, 0.25); /* Teal at 25% opacity */
  z-index: 1;
}

.confirmation__icon-check {
  position: relative;
  z-index: 10;
  width: 64px;
  height: 64px;
  color: #01b0bb; /* Solid teal */
}

/* Animate checkmark path */
.confirmation__icon-check path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: checkmark-draw 0.5s ease 0.6s forwards;
}

/* Circle icon variant for junk removal */
.confirmation__icon-circle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(1, 176, 187, 0.25); /* Teal at 25% opacity */
  z-index: 1;
}

/* Animate circle stroke */
.confirmation__icon-circle circle {
  stroke-dasharray: 365;
  stroke-dashoffset: 365;
  animation: checkmark-draw 0.8s ease 0.3s forwards;
}

/* Heading */
.confirmation__heading {
  font-size: 2rem; /* 32px - slightly larger */
  font-weight: 700;
  line-height: 1.2;
  color: #111418;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  animation: fade-in-up 0.5s ease 0.4s both;
}

/* Ensure booking modal confirmation heading matches junk removal styling */
#bookingModal .confirmation__heading {
  opacity: 1 !important;
  transform: translateY(0) !important;
  color: #111418 !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  display: block !important;
  visibility: visible !important;
  animation: none !important;
  margin: 0 0 1rem !important;
}

/* Description */
.confirmation__description {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6; /* Increased for better readability */
  color: #3d4855; /* Darker text color for better readability */
  margin: 0 0 2.5rem;
  max-width: 420px;
  animation: fade-in-up 0.5s ease 0.6s both;
}

/* Ensure booking modal confirmation description matches junk removal styling */
#bookingModal .confirmation__description {
  opacity: 1 !important;
  transform: translateY(0) !important;
  color: #3d4855 !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  display: block !important;
  visibility: visible !important;
  animation: none !important;
  margin: 0 0 2.5rem !important;
  max-width: 420px !important;
}

/* Details Card */
.confirmation__details-card {
  width: 100%;
  background: #e8f9fa; /* Light teal background */
  border: 1px solid #b3e5e9; /* Teal border */
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow:
    0 2px 8px rgba(1, 176, 187, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.06);
  animation: fade-in-up 0.5s ease 0.8s both;
  transition: box-shadow 0.3s ease;
}

.confirmation__details-card:hover {
  box-shadow:
    0 4px 12px rgba(1, 176, 187, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Ensure booking modal confirmation details card matches junk removal styling */
#bookingModal .confirmation__details-card {
  opacity: 1 !important;
  transform: translateY(0) !important;
  background: #e8f9fa !important;
  border: 1px solid #b3e5e9 !important;
  border-radius: 0.75rem !important;
  padding: 1.25rem 1.5rem !important;
  display: block !important;
  visibility: visible !important;
  animation: none !important;
  width: 100% !important;
  margin-bottom: 2rem !important;
  box-shadow: 0 2px 8px rgba(1, 176, 187, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

#bookingModal .confirmation__detail-value {
  color: #111418 !important; /* Black text for detail values */
  font-weight: 600 !important;
}

.confirmation__detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 0.75rem 0;
  transition: background-color 0.2s ease;
}

.confirmation__detail-row:hover {
  background-color: rgba(1, 176, 187, 0.03);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 0.375rem;
}

.confirmation__detail-row:not(:last-child) {
  border-bottom: 1px solid rgba(1, 176, 187, 0.15); /* Lighter teal divider */
}

.confirmation__detail-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #617589;
  flex-shrink: 0;
}

.confirmation__detail-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111418;
  text-align: right;
  word-break: break-word;
}

/* Action Buttons */
.confirmation__actions {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
  animation: fade-in-up 0.5s ease 1s both;
}

.confirmation__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

/* Ripple effect on click */
.confirmation__btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.confirmation__btn:active::after {
  transform: scale(4);
  opacity: 1;
  transition: transform 0.5s, opacity 0.3s;
}

.confirmation__btn--primary {
  background: linear-gradient(135deg, #01b0bb 0%, #019aa3 100%);
  color: #ffffff;
  box-shadow:
    0 2px 8px rgba(1, 176, 187, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.1);
}

.confirmation__btn--primary:hover {
  background: linear-gradient(135deg, #019aa3 0%, #018892 100%);
  box-shadow:
    0 4px 14px rgba(1, 176, 187, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.confirmation__btn--primary:active {
  background: linear-gradient(135deg, #018892 0%, #017881 100%);
  transform: translateY(0);
  box-shadow:
    0 2px 8px rgba(1, 176, 187, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.1);
}

.confirmation__btn--secondary {
  background: transparent;
  color: #01b0bb;
  border: 2px solid rgba(1, 176, 187, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.confirmation__btn--secondary:hover {
  background: rgba(1, 176, 187, 0.08);
  border-color: rgba(1, 176, 187, 0.6);
  box-shadow: 0 2px 8px rgba(1, 176, 187, 0.15);
  transform: translateY(-1px);
}

.confirmation__btn--secondary:active {
  background: rgba(1, 176, 187, 0.12);
  transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
  .confirmation__heading {
    font-size: 1.625rem; /* 26px on mobile */
  }

  .confirmation__description {
    font-size: 0.9375rem; /* 15px on mobile */
    margin-bottom: 2rem;
  }

  .three-step-modal__body--confirmation {
    padding: 1.5rem 1rem;
  }

  .confirmation__icon-wrapper {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
  }

  .confirmation__icon-wrapper::before {
    width: 120px;
    height: 120px;
  }

  .confirmation__icon-check {
    width: 52px;
    height: 52px;
  }

  .confirmation__details-card {
    padding: 1rem 1.25rem;
  }

  .confirmation__btn {
    height: 50px;
    font-size: 0.9375rem;
  }
}

/* Dark mode support (optional - matches design system) */
@media (prefers-color-scheme: dark) {
  .three-step-modal__close-btn--confirmation {
    color: #e5e7eb;
  }

  .three-step-modal__close-btn--confirmation:hover {
    color: #9ca3af;
  }

  .confirmation__heading {
    color: #ffffff;
  }

  .confirmation__description {
    color: #9ca3af;
  }

  .confirmation__details-card {
    background: rgba(16, 25, 34, 0.5);
    border-color: #374151;
  }

  .confirmation__detail-row:not(:last-child) {
    border-color: #374151;
  }

  .confirmation__detail-label {
    color: #9ca3af;
  }

  .confirmation__detail-value {
    color: #e5e7eb;
  }
}
