/**
 * Wallet Icon Styles
 * Styles for wallet buttons with icons
 */

/* Wallet Button Base Styles */
.wallet-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.wallet-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.wallet-button:active {
  transform: translateY(0);
}

.wallet-button.connected {
  background: rgba(107, 123, 255, 0.2);
  border-color: #6b7bff;
}

.wallet-button.loading {
  pointer-events: none;
  opacity: 0.8;
}

.wallet-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button Content Container */
.wallet-button-content {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

/* Wallet Icon */
.wallet-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
}

/* Specific wallet icon adjustments */
[data-wallet-icon="okx"] {
  border-radius: 6px;
}

[data-wallet-icon="phantom"] {
  filter: drop-shadow(0 0 8px rgba(185, 115, 255, 0.3));
}

[data-wallet-icon="slush"] {
  border-radius: 50%;
}

/* Button Text */
.wallet-button-text {
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

/* Loading State */
.wallet-button-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-button-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Token Icons */
.token-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px;
}

.token-icon-small {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: contain;
}

/* Token specific styles */
[data-token-icon="sui"] {
  background: #4DA2FF;
  padding: 4px;
}

[data-token-icon="lofi"] {
  background: #6B7BFF;
  padding: 4px;
}

/* Swap Modal Token Icons */
.swap-token-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.swap-token-selector:hover {
  background: rgba(255, 255, 255, 0.1);
}

.swap-token-selector .token-icon {
  width: 24px;
  height: 24px;
}

.swap-token-selector .token-symbol {
  font-weight: 600;
  font-size: 16px;
}

/* Multiple Wallet Container */
.wallet-selection-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.wallet-button-wrapper {
  width: 100%;
}

.wallet-button-wrapper .wallet-button {
  width: 100%;
  justify-content: flex-start;
}

/* Responsive */
@media (max-width: 768px) {
  .wallet-button {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .wallet-icon {
    width: 20px;
    height: 20px;
  }
  
  .token-icon {
    width: 28px;
    height: 28px;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .wallet-button {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
  }
  
  .wallet-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
  }
}

/* Animation for icon loading */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.wallet-icon,
.token-icon {
  animation: fadeIn 0.3s ease-out;
}

/* Error state for failed image loads */
.wallet-icon.error,
.token-icon.error {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  position: relative;
}

.wallet-icon.error::after,
.token-icon.error::after {
  content: '!';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 0, 0, 0.8);
  font-weight: bold;
  font-size: 14px;
}