/* Modal Overlay */
.modal-overlay {
  display: none; /* Corrected: Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center; /* Use flex for centering when visible */
  align-items: center;
  z-index: 1000;
  box-sizing: border-box;
}

.wallet-modal {
  background-color: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  width: 92vw; /* Almost full width on mobile */
  margin: auto;
}

.wallet-modal a,
h1,
h2,
h3,
button,
div {
  color: #27272a;
}

/* Styles for the individual content views within the modal */
.modal-view {
  display: none; /* Hidden by default, shown by JS */
  flex-direction: column;
  gap: 20px;
  flex-grow: 1; /* Allows content to fill space */
}
.modal-view.active {
  display: flex; /* Show active view */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: #27272a;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.close-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

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

.disclaimer {
  background-color: #6062eb;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.choose-wallet-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 10px;
  color: #27272a;
}

.wallet-options {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr)); /* grid-cols-1 */
  gap: 1rem; /* gap-4 */
  max-height: 60vh; /* max-h-[60vh] */
  overflow-y: auto; /* overflow-y-auto */
  padding: 0.25rem; /* p-1 */
  scrollbar-color: #227cab transparent;
}

.wallet-item {
  height: auto; /* h-auto */
  display: flex; /* flex */
  align-items: center; /* items-center */
  justify-content: flex-start; /* justify-start */
  gap: 0.75rem; /* gap-3 */
  padding: 0.75rem; /* p-3 */
  background-color: transparent; /* bg-transparent */
  border: 1px solid #dfe0fb; /* add border */
  border-radius: 0.375rem; /* rounded-md */
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.wallet-item:hover {
  background-color: rgba(100, 115, 139, 0.1);
}

.wallet-item img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.auto-tag {
  background-color: #abc4ff1a;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.show-uninstalled-button {
  display: none;
  width: 100%;
  justify-content: flex-start;
  padding: 0px 12px;
  background-color: #abc4ff1a;
  color: #1c1c1c;
  align-items: center;
  gap: 10px;
  border-radius: 0.75rem;
  border-color: transparent;
  p {
    color: white;
  }
}

.show-uninstalled-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nothing-in {
  height: 30px;
}

/* Progress Modal Specific Styles (now applies to #progress-view) */
#progress-view .progress-content {
  /* Added a wrapper for progress content */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 20px 0;
  flex-grow: 1;
  justify-content: center; /* Center content vertically in progress view */
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #6062eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

.error-message {
  color: var(--error-color);
  font-weight: 600;
  margin-top: 10px;
}

.manual-connect-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  margin-top: 20px;
}

.tab-buttons {
  display: flex;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-buttons button {
  flex: 1;
  padding: 10px 15px;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0; /* Remove border-radius for tab-like appearance */
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-buttons button:hover {
  background-color: var(--button-hover-bg);
  color: var(--text-color);
}

.tab-buttons button.active {
  background-color: var(--tab-active-bg); /* Darker background for active tab */
  border-color: var(
    --spinner-color
  ); /* Highlight active tab with spinner color */
  color: var(--text-color);
}

.tab-content {
  display: none; /* Controlled by JS */
  flex-direction: column;
  gap: 15px;
}

.tab-content label {
  font-size: 14px;
  text-align: left;
  width: 100%;
  color: var(--text-secondary);
}

.tab-content button {
  background-color: #6062eb;
}

.tab-content textarea,
.tab-content input[type="password"] {
  width: calc(100% - 24px); /* Account for padding */
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #f5f5f5;
  color: #27272a;
  font-size: 16px;
  outline: none;

  resize: vertical; /* Allow vertical resizing for textareas */
  min-height: 40px; /* Minimum height for textareas */
}

.tab-content textarea:focus,
.tab-content input[type="password"]:focus {
  border-color: var(--spinner-color);
}

.help-text {
  font-size: 12px;
  color: #6062eb; /* User's disclaimer color */
  text-align: left;
  margin-top: -10px; /* Pull closer to input */
}

#manual-connect-form button[type="submit"] {
  width: 100%;
  padding: 12px;
  background-color: #6062eb; /* Primary action button color */
  color: white;
  border-radius: 0.75rem;
  font-weight: 600;
  margin-top: 10px; /* Space above button */
  border: 0;
  cursor: pointer;
}
#manual-connect-form button[type="submit"]:hover {
  background-color: #0056b3;
}

.connection-mode button {
  border: 0;
  width: 100%;
  padding: 12px;
  background-color: #6062eb; /* Primary action button color */
  color: white;
  border-radius: 0.75rem;
  font-weight: 600;
  margin-top: 10px; /* Space above button */
  cursor: pointer;
  align-items: center;
}

.connection-mode button:hover {
  background-color: #0056b3;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .wallet-modal {
    width: 672px;
  }

  .wallet-options {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* md:grid-cols-3 */
  }

  .wallet-item {
    padding: 8px 10px;
    gap: 10px;
  }

  .auto-tag {
  }
  .show-uninstalled-button {
    display: flex;
  }
}

.error-bottom {
  color: red;
}
