.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.crypto-modal {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.crypto-modal::-webkit-scrollbar {
  display: none;
}

.crypto-modal {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.crypto-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.crypto-modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0.25rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-close:hover {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.1);
}

.crypto-modal-body {
  padding: 1.25rem;
}

.deposit-amount-section {
  margin-bottom: 1.25rem;
}

.deposit-amount-section label {
  display: flex;
  align-items: center;
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.amount-input-wrapper {
  display: flex;
  gap: 0.5rem;
  position: relative;
  z-index: 10;
}

#depositAmountInput {
  flex: 1;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  outline: none;
  transition: border-color 0.2s;
}

#depositAmountInput:focus {
  border-color: #6366f1;
}

.currency-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}

.currency-selector:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

.currency-flag {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.currency-flag svg {
  width: 100%;
  height: 100%;
}

.currency-code {
  font-weight: 600;
  color: #f1f5f9;
  font-size: 0.875rem;
}

.dropdown-arrow {
  margin-left: auto;
  color: #94a3b8;
  transition: transform 0.2s;
}

.currency-selector:hover .dropdown-arrow {
  color: #6366f1;
}

.fiat-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  overflow: hidden;
  z-index: 9999;
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: none;
}

.fiat-dropdown[style*="display: block"] {
  display: block !important;
}

.fiat-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
  color: #f1f5f9;
}

.fiat-option:hover {
  background: rgba(99, 102, 241, 0.1);
}

.fiat-option .currency-flag {
  width: 20px;
  height: 20px;
}

.fiat-option .currency-name {
  flex: 1;
  font-size: 0.875rem;
}

.fiat-option .currency-code {
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
}

.minimum-deposit {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.crypto-btn {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 0.875rem 0.625rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.crypto-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--crypto-color, #3b82f6) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.crypto-btn:hover {
  border-color: var(--crypto-color, rgba(59, 130, 246, 0.5));
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.crypto-btn:hover::before {
  opacity: 0.1;
}

.crypto-btn.selected {
  border-color: var(--crypto-color, #6366f1);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.crypto-btn.selected::before {
  opacity: 0.15;
}

.crypto-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s;
}

.crypto-icon svg {
  width: 100%;
  height: 100%;
}

.crypto-btn:hover .crypto-icon {
  transform: scale(1.1);
}

.crypto-info {
  text-align: center;
  width: 100%;
}

.crypto-name {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.crypto-network {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.deposit-notice {
  display: flex;
  gap: 0.625rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.deposit-notice p {
  margin: 0;
  color: #fbbf24;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.pay-btn {
  width: 100%;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  border-radius: 10px;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pay-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.pay-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wallet-modal {
  max-width: 520px;
}

.wallet-modal .crypto-modal-body {
  padding: 1.5rem 2rem 2rem;
}

.back-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.375rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.back-btn:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.wallet-notice {
  display: flex;
  gap: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.wallet-notice p {
  margin: 0;
  color: #a5b4fc;
  font-size: 0.875rem;
  line-height: 1.5;
}

.qr-section {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

#qrcode {
  display: inline-block;
  padding: 0.5rem;
  background: white;
  border-radius: 12px;
  line-height: 0;
}

#qrcode img {
  display: block;
  width: 160px !important;
  height: 160px !important;
  border-radius: 8px;
}

.wallet-info {
  text-align: center;
  margin-bottom: 1.25rem;
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: #a5b4fc;
  font-size: 0.875rem;
  font-weight: 500;
}

.minimum-notice {
  color: #fbbf24 !important;
}

.transfer-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.transfer-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.transfer-label {
  color: #94a3b8;
  font-size: 0.875rem;
  text-align: center;
  margin: 0.5rem 0;
}

.transfer-amount {
  font-size: 1.75rem;
  font-weight: 600;
  color: #6366f1;
  text-align: center;
  margin: 0.75rem 0;
}

.wallet-address {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.875rem;
}

.wallet-address:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
}

.address-text {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  color: #a5b4fc;
  word-break: break-all;
  line-height: 1.4;
}

.copy-icon {
  flex-shrink: 0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.wallet-address:hover .copy-icon {
  color: #6366f1;
}

.rate-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1.4;
}

.paid-btn {
  width: 100%;
  background: #6366f1;
  border: none;
  border-radius: 8px;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
}

.paid-btn:hover:not(:disabled) {
  background: #4f46e5;
  transform: translateY(-1px);
}

.paid-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.status-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
