/* ═══════════════════════════════════════════════════════════════════════
 * Cosmic Toast — Static CSS
 * Extracted from cosmic-toast.js to prevent FOUC/flickering.
 * ═══════════════════════════════════════════════════════════════════════ */

#cosmic-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.cosmic-toast {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  border: 1px solid;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              inset 0 1px 1px rgba(255, 255, 255, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  animation: cosmicSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.3s ease;
}

.cosmic-toast.cosmic-exit {
  animation: cosmicSlideOut 0.3s cubic-bezier(0.34, 0, 0.66, 1) forwards;
}

@keyframes cosmicSlideIn {
  from { transform: translateX(400px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

@keyframes cosmicSlideOut {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(400px); opacity: 0; }
}

.cosmic-toast-icon {
  flex-shrink: 0;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.cosmic-toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cosmic-toast-message {
  color: #f0f1ff;
  font-weight: 500;
}

.cosmic-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #8b89b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
}

.cosmic-toast-close:hover {
  color: #f0f1ff;
  background: rgba(255, 255, 255, 0.1);
}

.cosmic-toast-close:active {
  transform: scale(0.95);
}

.cosmic-toast.cosmic-success {
  background: rgba(14, 16, 72, 0.95);
  border-color: #10b981;
}
.cosmic-toast.cosmic-success .cosmic-toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.cosmic-toast.cosmic-error {
  background: rgba(14, 16, 72, 0.95);
  border-color: #ef4444;
}
.cosmic-toast.cosmic-error .cosmic-toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.cosmic-toast.cosmic-info {
  background: rgba(14, 16, 72, 0.95);
  border-color: #06b6d4;
}
.cosmic-toast.cosmic-info .cosmic-toast-icon {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}

.cosmic-toast.cosmic-warning {
  background: rgba(14, 16, 72, 0.95);
  border-color: #f59e0b;
}
.cosmic-toast.cosmic-warning .cosmic-toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* ── Shared keyframes used by error-boundary, wallet modals, etc. ─── */
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@keyframes wrmSpin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

/* ── NFT bootstrap image/card defaults ────────────────────────────── */
.nft-card-img-cover {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.nft-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 20, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.nft-video-cover {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 16px;
}

/* ── Utility classes for inline-style elimination ─────────────────────── */

/* Notification centre full-screen modal overlay */
.nc-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 10, 46, 0.95); z-index: 9999;
  overflow-y: auto; backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}

/* WebSocket status dot (base.html) */
.ws-status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #8583ab;
  display: inline-block; position: fixed; bottom: 12px; right: 12px;
  z-index: 1000; opacity: 0.7; transition: background 0.3s;
}

/* Metadata editor tag badge */
.meta-tag-badge {
  display: inline-block; padding: 4px 10px; margin: 3px; border-radius: 8px;
  background: rgba(139,92,246,0.15); color: #c4b5fd; font-size: 0.78rem;
}

/* NFT dashboard audio wrapper */
.nft-audio-wrap {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
}

/* Marketplace filter chevron */
.mp-filter-chevron {
  font-size: 0.65rem; transition: transform 0.2s; cursor: pointer; margin-left: auto;
}

/* NFT management — card grid layouts */
.nft-mgmt-card {
  background: rgba(14,16,72,0.6); border: 1px solid rgba(139,92,246,0.1);
  border-radius: 10px;
}
.nft-select-grid-single {
  display: grid; gap: 12px; margin: 0 auto;
  grid-template-columns: 1fr; max-width: 260px;
}
.nft-select-grid-multi {
  display: grid; gap: 12px; margin: 0 auto;
  grid-template-columns: repeat(2,1fr); max-width: 480px;
}
.nft-select-thumb {
  position: relative; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 2px solid rgba(139,92,246,0.15); transition: all 0.2s;
  aspect-ratio: 1/1; width: 100%; background: rgba(0,0,0,0.3); box-sizing: border-box;
}
.nft-select-thumb-inner {
  position: relative; border-radius: 10px; overflow: hidden;
  aspect-ratio: 1; background: rgba(0,0,0,0.3);
}

