/* ============================================================
   payment-system.css — ChicCharms Demo Payment UI
   Covers: demo banner, payment method cards, success/failure
   modals, trust badges, toast notifications, particle effects.
   ============================================================ */

/* ── CSS Variables (extends existing ChicCharms tokens) ── */
:root {
  --rzp-rose:        #e8809a;
  --rzp-rose-dark:   #c04060;
  --rzp-blush:       #fff0f4;
  --rzp-blush-mid:   #ffd6e0;
  --rzp-text:        #3b2a2e;
  --rzp-muted:       #9e7e84;
  --rzp-border:      rgba(232,128,154,0.2);
  --rzp-white:       #ffffff;
  --rzp-error:       #e57373;
  --rzp-error-bg:    #fff5f5;
  --rzp-success:     #66bb6a;
  --rzp-shadow-card: 0 8px 32px rgba(60,30,40,0.13);
  --rzp-radius:      16px;
  --rzp-radius-sm:   10px;
  --rzp-transition:  0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================================
   DEMO BANNER
   ============================================================ */
.rzp-demo-banner {
  background: linear-gradient(135deg, #fffbea 0%, #fff8f0 100%);
  border: 1.5px solid #f0c060;
  border-radius: var(--rzp-radius-sm);
  margin-bottom: 18px;
  overflow: hidden;
  transition: var(--rzp-transition);
}

.rzp-demo-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.rzp-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0c060;
  color: #5a3800;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.rzp-demo-banner-title {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: #7a5200;
}

.rzp-demo-chevron {
  color: #b08030;
  font-size: 0.9rem;
  transition: transform 0.2s;
}

.rzp-demo-banner.rzp-demo-expanded .rzp-demo-chevron {
  transform: rotate(180deg);
}

.rzp-demo-banner-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 0 16px;
}

.rzp-demo-banner.rzp-demo-expanded .rzp-demo-banner-body {
  max-height: 220px;
  padding-bottom: 14px;
}

.rzp-demo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(240,192,96,0.4);
  font-size: 0.8rem;
}

.rzp-demo-row:last-child { border-bottom: none; }

.rzp-demo-label {
  color: #9a6c00;
  font-weight: 600;
  min-width: 90px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rzp-demo-value {
  color: #5a3800;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.rzp-demo-copy {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px dashed #d4a020;
  background: rgba(240,192,96,0.12);
  transition: background 0.15s;
}

.rzp-demo-copy:hover { background: rgba(240,192,96,0.26); }

.rzp-demo-copy-icon {
  font-size: 0.75rem;
  opacity: 0.7;
}

.rzp-demo-hint {
  font-size: 0.75rem;
  color: #8a6200;
  font-family: inherit;
  flex-wrap: wrap;
}

/* ============================================================
   ENHANCED PAYMENT METHOD CARDS
   ============================================================ */
.payment-method-option {
  position: relative;
  overflow: hidden;
}

.payment-method-option::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(135deg, rgba(244,167,185,0.07) 0%, rgba(232,128,154,0.04) 100%);
  transition: opacity 0.2s;
}

.payment-method-option:has(input:checked)::after { opacity: 1; }

.payment-method-option:has(input:checked) {
  border-color: var(--rzp-rose) !important;
  box-shadow: 0 0 0 3px rgba(232,128,154,0.16), 0 4px 16px rgba(232,128,154,0.12) !important;
}

/* ============================================================
   TRUST SECTION — In order summary
   ============================================================ */
.rzp-trust-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(232,128,154,0.2);
}

.rzp-trust-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.rzp-trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--rzp-muted);
}

.rzp-trust-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.rzp-trust-text {
  font-weight: 500;
  color: var(--rzp-text);
}

.rzp-secured-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--rzp-blush);
  border-radius: var(--rzp-radius-sm);
  font-size: 0.75rem;
  color: var(--rzp-muted);
  border: 1px solid rgba(232,128,154,0.15);
}

.rzp-secured-by strong {
  color: #2c6fbc;
  font-weight: 700;
}

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.rzp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(30, 10, 20, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
  overflow-y: auto;
}

.rzp-modal-overlay.rzp-modal-visible {
  opacity: 1;
}

/* Prevent body scroll when modal is open */
body.rzp-modal-open {
  overflow: hidden;
}

.rzp-modal-card {
  background: var(--rzp-white);
  border-radius: 24px;
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  opacity: 0;
  box-shadow: 0 24px 64px rgba(30, 10, 20, 0.22), 0 4px 16px rgba(30,10,20,0.1);
  overflow: hidden;
}

.rzp-modal-visible .rzp-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Success Card ── */
.rzp-success-card::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(232,128,154,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* ============================================================
   SUCCESS ANIMATION
   ============================================================ */
.rzp-success-anim {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
}

.rzp-success-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(232,128,154,0.25);
  inset: 0;
}

.rzp-ring-1 { animation: rzp-ring-pulse 2s 0.1s ease-in-out infinite; }
.rzp-ring-2 { animation: rzp-ring-pulse 2s 0.35s ease-in-out infinite; }
.rzp-ring-3 { animation: rzp-ring-pulse 2s 0.6s ease-in-out infinite; }

