/* ==========================================================================
   WarspectClient Portal — Reusable UI Components
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--t-fast) var(--ease-out),
    background var(--t-fast) ease,
    border-color var(--t-fast) ease,
    box-shadow var(--t-base) ease;
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btnSm {
  min-height: 38px;
  padding: 0 15px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btnFull {
  width: 100%;
}

.btnPrimary {
  background: linear-gradient(135deg, #ef4444 0%, #c81e1e 55%, #991b1b 100%);
  border-color: rgba(252, 165, 165, 0.42);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    var(--shadow-brand);
}

.btnPrimary:hover {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 60%, #b91c1c 100%);
  border-color: rgba(254, 202, 202, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 14px 36px rgba(239, 68, 68, 0.45);
  transform: translateY(-1.5px);
}

.btnGhost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-default);
  box-shadow: var(--rim-top);
}

.btnGhost:hover {
  background: var(--bg-surface-2);
  border-color: var(--border-strong);
  transform: translateY(-1.5px);
}

.btnCta {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn.is-pending {
  background: linear-gradient(135deg, #272b3a 0%, #191c27 100%);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
  box-shadow: none;
}

.btn.is-pending:hover {
  background: linear-gradient(135deg, #32374a 0%, #1f2331 100%);
  transform: none;
}

.iconSvg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Eyebrows & Badges */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.eyebrow i {
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-500), rgba(239, 68, 68, 0.3));
  border-radius: 2px;
  display: inline-block;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.badgeBrand {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(220, 38, 38, 0.14);
  color: #fca5a5;
}

.badgeGreen {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--emerald-soft);
  color: #6ee7b7;
}

.badgeGold {
  border-color: rgba(245, 158, 11, 0.5);
  background: var(--gold-soft);
  color: var(--gold-300);
}

/* Chips */
.chipGroup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chipItem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(5, 5, 7, 0.72);
  color: var(--text-secondary);
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease, background var(--t-fast) ease;
}

.chipItem:hover {
  border-color: var(--border-strong);
  color: #fff;
}

.chipItem.featured {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(220, 38, 38, 0.14);
  color: #fff;
}

/* Surface Card Primitive */
.surfaceCard {
  position: relative;
  min-width: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(21, 24, 34, 0.76) 0%, rgba(13, 15, 22, 0.94) 100%);
  box-shadow: var(--rim-top), var(--shadow-sm);
  transition: border-color var(--t-base) ease, transform var(--t-base) var(--ease-out), box-shadow var(--t-base) ease;
}

.surfaceCard:hover {
  border-color: var(--border-default);
}

/* Command & Hash Copy Widgets */
.cmdField {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cmdLabel {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cmdBox {
  min-width: 0;
  max-width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #06070a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cmdCode {
  min-width: 0;
  flex: 1;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.5;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #e2e8f0;
  background: transparent;
  border: 0;
  padding: 0;
}

.hashBox {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(5, 5, 7, 0.75);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.hashValue {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copyBtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease, color var(--t-fast) ease;
}

.copyBtn:hover {
  border-color: var(--brand-500);
  background: rgba(220, 38, 38, 0.18);
  color: #fff;
}

.copyBtn.copied {
  border-color: var(--emerald-500);
  background: var(--emerald-soft);
  color: #6ee7b7;
}

/* Closing Banner */
.closingBanner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(239, 68, 68, 0.36);
  background:
    radial-gradient(ellipse 65% 85% at 88% 18%, rgba(220, 38, 38, 0.26), transparent 62%),
    linear-gradient(135deg, rgba(19, 21, 30, 0.96) 0%, rgba(10, 11, 16, 0.98) 100%);
  box-shadow: var(--rim-top), var(--shadow-md);
  padding: clamp(26px, 4vw, 44px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.closingBanner h2 {
  margin-top: 10px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
}

.closingBanner p {
  margin-top: 10px;
  color: var(--text-muted);
  max-width: 560px;
  font-size: 15px;
}

/* Modal Lightbox (Cosmetics Inspector) */
.modalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 4, 7, 0.84);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) ease, visibility var(--t-base) ease;
}

.modalBackdrop.open {
  opacity: 1;
  visibility: visible;
}

.modalDialog {
  position: relative;
  width: min(680px, 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  background: linear-gradient(180deg, #141722 0%, #0b0d13 100%);
  box-shadow: var(--rim-top), var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  transform: translateY(12px) scale(0.98);
  transition: transform var(--t-base) var(--ease-out);
}

.modalBackdrop.open .modalDialog {
  transform: translateY(0) scale(1);
}

.modalVisual {
  background: #07080c;
  border-right: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modalVisual img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
}

.modalBody {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.modalClose {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: rgba(5, 5, 7, 0.72);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease;
}

.modalClose:hover {
  border-color: var(--brand-500);
  color: #fff;
}

.modalBody h3 {
  font-size: 24px;
  margin-top: 10px;
}

.modalBody p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-top: 8px;
}

.modalMeta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.modalMetaItem {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(5, 5, 7, 0.65);
}

.modalMetaItem span {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.modalMetaItem strong {
  display: block;
  font-size: 13px;
  color: #fff;
  margin-top: 3px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 260;
  max-width: min(380px, calc(100vw - 32px));
  background: rgba(18, 21, 30, 0.96);
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--t-base) ease, transform var(--t-base) var(--ease-out);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll Reveal */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.js-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
}

.js-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 680px) {
  .modalDialog {
    grid-template-columns: minmax(0, 1fr);
    max-height: 90dvh;
    overflow-y: auto;
  }
  .modalVisual {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .modalVisual img {
    max-width: 180px;
  }
}
