:root {
  --black-0: #f4f4f4;
  --black-50: #e8e8e8;
  --black-100: #b6b6b8;
  --black-200: #939395;
  --black-300: #626265;
  --black-400: #252525;
  --black-450: #191a1e;
  --black-500: #141519;
  --black-600: #121317;
  --black-700: #0e0f12;
  --black-800: #0b0c0e;
  --black-900: #08090b;
  --black-1000: #10100f;
  --green-yellow-light: #fcfff3;
  --green-yellow-light_hover: #f5fdd9;
  --green-yellow-light_active: #ebfcb0;
  --green-yellow-normal: #bef401;
  --green-yellow-normal_hover: #abdc01;
  --green-yellow-normal_active: #98c301;
  --green-yellow-dark: #8fb701;
  --green-yellow-dark_hover: #729201;
  --green-yellow-dark_active: #556e00;
  --green-yellow-darker: #647914;
  --green-yellow-darker_hover: #303a09;
  --green-yellow-darker_active: #242c07;
}

body.modal-open {
  overflow: hidden;
}

#wallet-info {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  background-color: var(--black-500);
  /* border: 1px solid var(--green-yellow-normal); */
  transition: all 0.3s ease;
  width: 200px;
  min-height: 32px;
}

#wallet-info.hidden {
  display: flex !important;
  opacity: 0.5;
}

#wallet-info.skeleton {
  opacity: 0.5;
}

#wallet-info.skeleton #wallet-info-icon {
  background-color: var(--black-400);
  border-radius: 3px;
  width: 18px;
  height: 18px;
  object-fit: none;
  opacity: 0;
  position: relative;
}

#wallet-info.skeleton #wallet-info-icon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--black-400);
  border-radius: 3px;
}

#wallet-info.skeleton #wallet-info-address {
  background-color: var(--black-400);
  border-radius: 2px;
  color: transparent;
  width: 80px;
  height: 12px;
}

#wallet-info.skeleton #wallet-disconnect {
  opacity: 0;
}

#wallet-info-icon {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  /* object-fit: cover; */
  object-fit: contain;
}

#wallet-info-address {
  font-size: 12px;
  color: var(--black-200);
  font-family: "Unbounded", sans-serif;
  font-weight: 400;
}

#wallet-disconnect {
  margin-left: 4px;
  padding: 2px;
  border-radius: 3px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#wallet-disconnect:hover {
  background-color: var(--black-400);
}

#wallet-disconnect svg {
  width: 12px;
  height: 12px;
  color: var(--black-200);
}

.wallet-connection-section {
  width: 100%;
  max-width: 600px;
  margin: 40px auto 0;
  padding: 0 20px;
}

.wallet-category {
  margin-bottom: 32px;
}

.wallet-category-title {
  font-family: "Wix Madefor Display", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--green-yellow-normal);
  margin-bottom: 16px;
  text-align: left;
}

.wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.wallet-grid .wallet-button {
  grid-column: auto;
}

.wallet-grid .wallet-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.wallet-grid .wallet-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--green-yellow-normal);
  transform: translateY(-2px);
}

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

.wallet-grid .wallet-button.selected {
  background: rgba(190, 244, 1, 0.1);
  border-color: var(--green-yellow-normal);
}

.wallet-grid .wallet-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
  /* object-fit: contain; */
}

.wallet-grid .wallet-name {
  font-family: "Roboto", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  line-height: 1.2;
}

.wallet-button {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.wallet-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--green-yellow-normal, #bef401);
  transform: translateY(-2px);
}

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

.wallet-button.connecting {
  opacity: 0.7;
  cursor: not-allowed;
}

.wallet-button.connected {
  background: rgba(190, 244, 1, 0.1);
  border-color: var(--green-yellow-normal);
}

.wallet-icon {
  width: 48px;
  height: 48px;
  margin-right: 16px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: contain;
}

/* Специальные правила для отдельных иконок, если нужно */
.wallet-button[data-wallet="trustwallet"] .wallet-icon {
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.wallet-name {
  font-family: "Wix Madefor Display", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  display: block;
}

.network-selection {
  margin-bottom: 32px;
}

.wallet-selection {
  margin-bottom: 32px;
}

.wallet-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--green-yellow-normal, #bef401);
  font-family: "Wix Madefor Display", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: absolute;
  left: 0;
}

.back-button:hover {
  background: rgba(190, 244, 1, 0.1);
  transform: translateX(-2px);
}

.back-button svg {
  transition: transform 0.3s ease;
}

.back-button:hover svg {
  transform: translateX(-2px);
}

.wallet-title {
  font-family: "Wix Madefor Display", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--green-yellow-normal);
  text-align: center;
  flex: 1;
  margin: 0;
}

.network-title {
  font-family: "Wix Madefor Display", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--green-yellow-normal);
  margin-bottom: 16px;
  text-align: center;
}

.network-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}

.network-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.network-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--green-yellow-normal);
  /* transform: translateY(-2px); */
}

.network-button.selected {
  background: rgba(190, 244, 1, 0.1);
  border-color: var(--green-yellow-normal);
}

.network-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  border-radius: 50%;
}

.network-name {
  font-family: "Roboto", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  line-height: 1.2;
}

/* Connection Status */
.connection-status {
  margin-top: 32px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  text-align: center;
}

.status-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.status-text {
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  color: #ffffff;
  font-weight: 500;
}

.error-back-button {
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--green-yellow-normal);
  color: var(--black-500);
  border: none;
  border-radius: 8px;
  font-family: "Wix Madefor Display", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.error-back-button:hover {
  background: var(--green-yellow-normal_hover);
  transform: translateY(-1px);
}

