/**
 * Hello Plataforma · Wallet Modals
 *
 * Modales tip y PPV unlock que aparecen desde abajo.
 * Reusa el patrón visual del modal de aprobación.
 */


/* ============================================================
   MODAL OVERLAY
   ============================================================ */

.hp-wm-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.hp-wm-modal.is-visible {
  display: flex;
}

.hp-wm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 14, 22, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: hpFadeIn 200ms ease-out;
}

.hp-wm-modal-sheet {
  position: relative;
  background: var(--hp-bg-primary);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 16px 20px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  animation: hpSlideUp 350ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 32px -4px rgba(0, 0, 0, 0.30);
}

.hp-wm-modal-handle {
  width: 36px;
  height: 4px;
  background: var(--hp-border-subtle);
  border-radius: 99px;
  margin: 0 auto 16px;
}


/* ============================================================
   HEADER
   ============================================================ */

.hp-wm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hp-wm-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--hp-font-base);
  font-size: 18px;
  font-weight: 700;
  color: var(--hp-text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}

.hp-wm-title i {
  color: var(--hp-purple-deep);
  font-size: 22px;
}

.hp-wm-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--hp-bg-card);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hp-text-tertiary);
}

.hp-wm-close:hover {
  background: var(--hp-border-subtle);
}

.hp-wm-close i {
  font-size: 18px;
}


/* ============================================================
   BALANCE STRIP (saldo actual)
   ============================================================ */

.hp-wm-balance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--hp-bg-card);
  border-radius: 10px;
  margin-bottom: 16px;
}

.hp-wm-balance-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--hp-font-base);
  font-size: 12px;
  color: var(--hp-text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hp-wm-balance-label i {
  font-size: 14px;
  color: var(--hp-purple-deep);
}

.hp-wm-balance-value {
  font-family: var(--hp-font-base);
  font-size: 16px;
  font-weight: 700;
  color: var(--hp-text-primary);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}


/* ============================================================
   CHIPS DE TIP
   ============================================================ */

.hp-wm-tip-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.hp-wm-tip-chip {
  padding: 14px;
  background: var(--hp-bg-primary);
  border: 1px solid var(--hp-border-subtle);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--hp-font-base);
  font-size: 17px;
  font-weight: 700;
  color: var(--hp-text-primary);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: -0.3px;
  transition: all var(--hp-duration-normal) var(--hp-ease);
}

.hp-wm-tip-chip:hover {
  border-color: var(--hp-purple);
  transform: translateY(-1px);
}

.hp-wm-tip-chip.is-selected {
  border-color: var(--hp-purple-deep);
  background: linear-gradient(135deg, rgba(212, 191, 232, 0.20) 0%, rgba(168, 135, 208, 0.10) 100%);
  box-shadow: 0 0 0 3px rgba(149, 117, 205, 0.15);
  color: var(--hp-purple-anchor);
}


/* ============================================================
   CUSTOM AMOUNT INPUT
   ============================================================ */

.hp-wm-amount-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--hp-bg-primary);
  border: 1px solid var(--hp-border-subtle);
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 12px;
  transition: border-color var(--hp-duration-normal) var(--hp-ease);
}

.hp-wm-amount-input-wrap:focus-within {
  border-color: var(--hp-purple);
  box-shadow: 0 0 0 3px rgba(149, 117, 205, 0.15);
}

.hp-wm-amount-input-wrap span {
  font-family: var(--hp-font-base);
  font-size: 17px;
  font-weight: 600;
  color: var(--hp-text-primary);
}

.hp-wm-amount-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 12px 0;
  font-family: var(--hp-font-base);
  font-size: 17px;
  font-weight: 700;
  color: var(--hp-text-primary);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.hp-wm-amount-input-wrap input::-webkit-inner-spin-button,
.hp-wm-amount-input-wrap input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


/* ============================================================
   MESSAGE INPUT (opcional para tips)
   ============================================================ */

.hp-wm-message-input {
  width: 100%;
  border: 1px solid var(--hp-border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--hp-font-base);
  font-size: 14px;
  color: var(--hp-text-primary);
  background: var(--hp-bg-primary);
  outline: none;
  resize: none;
  min-height: 60px;
  margin-bottom: 16px;
  transition: border-color var(--hp-duration-normal) var(--hp-ease);
}

.hp-wm-message-input:focus {
  border-color: var(--hp-purple);
  box-shadow: 0 0 0 3px rgba(149, 117, 205, 0.15);
}

.hp-wm-message-input::placeholder {
  color: var(--hp-text-tertiary);
}


/* ============================================================
   PPV UNLOCK PREVIEW
   ============================================================ */

