:root {
  --background-color: #0a0a0a;
  --surface-color: #1a1a1a;
  --primary-color: #6366f1;
  --primary-hover: #7c3aed;
  --text-color: #fff;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body::-webkit-scrollbar {
  display: none;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--background-color) 0%, #1e1b4b 100%);
  color: var(--text-color);
  overflow-y: scroll;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  background: linear-gradient(135deg, var(--background-color) 0%, #1e1b4b 100%);
}

.orb {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: orbFloat 20s ease-in-out infinite;
  pointer-events: auto;
  transition: transform 0.1s ease-out;
}

.background .orb:nth-child(1) {
  top: 15%;
  left: 10%;
  animation-duration: 22s;
}
.background .orb:nth-child(2) {
  top: 40%;
  left: 75%;
  width: 70px;
  height: 70px;
  animation-duration: 18s;
}
.background .orb:nth-child(3) {
  top: 65%;
  left: 30%;
  animation-duration: 25s;
}
.background .orb:nth-child(4) {
  top: 30%;
  left: 50%;
  width: 60px;
  height: 60px;
  animation-duration: 20s;
}
.background .orb:nth-child(5) {
  top: 80%;
  left: 20%;
  animation-duration: 24s;
}

@keyframes orbFloat {
  0%   { transform: translateY(0) scale(1); opacity: 0.7; }
  50%  { transform: translateY(-60vh) scale(1.5); opacity: 0.3; }
  100% { transform: translateY(0) scale(1); opacity: 0.7; }
}

.orb:active {
  transform: scale(2.2);
  opacity: 1;
}

header {
  position: relative;
  width: 100%;
  padding: 16px 20px;
  background: rgba(26, 26, 26, 0.9);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 20px;
  top: 0;
  left: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.header-logo img:hover {
  transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
  .orb, .notification, .container, button, .token-select, header,
  .info-box, .switch-btn, .amount-container .max-text {
    transition: none !important;
    animation: none !important;
  }
}

.desktop-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.4);
  border-color: var(--primary-color);
}

.nav-item svg {
  width: 16px;
  height: 16px;
}

/* Navigation Dropdown Styles */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.dropdown-arrow {
  transition: transform 0.3s ease;
  margin-left: 4px;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  min-width: 160px;
  backdrop-filter: blur(10px);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.active .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 4px;
}

.nav-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

.nav-dropdown-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-color);
}

.nav-dropdown-item svg {
  width: 14px;
  height: 14px;
}

/* Mobile Footer Dropdown Styles */
.mobile-footer-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mobile-footer-trigger {
  cursor: pointer;
}

.mobile-footer-dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px);
  transition: all 0.3s ease;
  z-index: 1000;
  min-width: 150px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
}

.mobile-footer-dropdown:hover .mobile-footer-dropdown-menu,
.mobile-footer-dropdown.active .mobile-footer-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mobile-footer-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 4px;
}

.mobile-footer-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

.mobile-footer-dropdown-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-color);
}

.mobile-footer-dropdown-item svg {
  width: 14px;
  height: 14px;
}

#connectWallet {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: 12px;
    position : fixed;
    top: 12px;
   right: 12px;
    padding: 0.5em 1em;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    max-width: 160px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 6px;
}

#connectWallet:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

#connectWallet svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.container {
  margin: 12px auto;
  width: 90%;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(26, 26, 26, 0.98) 100%);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(99, 102, 241, 0.1);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 10;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapsible-content.open {
  max-height: 500px;
}

.collapsible-icon {
  transition: transform 0.3s ease;
}

.collapsible-icon.open {
  transform: rotate(180deg);
}

.swap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.swap-header h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-button, .notification-button, .refresh-button {
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.2s ease;
  box-shadow: none;
  padding: 0;
  position: relative;
}

.settings-button:hover, .notification-button:hover, .refresh-button:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  transform: none;
  box-shadow: none;
}

.refresh-button {
  overflow: hidden;
}

.refresh-button:hover #refreshIcon {
  transform: rotate(180deg);
}

