/**
 * Jupiter Swap Widget – Styles
 * Clean minimal UI
 */

.jup-swap-form {
  background: var(--dc-bg-soft, #f8f9fa);
  border: 1px solid var(--dc-border, #e2e6ea);
  border-radius: 12px;
  padding: 20px;
}

.jup-tab-row {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--dc-bg-section, #fff);
  border: 1px solid var(--dc-border-light, #eef0f2);
  border-radius: 10px;
}

.jup-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--dc-text-muted, #6c757d);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.jup-tab:hover {
  color: var(--dc-text, #1a1d21);
}

.jup-tab.active {
  background: var(--dc-primary, #0066cc);
  color: #fff;
}

[data-theme="dark"] .jup-tab-row {
  background: var(--dc-bg-elevated, #1a1d21);
  border-color: var(--dc-border);
}

[data-theme="dark"] .jup-tab {
  color: var(--dc-text-muted);
}

[data-theme="dark"] .jup-tab:hover {
  color: var(--dc-text);
}

.jup-wallet-container {
  margin-bottom: 16px;
}

.jup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}

.jup-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.jup-wallet-btn {
  width: 100%;
  background: var(--dc-primary, #0066cc);
  color: #fff;
}

.jup-wallet-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.jup-wallet-btn.jup-connected {
  background: transparent;
  border: 1px solid var(--dc-border);
  color: var(--dc-text-soft, #4a4e54);
}

.jup-wallet-addr {
  font-family: ui-monospace, monospace;
}

.jup-form-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jup-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--dc-border-light, #eef0f2);
  border-radius: 10px;
  padding: 12px 14px;
}

[data-theme="dark"] .jup-input-row {
  background: var(--dc-bg-section);
  border-color: var(--dc-border);
}

.jup-amount-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jup-field-label {
  font-size: 12px;
  color: var(--dc-text-muted, #6c757d);
}

.jup-amount-input {
  font-size: 20px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--dc-text, #1a1d21);
}

.jup-amount-input:focus {
  outline: none;
}

.jup-amount-input::placeholder {
  color: var(--dc-text-muted, #6c757d);
}

.jup-amount-output {
  font-size: 20px;
  font-weight: 600;
  color: var(--dc-text-soft, #4a4e54);
}

.jup-token-wrap {
  flex-shrink: 0;
  position: relative;
}

.jup-token-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jup-token-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--dc-bg-soft, #f8f9fa);
  border: 1px solid var(--dc-border, #e2e6ea);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.jup-token-trigger:hover {
  background: var(--dc-border-light, #eef0f2);
}

.jup-token-trigger:disabled {
  cursor: default;
  opacity: 1;
}

.jup-token-chevron {
  font-size: 10px;
  color: var(--dc-text-muted);
}

.jup-token-dropdown {
  position: absolute;
  z-index: 50;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--dc-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.jup-token-dropdown.open {
  display: block;
}

[data-theme="dark"] .jup-token-dropdown {
  background: var(--dc-bg-section);
}

.jup-token-option {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.jup-token-option:hover {
  background: var(--dc-primary-light, #e6f0fa);
}

.jup-token-option.selected {
  font-weight: 600;
  color: var(--dc-primary);
}

.jup-slippage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--dc-text-muted);
}

.jup-slippage-opts {
  display: flex;
  gap: 6px;
}

.jup-slippage-opts button {
  padding: 6px 12px;
  border: 1px solid var(--dc-border);
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.jup-slippage-opts button.active,
.jup-slippage-opts button:hover {
  background: var(--dc-primary-light);
  border-color: var(--dc-primary);
  color: var(--dc-primary);
}

.jup-quote-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--dc-text-muted);
}

.jup-quote-loading {
  color: var(--dc-primary);
}

.jup-quote-error {
  color: #dc3545;
}

.jup-swap-btn {
  width: 100%;
  min-height: 48px;
  background: var(--dc-primary, #0066cc);
  color: #fff;
  font-size: 16px;
}

.jup-swap-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.jup-status {
  font-size: 14px;
  text-align: center;
}

.jup-status-pending {
  color: var(--dc-primary);
}

.jup-status-success a {
  color: #22c55e;
  text-decoration: none;
}

.jup-status-success a:hover {
  text-decoration: underline;
}

.jup-status-error {
  color: #dc3545;
}

.jup-error {
  color: #dc3545;
  font-size: 14px;
}

/* Mobile-friendly swap form */
@media (max-width: 640px) {
  .jup-swap-form {
    padding: 16px;
  }

  .jup-input-row {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }

  .jup-amount-input,
  .jup-amount-output {
    font-size: 18px;
  }

  .jup-token-trigger {
    min-height: 44px;
    padding: 10px 14px;
    justify-content: center;
  }

  .jup-slippage-opts button {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .jup-swap-btn {
    min-height: 52px;
    font-size: 17px;
  }

  .jup-token-dropdown {
    max-height: min(50vh, 260px);
  }

  .jup-token-option {
    padding: 14px 16px;
    min-height: 44px;
    font-size: 15px;
  }

  /* Dropdown above bottom nav on mobile */
  .jup-token-dropdown.open {
    z-index: 9999;
  }
}
