/* ============================================
   PURCHASE PAGE - MODERN GLASSMORPHISM DESIGN
   ============================================ */

.purchase-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 120px 20px 40px;
  font-family: "Emkan", sans-serif;
  direction: rtl;
  position: relative;
  overflow: hidden;
}

/* Animated background */
.purchase-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(102, 126, 234, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(118, 75, 162, 0.15) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.purchase-wrapper {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ============================================
   LOADING STATE
   ============================================ */

.purchase-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
  color: #fff;
  gap: 20px;
}

.purchase-loading__spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   HEADER
   ============================================ */

.purchase-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.purchase-header__badge {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 30px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.purchase-header__title {
  font-size: 2.5rem;
  color: #fff;
  margin: 0 0 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.purchase-header__description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto;
}

/* ============================================
   STEP CONTAINER
   ============================================ */

.purchase-step {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.purchase-step__title {
  color: #fff;
  font-size: 1.8rem;
  text-align: center;
  margin: 0 0 30px;
  font-weight: 600;
}

/* ============================================
   PAYMENT METHODS
   ============================================ */

.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.payment-card {
  padding: 30px 25px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.payment-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.payment-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.payment-card:hover::before {
  opacity: 1;
}

.payment-card--selected {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  box-shadow:
    0 0 0 2px rgba(102, 126, 234, 0.3),
    0 10px 30px rgba(102, 126, 234, 0.2);
}

.payment-card--selected::before {
  opacity: 1;
}

.payment-card > * {
  position: relative;
  z-index: 1;
}

.payment-card__flag {
  font-size: 3rem;
  margin-bottom: 15px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.payment-card__title {
  color: #fff;
  font-size: 1.3rem;
  margin: 0 0 8px;
  font-weight: 600;
}

.payment-card__subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  margin: 0 0 20px;
}

.payment-card__price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.payment-card__amount {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  font-family: "Courier New", monospace;
}

.payment-card__currency {
  color: #a5b4fc;
  font-size: 1rem;
  font-weight: 500;
}

.payment-card__features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.payment-card__features span {
  padding: 4px 8px;
}

/* ============================================
   NETWORK SELECTION
   ============================================ */

.network-selection {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.network-selection h4 {
  color: #fff;
  margin: 0 0 15px;
  font-size: 1rem;
  text-align: center;
}

.network-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.network-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.network-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.network-btn--active {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.3),
    rgba(118, 75, 162, 0.3)
  );
  border-color: #667eea;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.network-btn__fee {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   PURCHASE BUTTON
   ============================================ */

.purchase-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.purchase-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.purchase-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.purchase-btn svg {
  width: 20px;
  height: 20px;
  transform: rotate(180deg); /* For RTL */
}

.purchase-btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.purchase-btn--secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.purchase-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 15px;
  margin-top: 25px;
}

/* ============================================
   CRYPTO PAYMENT SECTION
   ============================================ */

.crypto-payment {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.crypto-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

.crypto-info__label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
}

.crypto-info__value {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.crypto-info__amount {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: "Courier New", monospace;
}

.crypto-info__currency {
  color: #a5b4fc;
  font-weight: 500;
}

.crypto-network-badge {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

/* Wallet Address */
.crypto-wallet {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crypto-wallet__label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  margin-bottom: 5px;
}

.crypto-wallet__box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  border: 1px dashed rgba(102, 126, 234, 0.5);
  border-radius: 14px;
}

.crypto-wallet__address {
  flex: 1;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  word-break: break-all;
  direction: ltr;
  text-align: left;
}

.crypto-wallet__copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.crypto-wallet__copy:hover {
  background: rgba(255, 255, 255, 0.2);
}

.crypto-wallet__copy svg {
  width: 16px;
  height: 16px;
}

/* Instructions */
.crypto-instructions {
  padding: 20px 25px;
  background: rgba(250, 204, 21, 0.05);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 14px;
}

.crypto-instructions h4 {
  color: #fde68a;
  margin: 0 0 15px;
  font-size: 1rem;
}

.crypto-instructions ol {
  margin: 0;
  padding-right: 20px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
}

.crypto-instructions ol li {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.crypto-instructions strong {
  color: #fff;
  font-weight: 600;
}

/* TX Input */
.tx-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tx-input-group label {
  color: #fff;
  font-size: 1rem;
  margin: 0;
}

.tx-input {
  width: 100%;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  direction: ltr;
  text-align: left;
  transition: all 0.3s ease;
}

.tx-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.tx-input-group small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

/* ============================================
   ZARINPAL PENDING
   ============================================ */

.zarinpal-pending {
  text-align: center;
  padding: 40px 20px;
}

.zarinpal-pending__icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.zarinpal-pending h3 {
  color: #fff;
  font-size: 1.4rem;
  margin: 0 0 15px;
}

.zarinpal-pending p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 30px;
  line-height: 1.7;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .purchase-container {
    padding: 100px 15px 30px;
  }

  .purchase-header {
    padding: 25px 20px;
  }

  .purchase-header__title {
    font-size: 1.8rem;
  }

  .purchase-step {
    padding: 25px 20px;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }

  .network-options {
    grid-template-columns: 1fr;
  }

  .purchase-actions {
    grid-template-columns: 1fr;
  }

  .crypto-wallet__box {
    flex-direction: column;
    align-items: stretch;
  }

  .crypto-wallet__copy {
    justify-content: center;
  }
}
