:root {
  --ruby: #ff0000;
  --ruby-light: #ffe5e5;
  --bg: #ffdada;
  --card: #ffffff;
  --text: #000000;
  --subtle: #555555;
  --border: #ccc;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Header and Footer */
.header-bar, .footer {
  width: 90%;
  max-width: 1024px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  margin: 24px auto 20px auto;
  padding: 12px 24px;
}
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo, .footer-logo {
  height: 32px;
  border-radius: 6px;
}
.footer-logo {
  width: 40px;
}
.brand-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--ruby);
  letter-spacing: 0.5px;
}
.connect-btn {
  padding: 6px 14px;
  background: var(--ruby);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.connect-btn:hover {
  background: #801722;
}

/* Swap Container */
.swap-container {
  background: var(--card);
  padding: 16px;
  border-radius: 16px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  margin-top: 60px;
  margin-bottom: 60px;
}
@media (min-width: 1024px) {
  .swap-container {
    max-width: 550px;
     margin-top: 30px;
  }
}
.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 6px;
}
.icon-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--ruby);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: background 0.2s;
}
.icon-btn:hover {
  background: rgba(75, 66, 67, 0.1);
}
.reload-btn {
  background: none;
  border: none;
  outline: none;
  font-size: 20px;
  cursor: pointer;
  color: #555;
  padding: 0;
  margin: 0;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}
.reload-btn:hover {
  transform: rotate(90deg);
  color: #000;
}

/* Slippage Popup */
.settings-wrapper {
  position: relative;
}
.slippage-popup {
  position: absolute;
  top: 40px;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 100;
}
.slippage-popup label {
  font-size: 14px;
  font-weight: bold;
}
.slippage-input-wrapper {
  display: flex;
  align-items: center;
  margin-top: 4px;
}
.slippage-input-wrapper input {
  width: 40px;
  padding: 4px;
  font-size: 14px;
  text-align: right;
  border-radius: 6px;
  border: 1px solid #ccc;
}
.slippage-input-wrapper .percent-label {
  margin-left: 4px;
  font-size: 14px;
}

/* Token Selector Buttons */
.token-select {
  display: flex;
  align-items: center;
  gap: 8px;
}
.token-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
}
.token-display:hover {
  border-color: var(--ruby);
}
.token-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ccc;
  background-color: white;
}
.dropdown-arrow {
  font-size: 12px;
  opacity: 0.6;
}

/* Token Boxes */
.token-box {
  background: #f7f7f7;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
.token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.amount-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 10px;
  text-align: right;
  margin-bottom: 6px;
}
.percentage-buttons {
  display: flex;
  gap: 4px;
}
.percentage-buttons button {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--ruby);
  border-radius: 8px;
  cursor: pointer;
}
.percentage-buttons button:hover {
  background: var(--ruby);
  color: #fff;
}
.reverse-btn {
  width: 32px;
  height: 32px;
  margin: 10px auto;
  background: var(--ruby);
  color: white;
  border-radius: 50%;
  border: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.reverse-btn:active {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

/* Main Swap Button */
.btn {
  background: var(--ruby);
  color: white;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 10px;
}
.btn:hover {
  background: #801722;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: #ffffff;
  color: #000;
  width: 90%;
  max-width: 400px;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
}
.close-modal {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--subtle);
  cursor: pointer;
}
#tokenSearch {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid #ccc;
  font-size: 14px;
}
.token-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 14px;
  background: #f3f3f3;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.token-item:hover {
  background: #eee;
}
.token-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.token-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  background: white;
}
.token-symbol {
  font-weight: bold;
  font-size: 15px;
}
.token-address {
  font-size: 12px;
  color: #888;
}
.copy-btn {
  font-size: 14px;
  color: var(--ruby);
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

/* Footer */
.footer-content {
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Social Icons in Footer */
.socials {
  display: flex;
  gap: 16px;
  align-items: center;
}
.socials a img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: black;
  padding: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.socials a img:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.footer-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  padding: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: var(--ruby);
  font-weight: 500;
  text-decoration: none;
  font-size: 14px;
}
.footer-links a:hover {
  text-decoration: underline;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.legal {
  font-size: 12px;
  color: #999;
}

/* Toasts */
#toastContainer {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 12px 16px;
  background: #333;
  color: white;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.3s forwards, fadeOut 0.3s 3s forwards;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.success { background: #28a745; }
.toast.error { background: #dc3545; }
.toast.info { background: #444; }
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateY(20px); }
}

/* Profile Menu */
.profile-wrapper {
  position: relative;
}
.profile-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 8px 10px;
  font-size: 18px;
  cursor: pointer;
}
.profile-menu {
  position: absolute;
  top: 45px;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  padding: 12px;
  z-index: 999;
  display: none;
  width: 220px;
  flex-direction: column;
  gap: 8px;
}
.profile-menu button {
  background: none;
  border: none;
  text-align: left;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.profile-menu button:hover {
  background: var(--ruby-light);
  color: var(--text);
}
.wallet-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Transactions Dropdown (NEW STYLE) */
.tx-dropdown {
  position: absolute;
  top: 45px;
  right: 60px;
  width: 260px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  padding: 12px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tx-dropdown .tx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.tx-dropdown .tx-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}
.tx-dropdown .tx-loader {
  margin: 20px auto;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--ruby);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.tx-dropdown .tx-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}
.tx-dropdown .tx-list li {
  font-size: 13px;
  background: #f5f5f5;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  word-break: break-word;
}
.tx-dropdown .tx-list a {
  color: var(--ruby);
  text-decoration: none;
  font-weight: 500;
}
.tx-dropdown .tx-list time {
  font-size: 11px;
  color: #777;
  display: block;
  margin-top: 2px;
}
.tx-dropdown .tx-empty {
  font-size: 13px;
  color: #888;
  text-align: center;
  padding: 10px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.tx-title {
  font-weight: bold;
  font-size: 15px;
}
.tx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tx-list .token-logo {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ccc;
  background: white;
}

.tx-card-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.tx-card-list li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow 0.2s ease;
}

.tx-card-list li:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tx-card-list a {
  color: inherit;
  text-decoration: none;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tx-box-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-box-right {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
}

.show-more-btn {
  margin-top: 8px;
  background: var(--ruby);
  color: black; /* 👈 change from white to black */
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
}
.show-more-btn:hover {
  background: #801722;
  color: white; /* or stay black */
}

