/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: var(--transition-normal);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.modal-header h3 {
  font-size: 1.25rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 0, 255, 0.1);
  border-color: var(--neon-pink);
  color: var(--neon-pink);
}

/* Cookie Modal */
.cookie-modal {
  max-width: 450px;
}

.cookie-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.cookie-icon {
  font-size: 2rem;
}

.cookie-text {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.cookie-text a {
  color: var(--neon-cyan);
}

.cookie-actions {
  display: flex;
  gap: var(--space-md);
}

.cookie-actions .btn {
  flex: 1;
}

/* Currency Modal */
.currency-modal-content {
  max-width: 400px;
}

.currency-list {
  max-height: 400px;
  overflow-y: auto;
  margin-top: var(--space-md);
}

.currency-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.currency-list-item:hover {
  background: rgba(0, 245, 255, 0.05);
}

.currency-list-item.active {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.3);
}

.currency-list-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.currency-list-info {
  flex: 1;
}

.currency-list-code {
  font-weight: 600;
  color: var(--text-primary);
}

.currency-list-name {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.currency-list-network {
  font-size: 0.75rem;
  color: var(--neon-cyan);
  background: rgba(0, 245, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Order Modal */
.order-modal-content {
  max-width: 500px;
}

.order-step {
  text-align: center;
  padding: var(--space-xl) 0;
}

.order-step-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-glow);
  border: 2px solid rgba(0, 245, 255, 0.3);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 2rem;
}

.order-step-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.order-step-desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.order-details {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.order-detail-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

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

.order-detail-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.order-detail-value {
  font-weight: 600;
  color: var(--text-primary);
}

.order-detail-value.highlight {
  color: var(--neon-cyan);
}

.order-address-box {
  background: var(--bg-tertiary);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.order-address {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-primary);
  word-break: break-all;
}

.order-copy-btn {
  padding: var(--space-sm) var(--space-md);
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: var(--radius-md);
  color: var(--neon-cyan);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.order-copy-btn:hover {
  background: rgba(0, 245, 255, 0.2);
}

.order-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
}

.order-status-badge.awaiting {
  background: rgba(255, 221, 0, 0.1);
  color: var(--neon-yellow);
  border: 1px solid rgba(255, 221, 0, 0.3);
}

.order-status-badge.confirming {
  background: rgba(0, 128, 255, 0.1);
  color: var(--neon-blue);
  border: 1px solid rgba(0, 128, 255, 0.3);
}

.order-status-badge.exchanging {
  background: rgba(184, 41, 221, 0.1);
  color: var(--neon-purple);
  border: 1px solid rgba(184, 41, 221, 0.3);
}

.order-status-badge.sending {
  background: rgba(0, 245, 255, 0.1);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 245, 255, 0.3);
}

.order-status-badge.complete {
  background: rgba(0, 255, 136, 0.1);
  color: var(--neon-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.order-status-badge.failed {
  background: rgba(255, 0, 0, 0.1);
  color: #ff4444;
  border: 1px solid rgba(255, 0, 0, 0.3);
}

.order-progress {
  display: flex;
  justify-content: space-between;
  margin: var(--space-xl) 0;
  position: relative;
}

.order-progress::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--bg-tertiary);
  z-index: 0;
}

.order-progress-bar {
  position: absolute;
  top: 15px;
  left: 10%;
  height: 2px;
  background: var(--gradient-primary);
  z-index: 1;
  transition: var(--transition-slow);
}

.order-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  z-index: 2;
}

.order-progress-dot {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 2px solid rgba(0, 245, 255, 0.3);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition-normal);
}

.order-progress-step.active .order-progress-dot {
  background: var(--gradient-primary);
  border-color: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

.order-progress-step.completed .order-progress-dot {
  background: var(--neon-green);
  border-color: var(--neon-green);
}

.order-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.order-progress-step.active .order-progress-label {
  color: var(--neon-cyan);
}

/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 1500;
}

.chat-toggle {
  width: 56px;
  height: 56px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-full);
  color: var(--bg-primary);
  cursor: pointer;
  box-shadow: var(--shadow-neon-cyan);
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.7);
}

.chat-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 350px;
  height: 450px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition-normal);
}

.chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.chat-header h4 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chat-header h4::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--neon-green);
  border-radius: var(--radius-full);
  animation: pulse 2s infinite;
}