.refresh-button.refreshing #refreshIcon {
  animation: refreshSpin 0.8s ease-in-out;
}

.refresh-progress {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.refresh-progress.active {
  opacity: 1;
}

.refresh-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.refresh-progress-bg {
  fill: none;
  stroke: rgba(99, 102, 241, 0.1);
  stroke-width: 3;
}

.refresh-progress-fill {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 100.53;
  transition: stroke-dashoffset 0.1s linear;
}

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

.notification-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--error-color);
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 2px;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0 20px;
  width: 100%;
}

.swap-field {
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.swap-field:hover {
  background: rgba(51, 65, 85, 0.35);
  border-color: rgba(99, 102, 241, 0.15);
}

.swap-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.token-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.token-select {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  background: rgba(51, 65, 85, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  min-width: 140px;
  flex-shrink: 0;
}

.token-select:hover {
  background: rgba(51, 65, 85, 0.6);
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.1);
}

.token-select:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

.token-select img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: contain;
}

.token-select span {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
  flex: 1;
  white-space: nowrap;
}

.token-select .dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

#fromAmount {
  background: transparent;
  border: none;
  text-align: right;
  font-size: 24px;
  font-weight: 500;
  color: var(--text-color);
  width: 100%;
  outline: none;
  padding: 0;
}

.token-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 5px;
}

.max-button {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.max-button:hover {
  background: rgba(99, 102, 241, 0.2);
}

.switch-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -8px 0;
  position: relative;
  z-index: 2;
  height: 16px;
}

.switch-btn {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.switch-btn:hover {
  background: rgba(51, 65, 85, 0.4);
  transform: rotate(180deg);
  border-color: var(--primary-color);
}

.switch-btn svg {
  color: var(--primary-color);
}

.output-amount {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-color);
  text-align: right;
}

.swap-button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.swap-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.swap-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

.swap-button:active {
  transform: scale(0.98);
}

.swap-button:not(:disabled):hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.collapsible-container {
  margin-top: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(51, 65, 85, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.collapsible-header:hover {
  background: rgba(51, 65, 85, 0.3);
}

.collapsible-header span {
  font-weight: 500;
  color: var(--text-color);
}

.collapsible-icon {
  transition: transform 0.3s ease;
}

.collapsible-icon.open {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: var(--surface-color);
}

.collapsible-content.open {
  max-height: 500px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-muted);
}

.info-row:last-child {
  border-bottom: none;
}

.settings-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.settings-modal-content {
  background: var(--surface-color);
  margin: 5% auto;
  width: 75%;
  max-width: 360px;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: modalFadeIn 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.settings-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
}

.close-settings {
  background: transparent;
  border: none;
  font-size: 18px; 
  padding: 4px 6px; 
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  width: 30px; 
  height: 30px;
}

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

.settings-body {
  padding: 12px 16px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) rgba(51, 65, 85, 0.2);
  -webkit-overflow-scrolling: touch;
}

.settings-body::-webkit-scrollbar {
  width: 6px;
}

.settings-body::-webkit-scrollbar-track {
  background: rgba(51, 65, 85, 0.2);
  border-radius: 8px;
}

.settings-body::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.1);
}

.settings-body::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-hover);
}

.settings-section {
  margin-bottom: 16px;
}

.settings-section h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
}

.slippage-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.slippage-option {
  background: rgba(51, 65, 85, 0.4);
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.slippage-option.active {
  background: var(--primary-color);
  color: white;
}

.custom-slippage {
  width: 80px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  text-align: center;
  background: rgba(51, 65, 85, 0.4);
  color: var(--text-color);
}

.percentage-symbol {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 5px;
}

.deadline-input {
  display: flex;
  align-items: center;
  position: relative;
}

.deadline-input input {
  width: 100px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  text-align: center;
  padding-right: 45px;
  background: rgba(51, 65, 85, 0.4);
  color: var(--text-color);
}

.deadline-unit {
  position: absolute;
  right: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.toggle-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-right: 10px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

.toggle-description {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  margin-left: 60px;
  line-height: 1.4;
  word-wrap: break-word;
  padding-right: 10px;
}

.routing-mode-container {
  margin-bottom: 10px;
}

.routing-mode-select {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-color);
  background: rgba(51, 65, 85, 0.4);
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 12px auto;
}

.routing-mode-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(51, 65, 85, 0.6);
}

