.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal.hidden { display: none !important; }

.modal-content {
  display: flex;
  background: #fff;
  border-radius: 12px;
  width: 800px;
  max-width: 95%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  overflow: hidden;
}

/* Left panel (info) */
.modal-left {
  flex: 1;
  background: #f9fafc;
  padding: 30px;
  border-right: 1px solid #eee;
}
.modal-left h2 { margin-bottom: 10px; }
.modal-left p { color: #555; margin-bottom: 15px; }
.no-wallet { color: #007bff; text-decoration: none; }
.progress { display: flex; gap: 6px; margin-top: 20px; }
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ccc;
}
.dot.active { background: #007bff; }
.powered { font-size: 0.8rem; color: #777; margin-top: 20px; }

/* Right panel (wallets) */
.modal-right {
  flex: 1.5;
  padding: 30px;
}
.modal-right h3 { margin-bottom: 15px; }
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}
.wallet-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.wallet-btn img { width: 28px; height: 28px; }
.wallet-btn:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

/* Scrollbar styling */
.wallet-grid::-webkit-scrollbar {
  width: 6px;
}
.wallet-grid::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.wallet-grid::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Mobile layout */
@media (max-width: 768px) {
  .modal-content {
    flex-direction: column; /* stack panels */
    width: 95%;
    height: auto;
  }

  /* Wallets go up */
  .modal-right {
    order: 1;
    padding: 20px;
  }

  /* Info goes down */
  .modal-left {
    order: 2;
    border-right: none;
    border-top: 1px solid #eee;
    padding: 20px;
    text-align: center;
  }

  /* Horizontal scroll for wallets */
  .wallet-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
  }

  .wallet-btn {
    flex: 0 0 auto;
    width: 100px;
    height: 90px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    scroll-snap-align: start;
    transition: all 0.2s ease;
  }

  .wallet-btn img {
    width: 32px;
    height: 32px;
  }

  .wallet-btn span {
    font-size: 0.75rem;
  }

  .wallet-btn:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
  }

  /* Hide scrollbar for cleaner look */
  .wallet-grid::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 768px) {
  .wallet-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    position: relative; /* allow pseudo-elements */
  }

  /* Fade gradient overlays */
  .wallet-grid::before,
  .wallet-grid::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none; /* don’t block scrolling */
    z-index: 2;
  }

  .wallet-grid::before {
    left: 0;
    background: linear-gradient(to right, #fff, transparent);
  }

  .wallet-grid::after {
    right: 0;
    background: linear-gradient(to left, #fff, transparent);
  }

  .wallet-btn {
    flex: 0 0 auto;
    width: 100px;
    height: 90px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    scroll-snap-align: start;
    transition: all 0.2s ease;
  }

  .wallet-btn img {
    width: 32px;
    height: 32px;
  }

  .wallet-btn span {
    font-size: 0.75rem;
  }

  .wallet-btn:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
  }

  /* Hide scrollbar for cleaner look */
  .wallet-grid::-webkit-scrollbar {
    display: none;
  }
}

/* Left panel (info) */
.modal-left {
  flex: 1;
  background: #f9fafc;
  padding: 30px;
  border-right: 1px solid #eee;
  color: #222; /* Darker base text color for better contrast */
}

.modal-left h2 {
  margin-bottom: 10px;
  font-size: 1.8rem;
  font-weight: 700;
  color: #111; /* Sharper heading color */
}

.modal-left p {
  color: #333; /* Improved contrast for paragraph text */
  line-height: 1.6;
  margin-bottom: 15px;
}

.no-wallet {
  color: #007bff;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.no-wallet:hover {
  color: #0056b3;
}

.progress {
  display: flex;
  gap: 6px;
  margin-top: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
}

.dot.active {
  background: #007bff;
}

.powered {
  font-size: 0.85rem;
  color: #555; /* Slightly darker for better visibility */
  margin-top: 20px;
}

/* Right panel (wallets) */
.modal-right {
  flex: 1.5;
  padding: 30px;
  background: #fff;
  color: #222;
}

.modal-right h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #111;
}

.wallet-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #222;
}

.wallet-btn:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

.wallet-btn img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}