.chat-close {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-close:hover {
  color: var(--neon-pink);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.chat-message {
  max-width: 80%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-message.system {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.2);
  align-self: flex-start;
}

.chat-message.user {
  background: rgba(0, 245, 255, 0.15);
  border: 1px solid rgba(0, 245, 255, 0.3);
  color: var(--text-primary);
  align-self: flex-end;
}

.chat-input-area {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-top: 1px solid rgba(0, 245, 255, 0.1);
  position: relative;
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.chat-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-full);
  padding: var(--space-sm) 40px var(--space-sm) var(--space-md);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--neon-cyan);
}

.chat-emoji-btn {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.chat-emoji-btn:hover {
  background: rgba(0, 245, 255, 0.1);
  transform: scale(1.1);
}

.chat-emoji-picker {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: none;
  grid-template-columns: repeat(8, 32px);
  gap: 4px;
  width: auto;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-emoji-picker.active {
  display: grid;
}

.chat-emoji-picker::-webkit-scrollbar {
  width: 6px;
}

.chat-emoji-picker::-webkit-scrollbar-track {
  background: rgba(0, 245, 255, 0.05);
  border-radius: 3px;
}

.chat-emoji-picker::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 255, 0.3);
  border-radius: 3px;
}

.chat-emoji-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.chat-emoji-item:hover {
  background: rgba(0, 245, 255, 0.1);
  transform: scale(1.2);
}

.chat-send {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-full);
  color: var(--bg-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.chat-send:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-neon-cyan);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 90px;
  right: var(--space-xl);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.toast {
  background: var(--bg-card);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.3s ease;
  min-width: 300px;
}

.toast.success {
  border-color: rgba(0, 255, 136, 0.3);
}

.toast.error {
  border-color: rgba(255, 0, 0, 0.3);
}

.toast.warning {
  border-color: rgba(255, 221, 0, 0.3);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.toast.success .toast-icon {
  background: rgba(0, 255, 136, 0.2);
  color: var(--neon-green);
}

.toast.error .toast-icon {
  background: rgba(255, 0, 0, 0.2);
  color: #ff4444;
}

.toast.warning .toast-icon {
  background: rgba(255, 221, 0, 0.2);
  color: var(--neon-yellow);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 245, 255, 0.2);
  border-top-color: var(--neon-cyan);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

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

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* QR Code Container */
.qr-code {
  width: 200px;
  height: 200px;
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-lg) auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code svg,
.qr-code img {
  max-width: 100%;
  max-height: 100%;
}

/* Slider Captcha */
.slider-captcha {
  margin: var(--space-lg) 0;
  user-select: none;
}

.slider-captcha-img {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.slider-captcha-bg {
  display: block;
  width: 100%;
  height: 100%;
}

.slider-captcha-refresh {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: var(--transition-fast);
  z-index: 10;
}

.slider-captcha-refresh:hover {
  background: rgba(0, 245, 255, 0.3);
  border-color: var(--neon-cyan);
}

.slider-captcha-tips {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 30px;
  line-height: 30px;
  text-align: center;
  color: white;
  font-size: 0.875rem;
  display: none;
  animation: slideUp 0.3s ease;
}

.slider-captcha-tips.success {
  background: rgba(92, 184, 92, 0.8);
}

.slider-captcha-tips.error {
  background: rgba(217, 83, 79, 0.8);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.slider-captcha-bar {
  position: relative;
  background: var(--bg-tertiary);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-md);
  text-align: center;
  overflow: hidden;
}

.slider-captcha-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: opacity 0.3s;
}

.slider-captcha-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.slider-captcha-success-text {
  color: #5cb85c;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.slider-captcha-block {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--bg-card);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s;
}

.slider-captcha-block:hover {
  background: rgba(0, 245, 255, 0.1);
}

.slider-captcha-block:active {
  cursor: grabbing;
}

.slider-captcha-icon {
  color: var(--neon-cyan);
  transition: color 0.3s;
}

.slider-captcha-puzzle {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  transition: left 0.3s;
}

.slider-captcha-puzzle img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}

/* Captcha Modal */
.captcha-modal .modal-content {
  max-width: 360px;
  padding: var(--space-lg);
}

.captcha-modal h3 {
  text-align: center;
  margin-bottom: var(--space-md);
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .chat-widget {
    bottom: var(--space-md);
    right: var(--space-md);
  }
  
  .chat-window {
    width: calc(100vw - var(--space-xl));
    right: calc(-1 * var(--space-md));
  }
  
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
  }
  
  .toast {
    min-width: auto;
  }
  
  .modal-content {
    width: 95%;
    padding: var(--space-md);
  }
}
