/* ===================== ANIMATIONS ===================== */
@keyframes panelShimmer {
  0%   { background-position: -300% center; }
  100% { background-position: 300% center; }
}

@keyframes pulseRed {
  0%, 100% { opacity: 1; text-shadow: 0 0 8px rgba(255, 60, 60, 0.6); }
  50%       { opacity: 0.55; text-shadow: 0 0 18px rgba(255, 60, 60, 1); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(94, 205, 255, 0.45); }
  50%       { border-color: rgba(94, 205, 255, 0.9); }
}

/* ===================== OVERLAY ===================== */
.wallet-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  z-index: 1500;
  backdrop-filter: blur(2px);
}

.wallet-panel-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ===================== CLOSE BUTTON ===================== */
.wallet-panel__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #c8dcf0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  z-index: 10;
}

.wallet-panel__close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: rotate(90deg);
}

body.wallet-panel-open .banner-top {
  display: none !important;
}

/* ===================== PANEL ===================== */
.wallet-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 96vw);
  height: 100vh;
  background: linear-gradient(160deg, #080e18 0%, #0b1628 50%, #060c16 100%);
  border-left: 1px solid rgba(94, 205, 255, 0.45);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.7), inset 0 0 80px rgba(94, 205, 255, 0.03);
  transform: translateX(102%);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1501;
  color: #f2f7ff;
  overflow-y: hidden;
  animation: borderGlow 4s ease-in-out infinite;
}

.wallet-panel.open {
  transform: translateX(0);
}

/* ===================== INNER ===================== */
.wallet-panel__inner {
  height: 100%;
  box-sizing: border-box;
  padding: 56px 20px 28px;
}

/* ===================== TITLE ===================== */
.wallet-panel__title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
  line-height: 1.15;
  background: linear-gradient(90deg, #ffffff 0%, #7dd8ff 35%, #f9d673 60%, #ffffff 100%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: panelShimmer 5s linear infinite;
}

/* ===================== DESC ===================== */
.wallet-panel__desc {
  color: #a8c8e8;
  line-height: 1.5;
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: 0.1px;
}

/* ===================== CONNECT LAYOUT ===================== */
.wallet-panel__connect-layout {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}

.wallet-panel__connect-layout .wallet-panel__title,
.wallet-panel__connect-layout .wallet-panel__desc,
.wallet-panel__connect-layout .wallet-panel__error {
  width: 100%;
  text-align: center;
}

.wallet-panel__connect-box {
  margin: 12px 0 4px;
  width: 100%;
  text-align: center;
}