.hp-wm-ppv-preview {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--hp-bg-card);
  border-radius: 14px;
  margin-bottom: 16px;
  align-items: center;
}

.hp-wm-ppv-preview-thumb {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: var(--hp-bg-secondary);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.hp-wm-ppv-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px);
  transform: scale(1.1);
}

.hp-wm-ppv-preview-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(149, 117, 205, 0.30);
}

.hp-wm-ppv-preview-lock i {
  font-size: 28px;
  color: #FFFFFF;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.40));
}

.hp-wm-ppv-preview-content {
  flex: 1;
  min-width: 0;
}

.hp-wm-ppv-preview-title {
  font-family: var(--hp-font-base);
  font-size: 13px;
  font-weight: 600;
  color: var(--hp-text-primary);
  margin: 0;
  line-height: 1.3;
}

.hp-wm-ppv-preview-sub {
  font-family: var(--hp-font-base);
  font-size: 11px;
  color: var(--hp-text-tertiary);
  margin: 2px 0 6px;
}

.hp-wm-ppv-preview-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--hp-gradient-purple-button);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 99px;
  font-family: var(--hp-font-base);
  font-size: 13px;
  font-weight: 700;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}


/* ============================================================
   SUMMARY CARD (oscura, antes de confirmar)
   ============================================================ */

.hp-wm-summary {
  background: var(--hp-gradient-dark-card);
  color: #FFFFFF;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.hp-wm-summary::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 135, 208, 0.20) 0%, transparent 70%);
}

.hp-wm-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  font-family: var(--hp-font-base);
  font-size: 13px;
  padding: 4px 0;
}

.hp-wm-summary-row span:first-child {
  color: rgba(212, 191, 232, 0.80);
}

.hp-wm-summary-row span:last-child {
  color: #FFFFFF;
  font-weight: 600;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.hp-wm-summary-row--total {
  border-top: 0.5px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
  margin-top: 4px;
  font-size: 15px;
}

.hp-wm-summary-row--total span:last-child {
  font-size: 17px;
  font-weight: 800;
}


/* ============================================================
   INSUFFICIENT BALANCE STATE
   ============================================================ */

.hp-wm-insufficient {
  text-align: center;
  padding: 12px 0 4px;
}

.hp-wm-insufficient-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(217, 119, 87, 0.15) 0%, rgba(217, 119, 87, 0.05) 100%);
  border: 0.5px solid rgba(217, 119, 87, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.hp-wm-insufficient-icon i {
  font-size: 26px;
  color: var(--hp-amber-warning);
}

.hp-wm-insufficient-title {
  font-family: var(--hp-font-base);
  font-size: 16px;
  font-weight: 700;
  color: var(--hp-text-primary);
  margin: 0;
}

.hp-wm-insufficient-sub {
  font-family: var(--hp-font-base);
  font-size: 13px;
  color: var(--hp-text-secondary);
  margin: 6px 0 16px;
  line-height: 1.5;
}

.hp-wm-insufficient-sub strong {
  color: var(--hp-purple-deep);
  font-weight: 700;
}


/* ============================================================
   ACCIONES
   ============================================================ */

.hp-wm-actions {
  display: grid;
  gap: 8px;
}


/* ============================================================
   TIPS RECEIVED SECTION (panel de María)
   ============================================================ */

.hp-tips-section {
  margin-top: 24px;
}

.hp-tips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.hp-tip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(201, 169, 97, 0.06) 0%, rgba(201, 169, 97, 0.02) 100%);
  border: 0.5px solid rgba(201, 169, 97, 0.20);
  border-radius: 14px;
}

.hp-tip-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #C9A961 0%, #B59544 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.hp-tip-item-icon i {
  font-size: 18px;
  color: #FFFFFF;
}

.hp-tip-item-content {
  flex: 1;
  min-width: 0;
}

.hp-tip-item-title {
  font-family: var(--hp-font-base);
  font-size: 13px;
  color: var(--hp-text-primary);
  margin: 0;
  line-height: 1.3;
}

.hp-tip-item-title strong {
  font-weight: 700;
}

.hp-tip-item-meta {
  font-family: var(--hp-font-base);
  font-size: 11px;
  color: var(--hp-text-tertiary);
  margin: 2px 0 0;
}

.hp-tip-item-message {
  font-family: var(--hp-font-base);
  font-size: 12px;
  font-style: italic;
  color: var(--hp-text-secondary);
  margin: 4px 0 0;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.50);
  border-radius: 6px;
  border-left: 2px solid rgba(201, 169, 97, 0.40);
}

.hp-tip-item-amount {
  font-family: var(--hp-font-base);
  font-size: 16px;
  font-weight: 800;
  color: #B59544;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  flex-shrink: 0;
}