/* NFT management — upload toggle buttons */
.nft-upload-btn-active {
  background: linear-gradient(135deg,#8b5cf6,#6d28d9); border: none; color: #fff;
  box-shadow: 0 4px 16px rgba(139,92,246,0.3); padding: 10px 20px;
  border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.nft-upload-btn-inactive {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(139,92,246,0.2);
  color: #a78bfa; padding: 10px 20px; border-radius: 12px;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
}

/* Swap divider label */
.swap-route-divider {
  padding: 6px 16px; font-size: 0.7rem; color: var(--swap-accent-cyan, #22d3ee);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}

/* Admin control centre button */
.admin-action-btn {
  padding: 8px 20px; margin-top: 8px;
}

/* ── Swap page (swap-unified.js) ─────────────────────────────────────── */

/* Token autocomplete dropdown */
.swap-autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: rgba(20, 22, 80, 0.95); border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px; max-height: 300px; overflow-y: auto;
  z-index: 1000; margin-top: 4px; backdrop-filter: blur(10px);
}
/* Single autocomplete item row */
.swap-autocomplete-item {
  padding: 10px 12px; border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  transition: background 0.2s;
}
.swap-autocomplete-item:hover { background: rgba(139, 92, 246, 0.15); }

/* Routes comparison wrapper */
.swap-routes-container {
  margin: 16px 0; padding: 16px;
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.2); border-radius: 12px;
}
/* Individual route row (default / secondary) */
.swap-route-row {
  padding: 12px;
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 10px; display: flex; align-items: center;
  gap: 12px; cursor: pointer; transition: all 0.2s;
}
/* Primary (best) route highlight */
.swap-route-row-primary {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
}
/* Sparkline canvas */
.swap-sparkline-canvas {
  margin-top: 8px; border-radius: 6px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

/* ── Wallet page (wallet-index.js) ───────────────────────────────────── */

/* QR modal overlay */
.wallet-qr-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 46, 0.92); backdrop-filter: blur(8px);
}
/* QR code image / canvas */
.wallet-qr-image {
  border-radius: 12px; border: 2px solid rgba(139, 92, 246, 0.2);
  max-width: 200px; display: block; margin: 0 auto;
}

/* ── NFT manager bootstrap (nft-manager-bootstrap.js) ────────────────── */
/* Note: nft-select-grid-single, nft-select-grid-multi, nft-select-thumb
   are already defined above and reused here. */

/* ── NFT manager (nft-manager.js) ────────────────────────────────────── */

/* Attribute editor row */
.nft-attr-row {
  display: flex; gap: 8px; margin-bottom: 8px; align-items: center;
}
/* NFT image full-contain */
.nft-img-contain {
  width: 100%; height: 100%; object-fit: contain;
}

/* ── Wallet manager toasts (wallet_manager.js) ───────────────────────── */

.wallet-toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 99999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.wallet-toast {
  pointer-events: auto; padding: 14px 22px; border-radius: 12px;
  color: #fff; font-size: 14px; font-weight: 500;
  backdrop-filter: blur(12px); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  transform: translateX(120%); transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s;
  opacity: 0;
}

/* ── NFT orders tab (nft-orders-tab.js) ──────────────────────────────── */

.nft-order-row {
  background: rgba(14, 16, 72, 0.6); border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: 10px;
}

/* ── Error boundary (error-boundary.js) ──────────────────────────────── */

.connection-lost-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  padding: 10px 16px;
  background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff;
  font-size: 0.85rem; font-weight: 600; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  animation: slideDown 0.3s ease;
}

/* ── NFT marketplace bootstrap (nft-marketplace-bootstrap.js) ────────── */
/* Note: mp-filter-chevron already defined above */

.nft-mp-thumb {
  position: relative; border-radius: 10px; overflow: hidden;
  aspect-ratio: 1; background: rgba(0, 0, 0, 0.3);
}

/* ── NFT manager iter38 (nft-manager-iter38.js) ──────────────────────── */
/* Note: nft-upload-btn-active / nft-upload-btn-inactive already defined */

/* ── NFT manager iter39 (nft-manager-iter39.js) ──────────────────────── */

/* Lightbox overlay */
.nft-lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 99999;
  background: rgba(4, 2, 18, 0.96); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); transition: opacity 0.3s; opacity: 0;
}
/* Fullscreen button on card */
.nft-fullscreen-btn {
  position: absolute; bottom: 6px; right: 6px; z-index: 5;
  background: rgba(8, 10, 46, 0.85); backdrop-filter: blur(6px);
  border: 1px solid rgba(139, 92, 246, 0.35); border-radius: 8px;
  padding: 5px 8px; color: #a78bfa; font-size: 0.75rem;
  cursor: pointer; transition: all 0.2s; line-height: 1;
}
.nft-fullscreen-btn:hover { background: rgba(139, 92, 246, 0.3); }
/* Marketplace listing action button */
.nft-mp-list-btn {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff;
  border: none; border-radius: 8px; font-weight: 600; font-size: 0.78rem;
  padding: 6px 14px; display: inline-flex; align-items: center; gap: 5px;
}
.nft-mp-list-btn:hover { filter: brightness(1.15); }

@media (max-width: 480px) {
  #cosmic-toast-container {
    bottom: 16px;
    right: 16px;
  }

  .cosmic-toast {
    min-width: 280px;
    max-width: 90vw;
  }
}
