@import url('/style.css');

/* ===== Page layout ===== */
body.bridge-page { background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-body); margin: 0; min-height: 100vh; }
body.bridge-page #app { max-width: 720px; margin: 0 auto; padding: 24px 20px 80px; }

#wallet-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-family: var(--font-display); color: var(--accent); font-weight: 600; text-decoration: none; font-size: 15px; letter-spacing: 0.02em; }
.wallet-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); transition: var(--transition); }
.chip:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }

#page-title { font-family: var(--font-display); font-size: 32px; font-weight: 600; margin: 40px 0 28px; text-align: center; letter-spacing: -0.01em; }

/* ===== Form card ===== */
#form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 48px;
  backdrop-filter: blur(8px);
}
.field-row { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; }
.field-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-display); font-weight: 500; }
.field-aux { font-size: 13px; color: var(--text-secondary); font-family: var(--font-mono); display: flex; align-items: center; gap: 8px; }
.recipient-readout { color: var(--text-primary); }

input[type=text].amount-input,
input[type=text].recipient-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 20px;
  font-family: var(--font-mono);
  margin-bottom: 8px;
  transition: var(--transition);
  box-sizing: border-box;
}
input[type=text].recipient-input { font-size: 14px; }
input[type=text].amount-input:focus,
input[type=text].recipient-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
input[type=text][disabled] { opacity: 0.5; cursor: not-allowed; }

.fee-preview {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 18px 0 18px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.fee-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--text-secondary); }
.fee-row span:last-child { color: var(--text-primary); }

.form-error {
  color: #ff9b9b;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.35);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.cooldown-warn {
  color: #ffd89a;
  background: rgba(255, 190, 80, 0.10);
  border: 1px solid rgba(255, 190, 80, 0.35);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 10px 0 12px;
  line-height: 1.5;
}
.cooldown-warn strong { color: #ffc76a; }

/* ===== Buttons ===== */
.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  letter-spacing: 0.01em;
}
.btn:hover:not([disabled]) { border-color: var(--accent); background: var(--bg-card); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover:not([disabled]) { background: var(--accent-light); border-color: var(--accent-light); box-shadow: 0 0 20px var(--accent-glow); }
.btn.wide { display: block; width: 100%; padding: 14px; font-size: 16px; margin-top: 8px; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.active { background: var(--accent-dim); color: var(--text-primary); border-color: var(--accent-dim); }

.link {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  padding: 0 2px;
}
.link:hover { color: var(--accent-light); }
.link[disabled] { opacity: 0.3; cursor: not-allowed; text-decoration: none; }

/* ===== Banners ===== */
.banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}
.banner-error { background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.35); color: #ffb3b3; }
.banner-warn { background: rgba(255, 190, 80, 0.10); border: 1px solid rgba(255, 190, 80, 0.35); color: #ffd89a; }
.banner .banner-body { flex: 1; line-height: 1.5; }
.banner .banner-body strong { color: #ffc76a; }

/* ===== Activity ===== */
#activity h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 16px; font-weight: 600; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.empty { color: var(--text-muted); font-style: italic; padding: 20px 0; text-align: center; }

.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-row {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  transition: var(--transition);
}
.tx-row:hover { border-color: var(--border-hover); }
.tx-row .amt { font-weight: 600; color: var(--text-primary); }
.tx-row .status { color: var(--text-secondary); font-size: 12px; }
.tx-row .actions { display: flex; gap: 8px; }
.tx-row .links { display: flex; gap: 10px; }
.tx-link { color: var(--text-secondary); font-size: 11px; text-decoration: none; white-space: nowrap; }
.tx-link:hover { color: var(--accent); }
.tx-done { border-color: rgba(95, 220, 160, 0.2); }
.tx-done .status { color: #8be3bb; }
.tx-failed { border-color: rgba(255, 107, 107, 0.25); }
.tx-failed .status { color: #ffb3b3; }
.tx-ready { border-color: rgba(0, 232, 255, 0.3); box-shadow: 0 0 16px var(--accent-glow); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 440px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal h3 { font-family: var(--font-display); margin: 0 0 8px; font-size: 20px; }
.modal-sub { color: var(--text-secondary); font-size: 13px; margin: 0 0 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.wallet-options { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 15px;
  transition: var(--transition);
}
.wallet-option:hover { border-color: var(--accent); background: var(--bg-card); }
.wallet-icon { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }

.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
}
.confirm-row:last-of-type { border-bottom: none; }
.confirm-row span:first-child { color: var(--text-secondary); }
.confirm-row span:last-child { color: var(--text-primary); word-break: break-all; max-width: 60%; text-align: right; }

.steps { list-style: none; padding: 0; margin: 20px 0; font-family: var(--font-mono); font-size: 14px; }
.steps li {
  padding: 10px 14px;
  color: var(--text-muted);
  border-left: 3px solid var(--border);
  margin-bottom: 4px;
  text-transform: capitalize;
  transition: var(--transition);
}
.steps li.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-glow); }
.steps li.done { color: var(--text-primary); border-left-color: rgba(95, 220, 160, 0.4); }

.claim-summary { margin: 20px 0 0; padding: 16px; background: var(--bg-primary); border: 1px solid rgba(95, 220, 160, 0.25); border-radius: var(--radius-sm); }
.claim-summary .confirm-row { font-family: var(--font-mono); padding: 6px 0; }
.claim-summary .tx-link { color: var(--accent); text-decoration: none; font-size: 13px; }
.claim-summary .tx-link:hover { text-decoration: underline; }

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

/* ===== Mobile ===== */
@media (max-width: 540px) {
  body.bridge-page #app { padding: 16px 12px 60px; }
  #page-title { font-size: 24px; margin: 28px 0 20px; }
  #form-card { padding: 20px; }
  .tx-row { grid-template-columns: 1fr auto; }
  .tx-row .status { grid-column: 1 / -1; }
  .tx-row .links { grid-column: 1 / -1; }
  .modal { padding: 20px; }
  .banner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== Donate ===== */
.donate-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.donate-label {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}
.donate-addr-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.donate-addr {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: default;
}
.donate-copy {
  font-size: 11px !important;
  padding: 4px 10px !important;
}
