/* ═══════════════════════════════════════════════════════════════
   PUNCH 6900 — Paper Trading · Kawaii / Cute theme
   ═══════════════════════════════════════════════════════════════ */

body {
  font-family: 'Nunito', 'Inter', sans-serif !important;
  background: linear-gradient(165deg, #1e1b2e 0%, #2a2540 25%, #252038 50%, #1f1c30 100%) !important;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(255, 182, 193, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 85% 80%, rgba(221, 160, 221, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(200, 230, 255, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Trading container: less top space so Live Trading sits higher ─── */
.trading-container {
  padding-top: 0 !important;
}

/* ─── Trading top: balance + tabs alineados y pegados a la derecha ─── */
.trading-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
  margin-right: -0.5rem;
  position: relative;
  z-index: 1;
  padding-left: 2rem;
}

.trading-top-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

/* Misma altura y estilo para balance y tabs (cuadrados entre sí) */
.balance-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.85rem;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
}

.balance-compact-label {
  font-weight: 600;
}

.balance-compact-amount {
  font-weight: 800;
  color: #b5f0ce;
  font-family: 'JetBrains Mono', monospace;
}

/* Legacy balance card hidden when compact is used */
.balance-container { display: none !important; }

/* ─── Tabs mismo estilo y altura que balance ─── */
.trading-tabs { display: flex; align-items: stretch; gap: 0.5rem !important; position: relative; z-index: 1; }

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 34px !important;
  padding: 0 0.85rem !important;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  line-height: 1 !important;
  color: rgba(255, 255, 255, 0.85) !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.tab-btn:hover {
  transform: none !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.tab-btn.active {
  background: rgba(255, 182, 193, 0.2) !important;
  color: #fff !important;
  border-color: rgba(255, 182, 193, 0.4) !important;
  transform: none !important;
  box-shadow: none !important;
}

.tab-icon { font-size: 1rem !important; }

/* ─── Exchange header with logo (tight so Live Trading sits higher) ─── */
.exchange-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.exchange-header-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(255, 182, 193, 0.3));
}

.exchange-header-text {
  flex: 1;
  min-width: 0;
}

.exchange-title,
.portfolio-title {
  background: linear-gradient(135deg, #ffb6c1, #dda0dd) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px;
}

.exchange-subtitle,
.portfolio-subtitle {
  color: rgba(255, 255, 255, 0.75) !important;
  font-weight: 600 !important;
}

.portfolio-header {
  margin-bottom: 1rem !important;
}

/* ─── Token cards grid (Exchange) ─── */
.tokens-section {
  background: linear-gradient(145deg, rgba(255, 240, 250, 0.06), rgba(240, 230, 255, 0.05)) !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 32px !important;
  padding: 2rem !important;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  position: relative;
  z-index: 1;
}

.tokens-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* ─── Kawaii card (token & portfolio) ─── */
.kawaii-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.kawaii-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25), 0 0 30px rgba(255, 182, 193, 0.08);
}

.token-card-header,
.portfolio-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.token-card-emoji,
.portfolio-card-emoji {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.token-card-name,
.portfolio-card-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  display: block;
}

.portfolio-card-symbol {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.token-card-body,
.portfolio-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.token-card-row,
.portfolio-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.token-card-label {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

.token-card-value {
  color: #fff;
  font-weight: 700;
}

.pending-buy { color: #98e6a0 !important; font-weight: 800; }
.pending-sell { color: #f4a0a8 !important; font-weight: 800; }

.token-card-actions,
.portfolio-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ─── Kawaii buttons (Buy, Sell, Confirm) ─── */
.kawaii-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  min-width: 0;
}

.kawaii-btn-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.kawaii-btn:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.06);
}

.kawaii-btn:active:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
}