.settings-section .toggle-description {
  margin-left: 0;
}

.toggle-description:has-text("⚠️") {
  color: var(--warning-color);
  font-weight: 500;
}

.settings-section .toggle-description {
  margin-bottom: 10px;
}

.settings-section:last-child .toggle-description {
  margin-bottom: 0;
}

.notification-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.notification-modal-content {
  background: var(--surface-color);
  margin: 5% auto;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: modalFadeIn 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.notification-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-color);
}

.close-notification {
  background: transparent;
  border: none;
  font-size: 18px;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  width: 30px;
  height: 30px;
}

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

.notification-body {
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
  flex: 1;
}

.notification-body::-webkit-scrollbar {
  width: 6px;
}

.notification-body::-webkit-scrollbar-track {
  background: rgba(51, 65, 85, 0.2);
  border-radius: 8px;
}

.notification-body::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 8px;
}

#transactionList {
  max-height: 240px;
  overflow-y: auto;
}

#transactionList::-webkit-scrollbar {
  width: 6px;
}

#transactionList::-webkit-scrollbar-track {
  background: rgba(51, 65, 85, 0.2);
  border-radius: 8px;
}

#transactionList::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 8px;
}

.transaction-item {
  background: rgba(51, 65, 85, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.transaction-item:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary-color);
}

.transaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.transaction-tokens {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-color);
}

.transaction-tokens img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.transaction-arrow {
  color: var(--primary-color);
  margin: 0 4px;
}

.transaction-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.transaction-status.confirmed {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-color);
}

.transaction-status.failed {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error-color);
}

.transaction-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}

.transaction-hash {
  font-family: monospace;
  font-size: 11px;
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.transaction-mode {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-color);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}

.no-transactions {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

.clear-notifications {
  width: 100%;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error-color);
  border-radius: 8px;
  color: var(--error-color);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.clear-notifications:hover {
  background: rgba(239, 68, 68, 0.2);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#confirmationModalOverlay {
  display: flex;
}

.modal-container {
  background: var(--surface-color);
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
}

.modal-container p {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 16px;
}

.modal-container input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: rgba(51, 65, 85, 0.4);
  color: var(--text-color);
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-actions button:first-child {
  background: var(--primary-color);
  color: white;
  border: none;
}

.modal-actions button:last-child {
  background: rgba(51, 65, 85, 0.4);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.container::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  z-index: -1;
  opacity: 0.15;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.swap-section {
  display: flex;
  flex-direction: column;
}

.swap-section h3, .liquidity-section h3 {
  font-size: 22px;
  margin-bottom: 15px;
  color: var(--text-color);
  position: relative;
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.swap-section h3::after, .liquidity-section h3::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 40%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  border-radius: 2px;
}

label {
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-color);
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.token-select img,
.fallback-logo {
  width: 28px;
  height: 28px;
  margin-right: 12px;
  vertical-align: middle;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.scrollable-tokens {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-top: 10px;
  display: none;
  background: var(--surface-color);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  z-index: 1000;
  position: absolute;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) rgba(51, 65, 85, 0.2);
}

.scrollable-tokens::-webkit-scrollbar {
  width: 6px;
}

.scrollable-tokens::-webkit-scrollbar-track {
  background: rgba(51, 65, 85, 0.2);
  border-radius: 8px;
}

.scrollable-tokens::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 8px;
}

.token-search {
  width: 96%;
  padding: 12px;
  margin: 2%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
  transition: border-color 0.3s;
  background: rgba(51, 65, 85, 0.4);
  color: var(--text-color);
}

.token-search:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(51, 65, 85, 0.5);
}

.token-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--surface-color);
}

.token-item:hover {
  background-color: rgba(99, 102, 241, 0.1);
  transform: translateX(3px);
}