@keyframes rzp-ring-pulse {
  0%   { transform: scale(0.85); opacity: 0.5; }
  50%  { transform: scale(1.1);  opacity: 0.15; }
  100% { transform: scale(0.85); opacity: 0.5; }
}

.rzp-success-checkmark {
  position: absolute;
  inset: 10px;
}

.rzp-success-checkmark svg {
  width: 100%;
  height: 100%;
}

.rzp-check-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: rzp-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.1s forwards;
}

.rzp-check-mark {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: rzp-stroke 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.65s forwards;
}

@keyframes rzp-stroke {
  to { stroke-dashoffset: 0; }
}

/* ── Success Text ── */
.rzp-success-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rzp-rose);
  margin-bottom: 6px;
}

.rzp-success-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--rzp-text);
  margin-bottom: 8px;
  line-height: 1.25;
}

.rzp-success-subtitle {
  font-size: 0.88rem;
  color: var(--rzp-muted);
  margin-bottom: 24px;
}

/* ── Order Details ── */
.rzp-order-details {
  background: #fafafa;
  border: 1px solid #f0e8ea;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
}

.rzp-order-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(232,128,154,0.2);
  font-size: 0.82rem;
}

.rzp-order-row:last-child { border-bottom: none; }

.rzp-order-label {
  color: var(--rzp-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.rzp-order-value {
  color: var(--rzp-text);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.rzp-order-id {
  font-family: 'Courier New', monospace;
  color: var(--rzp-rose-dark);
  font-size: 0.9rem;
}

.rzp-payment-id {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: #888;
  font-weight: 400;
}

/* ── Buttons ── */
.rzp-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.rzp-btn-continue {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--rzp-rose) 0%, var(--rzp-rose-dark) 100%);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(232,128,154,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.rzp-btn-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(192,64,96,0.4);
}

.rzp-success-note {
  font-size: 0.73rem;
  color: var(--rzp-muted);
}

/* ── Particles ── */
.rzp-particle {
  position: fixed;
  top: 30%;
  pointer-events: none;
  animation: rzp-particle-fall linear forwards;
  z-index: 10000;
}

@keyframes rzp-particle-fall {
  0%   { transform: translateY(0)     rotate(0deg);   opacity: 1; }
  100% { transform: translateY(180px) rotate(360deg); opacity: 0; }
}

/* ============================================================
   FAILURE MODAL
   ============================================================ */
.rzp-failure-card {
  border-top: 3px solid var(--rzp-error);
}

.rzp-failure-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.rzp-failure-icon svg {
  width: 100%;
  height: 100%;
}

.rzp-failure-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--rzp-text);
  margin-bottom: 8px;
}

.rzp-failure-msg {
  font-size: 0.88rem;
  color: var(--rzp-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.rzp-failure-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.rzp-btn-retry {
  flex: 1;
  padding: 13px;
  background: linear-gradient(135deg, var(--rzp-rose) 0%, var(--rzp-rose-dark) 100%);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
  font-family: inherit;
}

.rzp-btn-retry:hover { transform: translateY(-1px); }

.rzp-btn-cancel {
  flex: 1;
  padding: 13px;
  background: var(--rzp-blush);
  color: var(--rzp-rose-dark);
  border: 1.5px solid var(--rzp-border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.rzp-btn-cancel:hover { background: var(--rzp-blush-mid); }

.rzp-failure-note {
  font-size: 0.73rem;
  color: var(--rzp-muted);
}

.rzp-failure-note a {
  color: var(--rzp-rose-dark);
  text-decoration: none;
  font-weight: 600;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.rzp-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.15);
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: calc(100vw - 48px);
}

.rzp-toast.rzp-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.rzp-toast-success {
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid rgba(102, 187, 106, 0.4);
  color: #2e7d32;
}

.rzp-toast-error {
  background: rgba(255,245,245,0.96);
  border: 1.5px solid rgba(229,115,115,0.4);
  color: #c62828;
}

.rzp-toast-info {
  background: rgba(255,255,255,0.96);
  border: 1.5px solid rgba(33,150,243,0.3);
  color: #1565c0;
}

.rzp-toast-icon { font-size: 1rem; }

/* ============================================================
   ANIMATED PAY BUTTON
   ============================================================ */
@keyframes rzp-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.btn-pay-online {
  position: relative;
  overflow: hidden;
}

.btn-pay-online::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.22) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: rzp-shimmer 2.4s linear infinite;
  pointer-events: none;
}

/* ============================================================
   MOBILE OPTIMIZATIONS
   ============================================================ */
@media (max-width: 600px) {
  .rzp-modal-card {
    padding: 32px 22px 26px;
    border-radius: 20px;
    margin: auto;
  }

  .rzp-success-title {
    font-size: 1.4rem;
  }

  .rzp-failure-actions {
    flex-direction: column;
  }

  .rzp-toast {
    bottom: 20px;
    padding: 11px 18px;
    font-size: 0.82rem;
    white-space: normal;
    text-align: center;
  }

  .rzp-demo-banner-title {
    font-size: 0.72rem;
  }
}

/* ============================================================
   CHECKOUT PROGRESS CARD ENHANCEMENTS
   (If .checkout-progress-card exists)
   ============================================================ */
.checkout-progress-card {
  animation: rzp-fade-in 0.4s ease both;
}

@keyframes rzp-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
