:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(26, 26, 46, 0.6);
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --border: rgba(139, 92, 246, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Animated background */
.bg-gradient {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 40% 60% at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
    var(--bg-primary);
  z-index: -1;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
}

/* Glassmorphism card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 
    0 0 40px rgba(139, 92, 246, 0.1),
    0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-card-inner {
  background: rgba(18, 18, 26, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: 16px;
}

/* Glow effects */
.glow-text {
  text-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.glow-border {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Button styles */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  border: none;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary:disabled::before {
  display: none;
}

/* Swap button */
.swap-btn {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border: 2px solid var(--accent-purple);
  transition: all 0.3s ease;
}

.swap-btn:hover {
  border-color: var(--accent-cyan);
  transform: rotate(180deg);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
}

/* Input styles */
.input-field {
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.input-field::placeholder {
  color: var(--text-muted);
}

/* Dropdown */
.dropdown-menu {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 3px;
}

.dropdown-item {
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(139, 92, 246, 0.2);
}

/* Status badges */
.status-wait {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  animation: pulse 2s infinite;
}

.status-confirmation, .status-confirmed {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status-exchanging {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  animation: pulse 1.5s infinite;
}

.status-sending {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  animation: pulse 1.5s infinite;
}

.status-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-overdue, .status-refund, .status-refunded {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Rate refresh countdown */
.countdown-ring {
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, 
    rgba(139, 92, 246, 0.1) 0%, 
    rgba(139, 92, 246, 0.2) 50%, 
    rgba(139, 92, 246, 0.1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toggle switch */
.toggle-track {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.toggle-track.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
}

.toggle-thumb {
  background: white;
  transition: all 0.3s ease;
}

/* Transaction history */
.tx-row {
  transition: all 0.2s ease;
}

.tx-row:hover {
  background: rgba(139, 92, 246, 0.1);
}

/* Progress stepper */
.step-dot {
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--accent-purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.step-dot.completed {
  background: var(--success);
}

.step-line {
  transition: all 0.5s ease;
}

.step-line.completed {
  background: var(--success);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .glass-card {
    border-radius: 16px;
    margin: 8px;
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Copy button feedback */
.copy-flash {
  animation: copyFlash 0.3s ease;
}

@keyframes copyFlash {
  0% { background: var(--success); }
  100% { background: transparent; }
}