.token-details {
  display: flex;
  flex-direction: column;
  margin-left: 12px;
  flex: 1;
}

.token-symbol {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-color);
}

.token-address {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: monospace;
}

.token-item:last-child {
  border-bottom: none;
}

.token-item img {
  width: 28px;
  height: 28px;
  margin-right: 12px;
  object-fit: contain;
  border-radius: 50%;
}

.amount-container {
  position: relative;
  width: 100%;
}

.amount-container input[type="number"] {
  width: 100%;
  padding: 16px;
  padding-right: 48px;
  margin-top: 8px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  background: rgba(51, 65, 85, 0.4);
  color: var(--text-color);
}

.amount-container input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.amount-container .max-text {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.amount-container .max-text:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-50%) scale(1.05);
}

button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  outline: none;
}

button:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5), 0 4px 15px rgba(99, 102, 241, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

button.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
  overflow: hidden;
}

button.loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 1.5s infinite;
}

button.loading::after {
  content: "";
  position: absolute;
  top: calc(50% - 9px);
  left: calc(50% - 9px);
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--border-color) !important;
  transform: none !important;
  box-shadow: none !important;
}

.switch-btn:after {
  content: "⇅";
  font-size: 24px;
  color: var(--primary-color);
}

.info-box {
  background: rgba(26, 26, 26, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-color);
  padding: 20px;
  margin-bottom: 16px;
  font-size: 15px;
  margin-top: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.info-box h4 {
  margin-bottom: 10px;
  color: var(--text-color);
  font-size: 17px;
}

.info-box div {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.info-box div:last-child {
  margin-bottom: 0;
}

.info-box span {
  font-weight: 600;
  color: var(--text-color);
}

.info-box .unit-price {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#notifications {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 350px;
}

.notification {
  background: var(--surface-color);
  color: var(--text-color);
  padding: 12px 16px;
  border-left: 4px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: notifIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  position: relative;
  min-width: 260px;
  max-width: 350px;
  font-weight: 500;
  word-wrap: break-word;
  line-height: 1.5;
  border: 1px solid var(--border-color);
  font-size: 14px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification:hover {
  transform: translateX(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.notification-message {
  flex: 1;
}

.notification-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0.6;
  transition: all 0.2s ease;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.notification-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.notification.success {
  border-left-color: var(--success-color);
}

.notification.error {
  border-left-color: var(--error-color);
}

.notification.info {
  border-left-color: var(--primary-color);
}

@keyframes notifIn {
  0% {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.notification.hide {
  animation: notifOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes notifOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(120%) scale(0.9);
  }
}

.balance-display {
  font-size: 14px;
  margin-top: 6px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.balance-display span {
  font-weight: 600;
  color: var(--text-color);
}

.btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  margin-right: 8px;
  max-width: 190px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.token-pair>div>label {
  display: block;
  margin-bottom: 8px;
}

.dex-pool {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(51, 65, 85, 0.2);
}

.dex-pool:hover {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.08);
}

.dex-pool.selected {
  background-color: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-color);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.15);
}

.dex-pool strong {
  color: var(--text-color);
  display: block;
  margin-bottom: 5px;
  font-size: 16px;
}

#manualDexSelect {
  margin-top: 15px;
  transition: all 0.3s ease;
}

#manualDexToggle {
  width: auto;
  padding: 8px 16px;
  margin-top: 15px;
  font-size: 14px;
  background: rgba(51, 65, 85, 0.4);
  color: var(--text-color);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#manualDexToggle:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-color);
}

#dexDropdown {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--surface-color);
  font-size: 15px;
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 12px auto;
  cursor: pointer;
  transition: all 0.3s ease;
}

#dexDropdown:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

#dexPoolsContainer {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-color);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.03);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--surface-color);
  margin: 8% auto;
  padding: 28px;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 450px;
  max-height: 90vh;
  border-radius: 16px;
  text-align: left;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (max-width: 768px) {
  .modal-content {
    margin: 25% auto;
  }
}

.close {
  color: var(--text-muted);
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover,
.close:focus {
  color: var(--text-color);
  text-decoration: none;
}

.dex-link {
  display: block;
  margin: 20px 0;
  font-size: 20px;
  text-decoration: none;
  color: var(--primary-color);
  transition: all 0.2s;
  padding: 10px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
}

.dex-link:hover {
  text-decoration: none;
  background: rgba(99, 102, 241, 0.2);
  transform: translateX(5px);
}

#confirmationModalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

#confirmationModal {
  background-color: var(--surface-color);
  padding: 25px;
  border-radius: 16px;
  width: 90%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
  animation: modalBounceIn 0.5s;
  border: 1px solid var(--border-color);
}

@keyframes modalBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  70% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

#liquidityConfirmationModal {
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#confirmationModal p {
  margin-bottom: 20px;
  font-size: 17px;
  color: var(--text-color);
  line-height: 1.5;
}

