/* ═══════════════════════════════════════════
   COMPONENTS.CSS — Reusable UI Components
   ═══════════════════════════════════════════ */

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
  background: rgba(255, 249, 245, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logo__img {
  display: block;
  border-radius: 10px;
  object-fit: cover;
}

.logo__text {
  font-size: 20px;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: -0.5px;
}

/* Nav */
.nav {
  display: flex;
  gap: 4px;
}

.nav__btn {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav__btn:hover {
  color: var(--orange);
}

.nav__btn.active {
  background: var(--orange-10);
  color: var(--orange);
}

/* Wallet Button */
.wallet-btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  background: var(--orange-grad);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(232, 98, 44, 0.3);
  transition: all 0.3s;
}

.wallet-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 98, 44, 0.35);
}

.wallet-btn.connected {
  background: var(--orange-10);
  color: var(--orange);
  box-shadow: none;
  border: 1.5px solid rgba(232, 98, 44, 0.3);
}

.wallet-btn.connected:hover {
  transform: none;
}

.wallet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-right: 8px;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-mid);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-card__label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stat-card__value {
  font-size: 24px;
  font-weight: 800;
}

/* ── Feature Cards ── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
  margin-bottom: 16px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.3s;
}

.feature-card:hover {
  box-shadow: 0 8px 30px rgba(232, 98, 44, 0.1);
}

.feature-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--orange-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(232, 98, 44, 0.2);
}

.feature-card__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card__desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ── Chart Card ── */
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.chart-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-card__pair {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.chart-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.chart-card__price {
  font-size: 30px;
  font-weight: 800;
}

.chart-card__change {
  font-size: 14px;
  color: var(--orange);
  font-weight: 700;
}

#priceChart {
  width: 100%;
  height: 220px;
  border-radius: 12px;
}

.tf-bar {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  padding: 4px;
}

.tf-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  color: var(--text-light);
  transition: all 0.2s;
}

.tf-btn.active {
  background: var(--orange);
  color: #fff;
}

/* ── Swap Card ── */
.swap-card {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(232, 98, 44, 0.1);
}

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

.swap-card__title {
  font-size: 20px;
  font-weight: 800;
}

.settings-btn {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 16px;
  transition: all 0.2s;
}

.settings-btn:hover,
.settings-btn.active {
  background: var(--orange-15);
  color: var(--orange);
}

/* Slippage */
.slippage-panel {
  background: var(--bg-input);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  display: none;
}

.slippage-panel.open {
  display: block;
}

.slippage-panel__label {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 10px;
  font-weight: 600;
}

.slippage-panel__options {
  display: flex;
  gap: 8px;
}

.slip-btn {
  padding: 8px 18px;
  border-radius: 12px;
  border: 2px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  color: var(--text-mid);
  font-size: 13px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
}

.slip-btn.active {
  border-color: var(--orange);
  background: rgba(232, 98, 44, 0.08);
  color: var(--orange);
}

/* Input Box */
.input-box {
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.input-box:focus-within {
  border-color: var(--border-hover);
}

.input-box__top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-light);
}

.max-btn {
  background: none;
  border: none;
  color: var(--orange);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
}

.input-box__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.amount-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dark);
  font-size: 28px;
  font-weight: 700;
  outline: none;
  min-width: 0;
  font-family: inherit;
}

.amount-input::placeholder {
  color: #ccc;
}

.token-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.token-btn:hover {
  border-color: var(--border-hover);
}

.token-btn__icon {
  font-weight: 800;
  font-size: 16px;
}

.token-btn__arrow {
  font-size: 10px;
  opacity: 0.4;
}

.usd-est {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
  min-height: 18px;
}

/* Flip Button */
.flip-wrap {
  display: flex;
  justify-content: center;
  margin: -16px 0;
  position: relative;
  z-index: 2;
}

.flip-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--orange-grad);
  border: 4px solid #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  transition: transform 0.3s;
  box-shadow: 0 4px 12px rgba(232, 98, 44, 0.3);
}

.flip-btn:hover {
  transform: rotate(180deg);
}

/* Rate Info */
.rate-info {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: none;
}

.rate-info.show {
  display: block;
}

.rate-info__row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.rate-info__row:last-child {
  margin-bottom: 0;
}

.rate-info__val {
  font-weight: 600;
  color: var(--text-dark);
}

.rate-info__val.green {
  color: var(--green);
}

/* Swap Button */
.swap-btn {
  width: 100%;
  margin-top: 18px;
  padding: 18px;
  border-radius: 16px;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: default;
  transition: all 0.3s;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-light);
}

.swap-btn.ready {
  background: var(--orange-grad);
  color: #fff;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
}

.swap-btn.ready:hover {
  box-shadow: 0 8px 28px rgba(232, 98, 44, 0.4);
  transform: translateY(-1px);
}

.swap-btn.swapping {
  background: var(--orange-grad);
  color: #fff;
  opacity: 0.7;
  cursor: wait;
}

/* ── Transactions ── */
.tx-card {
  margin-top: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.tx-card__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.tx-row + .tx-row {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.tx-row__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tx-row__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.tx-row__icon.swap {
  background: var(--orange-10);
  color: var(--orange);
}

.tx-row__icon.lp {
  background: rgba(39, 117, 202, 0.1);
  color: #2775CA;
}

.tx-row__detail {
  font-size: 14px;
  font-weight: 600;
}

.tx-row__hash {
  font-size: 12px;
  color: var(--text-light);
}

.tx-row__time {
  font-size: 12px;
  color: var(--text-light);
}

/* ── Footer ── */
.footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 28px 24px;
  background: rgba(255, 249, 245, 0.6);
  position: relative;
  z-index: 1;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer__copy {
  font-size: 13px;
  color: var(--text-light);
}

.footer__links {
  display: flex;
  gap: 24px;
}

.footer__link {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s;
}

.footer__link:hover {
  color: var(--orange);
}