/* 
 * Xi Woo Cart Payment Styles
 * 
 * Styles for:
 * - Payment methods
 * - Payment processing status
 * - CreditGuard integration
 */

/* ==========================================================================
   Payment Processing UI
   ========================================================================== */

/* Enhanced Payment Loading Styles */
.xi-payment-simple {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 20px;
  text-align: center;
  direction: rtl;
}

.xi-payment-simple h2 {
  margin-bottom: 25px;
  font-size: 24px;
  color: #003768;
}

/* Progress Bar */
.progress-bar-container {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin: 20px auto 30px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #003b71;
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* Multi-stage payment progress */
.xi-stages {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.stage {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
  transition: all 0.3s ease;
  opacity: 0.5;
}

.stage.active {
  opacity: 1;
  background: #f0f8ff;
  box-shadow: 0 2px 8px rgba(0, 59, 113, 0.1);
}

.stage.completed {
  opacity: 0.8;
  background: #f0f7f0;
}

.stage-icon {
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.stage-icon-inner {
  width: 30px;
  height: 30px;
  background: #e0e0e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #555;
  transition: all 0.3s ease;
}

.stage.active .stage-icon-inner {
  background: #003b71;
  color: white;
}

.stage.completed .stage-icon-inner {
  background: #4caf50;
  color: white;
}

.stage.completed .stage-icon-inner::after {
  content: "✓";
}

.stage.completed .stage-icon-inner {
  font-size: 0;
}

.stage-content {
  text-align: right;
  flex-grow: 1;
}

.stage-title {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 600;
}

.stage-desc {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* Loading message */
.xi-loading-message {
  margin: 20px 0;
  padding: 15px;
  background: #fffde7;
  border-radius: 8px;
  border-right: 3px solid #FE6B01;
}

.xi-small {
  font-size: 14px;
  color: #777;
  margin-top: 5px;
}

/* Manual redirect button */
.xi-manual-redirect {
  margin-top: 30px;
  padding: 15px;
  border-top: 1px solid #eee;
}

.xi-redirect-button,
.xi-retry-button {
  background-color: #29648a;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.xi-redirect-button:hover,
.xi-retry-button:hover {
  background-color: #194461;
}

.xi-redirect-button.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Error message */
.xi-payment-error {
  margin-top: 20px;
  padding: 15px;
  background: #fff5f5;
  border-radius: 8px;
  border-right: 3px solid #f44336;
}

.xi-payment-error .error-message {
  font-weight: bold;
  color: #d32f2f;
  margin: 10px 0;
  display: block;
}

/* ==========================================================================
     CreditGuard Integration
     ========================================================================== */

#creditguard-payment-wrap {
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

#creditguard-iframe-container {
  min-height: 577px;
  position: relative;
}

#creditguard-iframe-container iframe {
  width: 100%;
  min-height: 900px;
  border: none;
}

.loading-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

.loading .loading-message {
  display: block;
}

/* ==========================================================================
     Payment Section
     ========================================================================== */

.payment-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.payment-title {
  margin-bottom: 20px;
  text-align: center;
}

.payment-iframe-container {
  position: relative;
  min-height: 600px;
  margin: 20px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

.payment-iframe-container.loading .loading-overlay {
  display: flex;
}

.loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-overlay .loading-text {
  margin-top: 15px;
  font-size: 16px;
  color: #333;
}

/* ==========================================================================
     Responsive Adjustments
     ========================================================================== */

@media (max-width: 768px) {
  .payment-section {
    padding: 10px;
  }

  .payment-iframe-container {
    margin: 10px 0;
  }

  iframe {
    height: 500px;
  }
}