#confirmationModal input {
  width: 90%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  background: rgba(51, 65, 85, 0.4);
  color: var(--text-color);
}

#confirmationModal input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

@media screen and (max-width: 768px) {
  .container {
    padding: 18px;
    width: 100%;
    margin: 30px auto 80px;
    max-width: 95%;
    border-radius: 15px;
  }

  .header-logo img {
    width: 32px;
    height: 32px;
  }

  .desktop-nav {
    display: none;
  }

  #connectWallet {
    padding: 8px 12px;
    font-size: 0.85rem;
    max-width: 120px;
    gap: 6px;
  }

  #connectWallet svg {
    width: 14px;
    height: 14px;
  }

  .mobile-footer {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
    z-index: 1000;
  }

  .token-item img, .token-select img {
    width: 24px;
    height: 24px;
  }

  .token-select span {
    font-size: 14px;
  }

  .notification {
    min-width: auto;
    max-width: 90%;
    font-size: 13px;
    padding: 10px 12px;
    gap: 8px;
  }

  .notification-close {
    width: 20px;
    height: 20px;
    font-size: 18px;
  }

  .token-pair {
    flex-direction: column;
    gap: 15px;
  }

  .amount-container input[type="number"] {
    padding: 12px;
    font-size: 15px;
  }

  button {
    padding: 12px;
    font-size: 15px;
  }

  .scrollable-tokens {
    max-height: 300px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    z-index: 200;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  }

  .info-box {
    padding: 15px;
    font-size: 14px;
  }

  label {
    font-size: 0.9rem;
  }

  #routerSelect, #dexDropdown {
    font-size: 14px;
    padding: 10px;
  }
}

.mobile-footer {
  display: none;
}

@media screen and (max-width: 768px) {
  .mobile-footer {
    display: block !important;
  }
}

@media screen and (min-width: 769px) {
  .mobile-footer {
    display: none !important;
  }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 85%;
  }

  .token-pair {
    flex-direction: row;
  }
}

@media screen and (min-width: 1025px) {
  .container {
    max-width: 600px;
    padding: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .container:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 45px rgba(0,0,0,0.4);
  }

  .token-select:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.08);
  }

  button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  }

  #notifications {
    top: 30px;
    right: 30px;
  }
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.loading-spinner div {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

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

/* Smooth input focus transitions */
input[type="number"]:focus,
input[type="text"]:focus,
.token-search:focus,
.custom-slippage:focus,
.deadline-input input:focus {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Better button press feedback */
button:not(:disabled):active,
.token-select:active,
.settings-button:active,
.notification-button:active,
.refresh-button:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Hide old token list dropdowns - using modern modal instead */
.scrollable-tokens {
  display: none !important;
}

/* Notification Modal Close Button Fix */
#closeAddLpNotification {
  position: relative;
  z-index: 10000 !important;
  font-size: 28px !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  line-height: 1 !important;
  font-weight: 300 !important;
  transition: color 0.2s ease, transform 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  display: inline-block !important;
  min-width: 24px;
  text-align: center;
}

#closeAddLpNotification:hover {
  color: #ef4444 !important;
  transform: scale(1.1);
}

#closeAddLpNotification:active {
  transform: scale(0.95);
}