/* ===================== INPUTS ===================== */
.wallet-panel__input,
.wallet-panel__textarea {
  width: 100%;
  background: rgba(10, 22, 38, 0.9);
  border: 1px solid rgba(94, 205, 255, 0.3);
  color: #e8f4ff;
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wallet-panel__input--center {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.wallet-panel__input::placeholder,
.wallet-panel__textarea::placeholder {
  color: #4a6a8a;
}

.wallet-panel__input:focus,
.wallet-panel__textarea:focus {
  outline: none;
  border-color: rgba(94, 203, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(94, 203, 255, 0.12), 0 0 16px rgba(94, 203, 255, 0.1);
}

.wallet-panel__textarea {
  min-height: 86px;
  resize: vertical;
}

/* ===================== BUTTONS ===================== */
.wallet-panel__btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(90deg, #e8820a 0%, #f7a030 50%, #e8820a 100%);
  background-size: 200% auto;
  margin-top: 5px;
  box-shadow: 0 6px 20px rgba(232, 130, 10, 0.35);
  transition: background-position 0.4s, box-shadow 0.2s, transform 0.15s;
}

.wallet-panel__btn:hover {
  background-position: right center;
  box-shadow: 0 8px 28px rgba(232, 130, 10, 0.5);
  transform: translateY(-1px);
}

.wallet-panel__btn--xlm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.wallet-panel__btn.secondary {
  background: linear-gradient(90deg, #1260c4 0%, #2a9af7 50%, #1260c4 100%);
  background-size: 200% auto;
  box-shadow: 0 6px 20px rgba(30, 130, 255, 0.3);
}

.wallet-panel__btn.secondary:hover {
  background-position: right center;
  box-shadow: 0 8px 28px rgba(30, 130, 255, 0.5);
}

.wallet-panel__btn--switch {
  margin-top: 4px;
  margin-bottom: 6px;
}

.wallet-panel__btn.pending {
  background: #2a3545;
  box-shadow: none;
  cursor: default;
  transform: none;
}

/* ===================== AMOUNT ROW ===================== */
.wallet-amount-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}

.wallet-amount-row .wallet-panel__input {
  margin-bottom: 0;
}

.wallet-max-btn {
  min-width: 62px;
  border: 1px solid rgba(94, 205, 255, 0.4);
  border-radius: 12px;
  background: rgba(10, 28, 50, 0.95);
  color: #5ecbff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.wallet-max-btn:hover {
  background: rgba(30, 80, 130, 0.8);
  color: #fff;
}

/* ===================== AVAILABLE AMOUNT ===================== */
.wallet-available-amount {
  margin-bottom: 8px;
  font-size: 12px;
  color: #6ab0d8;
  letter-spacing: 0.1px;
}

.wallet-available-amount strong {
  color: #4fd6ff;
}

/* ===================== SECURITY NOTE ===================== */
.wallet-security-note {
  margin: 6px 0 10px;
  font-size: 11px;
  line-height: 1.4;
  color: #4a6a8a;
  text-align: center;
  letter-spacing: 0.1px;
}

/* ===================== ERROR ===================== */
.wallet-panel__error {
  color: #ff9090;
  font-size: 12px;
  margin-top: 8px;
  background: rgba(120, 20, 20, 0.25);
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
}

/* ===================== TABLE ===================== */
.wallet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 11px;
  table-layout: fixed;
}

.wallet-table th {
  color: #3a6080;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 4px 3px;
}

.wallet-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 5px 4px;
  text-align: left;
  color: #c8dff5;
  vertical-align: middle;
}

.wallet-asset-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.wallet-asset-text {
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #e8f4ff;
}

/* ===================== COIN ICONS ===================== */
.wallet-coin-wrap {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.wallet-coin-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wallet-coin-fallback {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: rgba(94, 203, 255, 0.35);
}

/* ===================== PORTFOLIO LAYOUT ===================== */
.wallet-panel__portfolio-layout {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wallet-panel__portfolio-main {
  flex: 0 0 auto;
}

.wallet-panel__portfolio-footer {
  margin-top: 6px;
  padding-top: 0;
}

/* ===================== TOTAL BLOCK ===================== */
.wallet-total {
  margin-top: 5px;
  padding: 7px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(20, 60, 40, 0.6), rgba(10, 40, 28, 0.8));
  border: 1px solid rgba(79, 214, 130, 0.3);
  font-size: 12px;
  box-shadow: inset 0 0 20px rgba(79, 214, 130, 0.05);
}

.wallet-total__title {
  font-weight: 700;
  margin-bottom: 5px;
  color: #80e8b0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-total strong {
  background: linear-gradient(90deg, #5df0a4, #a8ffce);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 13px;
}

/* ===================== PENDING ===================== */
.wallet-pending {
  margin-top: 14px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(10, 20, 35, 0.9), rgba(5, 12, 25, 0.95));
  border: 1px solid rgba(94, 205, 255, 0.2);
  color: #b0c8e0;
  line-height: 1.6;
  font-size: 13px;
}

.wallet-pending strong {
  background: linear-gradient(90deg, #fff 0%, #7dd8ff 50%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: panelShimmer 4s linear infinite;
  font-size: 15px;
}

/* Red blinking 48h warning */
.wallet-pending__warning {
  display: inline-block;
  margin-top: 10px;
  color: #ff4444;
  font-weight: 800;
  font-size: 13px;
  animation: pulseRed 1.6s ease-in-out infinite;
}

.wallet-pending-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.wallet-panel.pending .wallet-table,
.wallet-panel.pending .wallet-total {
  opacity: 0.4;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  .wallet-panel {
    width: 100vw;
  }

  .wallet-panel__inner {
    padding: 52px 14px 22px;
  }

  .wallet-panel__title {
    font-size: 19px;
  }

  .wallet-table {
    font-size: 10px;
  }

  .wallet-coin-wrap {
    width: 16px;
    height: 16px;
    min-width: 16px;
  }
}