.error-back-button:active {
  transform: translateY(0);
  background: var(--green-yellow-normal_active);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.network-grid::-webkit-scrollbar {
  width: 6px;
}

.network-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.network-grid::-webkit-scrollbar-thumb {
  background: var(--green-yellow-normal);
  border-radius: 3px;
}

.network-grid::-webkit-scrollbar-thumb:hover {
  background: var(--green-yellow-normal_hover);
}

@media (max-width: 768px) {
  .wallet-connection-section {
    max-width: 100%;
    margin: 32px 0 0;
  }

  #wallet-info {
    display: flex !important;
    /* position: fixed; */
    top: 8px;
    right: 8px;
    z-index: 50;
    width: 160px;
    font-size: 10px;
    padding: 4px 6px;
  }

  #wallet-info-icon {
    width: 16px;
    height: 16px;
  }

  #wallet-info.skeleton #wallet-info-icon {
    background-color: var(--black-400);
    border-radius: 3px;
    width: 16px;
    height: 16px;
    object-fit: none;
    /* Скрываем изображение и показываем только фон */
    opacity: 0;
    position: relative;
  }

  #wallet-info.skeleton #wallet-info-icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--black-400);
    border-radius: 3px;
  }

  #wallet-info-address {
    font-size: 10px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #wallet-disconnect {
    padding: 2px;
  }

  #wallet-disconnect svg {
    width: 10px;
    height: 10px;
  }
}

.wallet-category-title {
  font-size: 18px;
  text-align: center;
}

.wallet-grid {
  /* grid-template-columns: 1fr; */
  gap: 12px;
}

.wallet-button {
  padding: 12px 16px;
}

.wallet-icon {
  width: 40px;
  height: 40px;
  margin-right: 12px;
}

.wallet-name {
  font-size: 14px;
}

.wallet-description {
  font-size: 11px;
}

.network-grid {
  /* grid-template-columns: repeat(2, 1fr); */
  gap: 10px;
}

.network-button {
  padding: 12px 8px;
}

.network-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
}

.network-name {
  font-size: 11px;
}

.network-title {
  font-size: 18px;
}

.back-button {
  font-size: 12px;
  padding: 6px 8px;
}

.wallet-title {
  font-size: 18px;
}

/* Animation for wallet buttons */
.wallet-button {
  position: relative;
  overflow: hidden;
}

.wallet-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(190, 244, 1, 0.1), transparent);
  transition: left 0.5s;
}

.wallet-button:hover::before {
  left: 100%;
}

/* Pulse animation for connecting state */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(190, 244, 1, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(190, 244, 1, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(190, 244, 1, 0);
  }
}

.wallet-button.connecting {
  animation: pulse 2s infinite;
}

@media (max-width: 768px) {
  .network-grid {
    grid-template-columns: 1fr 1fr;
  }
  .wallet-connection-section {
    padding: 0;
    margin: 0;
  }
}

.wallet-dropdown {
  position: relative;
}

.wallet-address-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 8px 8px 12px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid var(--green-yellow-normal);
}

.wallet-address-container #wallet-info-icon {
  margin-bottom: 0;
}

.wallet-address-container .wallet-address {
  margin-left: 10px;
}

.network-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-network span {
  margin-bottom: 0 !important;
}

.wallet-address-container:hover {
  background: rgba(255, 255, 255, 0.15);
}

.network-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.wallet-address {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  flex: 1;
}

.wallet-address-text {
  font-family: "Unbounded", sans-serif;
  font-weight: 400;
}

.copy-icon {
  margin-left: 6px;
  opacity: 0.7;
  transition: opacity 0.2s;
  cursor: pointer;
}

.wallet-address:hover .copy-icon {
  opacity: 1;
}

.copy-success-icon {
  margin-left: 6px;
  opacity: 1;
  transition: opacity 0.2s;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #fff;
  padding: 0;
  margin-left: 6px;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
}

.dropdown-toggle:hover {
  opacity: 1;
}

.wallet-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1a1a1a;
  border-radius: 8px;
  width: 220px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-network {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-network span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  display: block;
  margin-bottom: 6px;
  font-family: "Roboto", sans-serif;
}

.network-badge {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  color: #fff;
  text-transform: capitalize;
}

.network-icon-sm {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.withdraw-section {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}

.withdraw-btn {
  width: 100%;
  padding: 8px 12px;
  background: #3b82f6;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
}

.withdraw-btn:hover {
  background: #2563eb;
}

.withdraw-btn:disabled {
  background: #3b82f680;
  cursor: not-allowed;
}

.withdraw-error {
  margin-top: 8px;
  padding: 8px;
  background: rgba(239, 68, 68, 0.2);
  border-left: 2px solid #ef4444;
  border-radius: 4px;
  font-size: 12px;
  color: #ef4444;
  font-family: "Roboto", sans-serif;
}

.disconnect-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 0, 0, 0.1);
  color: #ff5555;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
}

.disconnect-btn svg {
  margin-right: 8px;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .wallet-dropdown {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
  }

  .wallet-address-container {
    padding: 4px 6px;
    max-height: 32px;
    transform: scale(0.85);
    transform-origin: right center;
  }

  .wallet-address-text {
    font-size: 11px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .network-icon {
    width: 14px;
    height: 14px;
  }

  .wallet-dropdown-menu {
    right: 0;
    top: 32px;
    min-width: 180px;
    width: 200px;
  }

  .dropdown-toggle svg {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 360px) {
  .wallet-address-text {
    display: none;
  }
}