/* Ensure modal header has proper layout */
#addLpNotificationModal > div > div:first-child {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  position: relative;
  z-index: 100;
}

#refreshDataButton {
  opacity: 0.7;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-left: 10px;
}

#refreshDataButton:hover {
  opacity: 1;
  transform: rotate(45deg);
  background: rgba(99, 102, 241, 0.25);
}

#refreshDataButton:active {
  transform: rotate(180deg);
}

.refresh-button {
  padding: 6px;
  border-radius: 50%;
}

.skeleton-loader {
  background: linear-gradient(90deg, rgba(51, 65, 85, 0.2) 25%, rgba(99, 102, 241, 0.15) 50%, rgba(51, 65, 85, 0.2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 8px;
  height: 20px;
  width: 100%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* LP Page Notification Containers */
#lpNotifications,
#removeLpNotifications {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
  max-height: calc(2 * (60px + 10px)); /* Height for 2 notifications + gap */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

#lpNotifications::-webkit-scrollbar,
#removeLpNotifications::-webkit-scrollbar {
  width: 6px;
}

#lpNotifications::-webkit-scrollbar-track,
#removeLpNotifications::-webkit-scrollbar-track {
  background: transparent;
}

#lpNotifications::-webkit-scrollbar-thumb,
#removeLpNotifications::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 3px;
}

#lpNotifications .notification,
#removeLpNotifications .notification {
  background: var(--surface-color);
  color: var(--text-color);
  padding: 12px 16px;
  border-left: 4px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: notifIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  position: relative;
  min-width: 260px;
  max-width: 350px;
  font-weight: 500;
  word-wrap: break-word;
  line-height: 1.5;
  border: 1px solid var(--border-color);
  font-size: 14px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#lpNotifications .notification:hover,
#removeLpNotifications .notification:hover {
  transform: translateX(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  #notifications {
    top: 70px;
    right: 10px;
    left: 10px;
    bottom: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-width: calc(100% - 20px);
  }

  .notification {
    transform: translateX(100%);
    animation: notifIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    max-width: 100%;
    min-width: auto;
    border-radius: 12px;
    margin: 0;
    font-size: 13px;
    padding: 10px 36px 10px 14px;
  }

  .notification::after {
    right: 10px;
    font-size: 18px;
  }

  .notification-modal-content {
    margin: 5% auto;
    width: 95%;
    max-width: 95vw;
    max-height: 85vh;
    border-radius: 15px;
  }

  .notification-body {
    padding: 15px;
    max-height: 280px;
  }

  #transactionList {
    max-height: 220px;
  }

  .notification-header {
    padding: 15px;
    flex-shrink: 0;
  }

  .notification-header h2 {
    font-size: 18px;
  }

  .transaction-item {
    padding: 12px;
    margin-bottom: 10px;
  }

  .transaction-tokens {
    flex-wrap: wrap;
    gap: 4px;
  }

  .transaction-tokens img {
    width: 18px;
    height: 18px;
  }

  .transaction-tokens span {
    font-size: 14px;
  }

  .transaction-status {
    font-size: 11px;
    padding: 3px 6px;
  }

  .transaction-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 11px;
  }

  .transaction-mode {
    font-size: 9px;
    padding: 1px 4px;
  }

  .clear-notifications {
    padding: 8px;
    font-size: 14px;
  }

  /* LP Page Notifications Mobile */
  #lpNotifications,
  #removeLpNotifications {
    top: 70px;
    right: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    max-height: calc(2 * (50px + 8px));
  }

  #lpNotifications .notification,
  #removeLpNotifications .notification {
    min-width: auto;
    max-width: 100%;
    font-size: 13px;
    padding: 10px 12px;
  }
}

#routerSelect {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--surface-color);
  font-size: 15px;
  color: var(--text-color);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 15px top 50%;
  background-size: 12px auto;
  width: 100%;
  max-width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#routerSelect:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.mobile-footer {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  padding: 12px 0;
  z-index: 1000;
}

.mobile-footer-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.mobile-footer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-width: 60px;
  text-align: center;
}