.kawaii-btn-buy {
  background: linear-gradient(135deg, #98e6a0, #7dd87d) !important;
  color: #1a3d1a !important;
}

.kawaii-btn-buy:hover:not(:disabled) {
  box-shadow: 0 12px 28px rgba(125, 216, 125, 0.45);
}

.kawaii-btn-sell {
  background: linear-gradient(135deg, #f4a0a8, #e89098) !important;
  color: #4a2020 !important;
}

.kawaii-btn-sell:hover:not(:disabled) {
  box-shadow: 0 12px 28px rgba(232, 144, 152, 0.45);
}

.kawaii-btn-sell:disabled,
.kawaii-btn-sell-all:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(0.5);
}

.kawaii-btn-sell-all {
  background: linear-gradient(135deg, #e89098, #d88088) !important;
  color: #4a2020 !important;
}

.kawaii-btn-sell-all:hover:not(:disabled) {
  box-shadow: 0 12px 28px rgba(232, 144, 152, 0.45);
}

.kawaii-btn-confirm {
  background: linear-gradient(135deg, #ffb6c1, #e8b4bc) !important;
  color: #2d2640 !important;
}

.kawaii-btn-confirm:hover:not(:disabled) {
  box-shadow: 0 12px 28px rgba(255, 182, 193, 0.5);
}

/* Override old table-based button styles when inside cards */
.token-card .token-action-btn,
.token-card .confirm-btn,
.portfolio-card .portfolio-sell-btn {
  padding: 0.85rem 1.25rem !important;
  border-radius: 999px !important;
  min-width: 0 !important;
}

/* ─── Portfolio cards grid ─── */
.portfolio-section {
  background: linear-gradient(145deg, rgba(255, 240, 250, 0.06), rgba(240, 230, 255, 0.05)) !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 32px !important;
  padding: 2rem !important;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  position: relative;
  z-index: 1;
}

.portfolio-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ─── Portfolio empty state ─── */
.portfolio-empty {
  text-align: center;
  padding: 3.5rem 2rem !important;
  max-width: 420px;
  margin: 0 auto;
}

.portfolio-empty-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  animation: kawaii-float 2.5s ease-in-out infinite;
}

.portfolio-empty-title {
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 1.5rem !important;
  margin-bottom: 0.75rem !important;
}

.portfolio-empty-text {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
}

/* ─── P/L colors ─── */
.gain-positive {
  color: #98e6a0 !important;
  font-weight: 800 !important;
}

.gain-negative {
  color: #f4a0a8 !important;
  font-weight: 800 !important;
}

/* ─── Pagination ─── */
.pagination-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 2rem 0;
  position: relative;
  z-index: 1;
}

.pagination-btn {
  width: 52px;
  height: 52px;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  background: linear-gradient(145deg, rgba(255, 182, 193, 0.2), rgba(230, 200, 255, 0.15)) !important;
  color: #fff !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.pagination-btn:hover {
  transform: translateY(-4px) scale(1.1) !important;
  background: linear-gradient(145deg, rgba(255, 182, 193, 0.35), rgba(230, 200, 255, 0.25)) !important;
  border-color: rgba(255, 182, 193, 0.5) !important;
  box-shadow: 0 10px 30px rgba(255, 182, 193, 0.25);
}

.pagination-info {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 700 !important;
}

/* ─── Footer ─── */
.modern-footer {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(30, 27, 46, 0.9)) !important;
  border-top: 2px solid rgba(255, 255, 255, 0.08) !important;
}

.footer-link {
  border-radius: 20px !important;
  padding: 0.6rem 1.2rem !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.footer-link:hover {
  transform: translateY(-4px) scale(1.05) !important;
  background: rgba(255, 182, 193, 0.2) !important;
  color: #ffc0cb !important;
}

.footer-logo {
  background: linear-gradient(135deg, #ffb6c1, #dda0dd) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 800 !important;
}

.footer-tagline {
  color: rgba(255, 255, 255, 0.6) !important;
  font-weight: 600 !important;
}

/* ─── Header logo ─── */
.logo {
  background: linear-gradient(135deg, #ffb6c1, #dda0dd) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 800 !important;
}

/* ─── Nav ─── */
.main-nav {
  border-bottom: 2px solid rgba(255, 182, 193, 0.35) !important;
}

.nav-btn.orange {
  color: #ffc0cb !important;
}

.nav-btn:hover {
  background: rgba(255, 182, 193, 0.12) !important;
}

/* ─── Loading ─── */
.loading {
  color: rgba(255, 255, 255, 0.75) !important;
  font-weight: 700 !important;
}

@keyframes kawaii-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.05); }
}

/* ─── Buy modal (custom price) ─── */
.buy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.buy-modal-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.buy-modal {
  background: linear-gradient(160deg, #2a2540, #1e1b2e);
  border: 2px solid rgba(255, 182, 193, 0.3);
  border-radius: 24px;
  padding: 0;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.buy-modal-overlay[aria-hidden="false"] .buy-modal {
  transform: scale(1);
}

.buy-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.buy-modal-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.buy-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  flex: 1;
}

.buy-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.buy-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.buy-modal-body {
  padding: 1.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.buy-modal-token-name {
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.25rem 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.buy-modal-current-price {
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.buy-modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.buy-modal-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  display: block;
  margin: 0;
  line-height: 1.3;
}

.buy-modal-hint {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  display: block;
  margin-top: 0.15rem;
}

.buy-modal-input {
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 0.25rem;
  min-height: 44px;
  box-sizing: border-box;
}

.buy-modal-input:focus {
  outline: none;
  border-color: rgba(255, 182, 193, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.buy-modal-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.buy-modal-total {
  margin: 0.5rem 0 0;
  padding-top: 1rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.4;
}

.buy-modal-total strong {
  color: #b5f0ce;
  font-size: 1.15rem;
}

.buy-modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.buy-modal-footer .kawaii-btn {
  width: 100%;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .tokens-cards-grid {
    grid-template-columns: 1fr;
  }
  .portfolio-cards-grid {
    grid-template-columns: 1fr;
  }
  .token-card-actions,
  .portfolio-card-actions {
    flex-direction: column;
  }
  .kawaii-btn {
    width: 100%;
  }
  .trading-top {
    flex-direction: column;
    align-items: stretch;
  }
  .balance-compact {
    justify-content: flex-end;
  }
}