.mobile-footer-item:hover {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

.mobile-footer-item.active {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.2);
}

.mobile-footer-item svg {
  width: 20px;
  height: 20px;
}

.mobile-footer-item span {
  font-size: 10px;
  font-weight: 500;
}

#estimatedOutput {
  color: var(--text-color);
}

div#fromTokenList::-webkit-scrollbar {
  display: none;
}

.token-select {
  overflow-y: hidden;         
  -ms-overflow-style: none;    
  scrollbar-width: none;
}

.token-select::-webkit-scrollbar {
  display: none;           
}

.token-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.token-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.token-modal {
  background-color: var(--surface-color);
  width: 90%;
  max-width: 450px;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin: 0;
  max-height: 80vh;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  border: 1px solid var(--border-color);
}

.token-modal-overlay.show .token-modal {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.token-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.token-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
}

.token-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: color 0.2s;
  padding: 0;
}

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

.token-modal-search {
  padding: 12px 20px;
  position: relative;
}

.token-modal-search-wrapper {
  position: relative;
}

.token-modal-search input {
  width: 100%;
  padding: 14px 20px 14px 42px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  color: var(--text-color);
  background: rgba(51, 65, 85, 0.4);
  transition: all 0.3s;
}

.token-modal-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(51, 65, 85, 0.6);
}

.token-modal-search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.token-modal-body {
  padding: 0 20px 20px;
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.token-modal-body::-webkit-scrollbar {
  width: 6px;
}

.token-modal-body::-webkit-scrollbar-track {
  background: rgba(51, 65, 85, 0.2);
  border-radius: 8px;
}

.token-modal-body::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 8px;
}

.token-list-section {
  margin-bottom: 15px;
}

.token-list-header {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 10px 0;
  padding: 0 10px;
}

.token-modal-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.token-modal-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.token-modal-item:hover {
  background: rgba(99, 102, 241, 0.08);
  transform: translateX(3px);
}

.token-modal-item-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: contain;
  background: rgba(51, 65, 85, 0.4);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.token-modal-item-info {
  flex: 1;
}

.token-modal-item-symbol {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-color);
}

.token-modal-item-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.token-modal-item-balance {
  text-align: right;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
}

.token-modal-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  color: var(--text-muted);
}

.token-modal-no-results svg {
  margin-bottom: 15px;
  color: var(--border-color);
}

.token-modal-no-results p {
  margin: 0;
  font-size: 15px;
}

.token-modal-import {
  margin-top: 10px;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary-color);
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.token-modal-import:hover {
  background: rgba(99, 102, 241, 0.15);
}

.token-modal-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 0;
  color: var(--text-muted);
}

.token-modal-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: token-spin 1s linear infinite;
}

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

@media screen and (max-width: 768px) {
  .token-modal {
    width: 95%;
    max-height: 80vh;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .token-modal-overlay.show .token-modal {
    transform: translate(-50%, -50%) scale(1);
  }

  .token-modal-body {
    max-height: 250px;
    flex: 1;
    min-height: 0;
    padding: 0 15px 15px;
  }

  .token-modal-search {
    flex-shrink: 0;
    padding: 10px 15px;
  }

  .token-modal-header {
    flex-shrink: 0;
  }

  .token-modal-item-img {
    width: 30px;
    height: 30px;
  }

  .token-modal-header h3 {
    font-size: 18px;
  }

  .btn {
    max-width: 190px;
  }

  .settings-modal-content {
    margin: 2% auto;
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
  }

  .settings-body {
    padding: 12px 14px;
    max-height: calc(90vh - 80px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .settings-header {
    padding: 10px 14px;
    flex-shrink: 0;
  }

  .settings-header h2 {
    font-size: 18px;
  }

  .settings-section {
    margin-bottom: 16px;
  }

  .toggle-description {
    font-size: 11px;
    margin-left: 50px;
    line-height: 1.3;
    padding-right: 5px;
  }
}

#bestRouter {
  color: var(--text-color);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.beta-tag {
  background-color: var(--primary-color);
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: bold;
  vertical-align: middle;
  margin-left: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}