/* Soul Sparks Animations & Effects */

/* ============================================
   SPARK BUTTON - Now integrated into quick-actions bar
   Standalone floating button is deprecated/hidden
   ============================================ */
.spark-button {
  display: none !important; /* Deprecated - use quick-actions bar instead */
}

.spark-button-label {
  display: none;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
  }
  50% {
    box-shadow: 0 4px 30px rgba(255, 107, 157, 0.7);
  }
}

/* ============================================
   SPARK MODAL
   ============================================ */
.spark-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.spark-modal.active {
  display: flex;
  opacity: 1;
}

.spark-modal-content {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 24px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  position: relative;
  border: 1px solid rgba(255, 107, 157, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modal-pop 0.3s ease;
}

@keyframes modal-pop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.spark-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.spark-modal-close:hover {
  color: #fff;
}

.spark-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.spark-modal-header h2 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.spark-modal-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Amount Selection */
.spark-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.spark-amount-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.spark-amount-btn:hover {
  border-color: rgba(255, 107, 157, 0.5);
  background: rgba(255, 107, 157, 0.1);
}

.spark-amount-btn.selected {
  border-color: #FF6B9D;
  background: rgba(255, 107, 157, 0.2);
}

.spark-amount-btn .emoji {
  font-size: 1.5rem;
}

.spark-amount-btn .amount {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

/* Custom amount input */
.spark-custom-amount {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.spark-custom-amount input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.spark-custom-amount input:focus {
  outline: none;
  border-color: rgba(255, 107, 157, 0.5);
}

.spark-custom-amount input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Note input */
.spark-note {
  margin-bottom: 1.5rem;
}

.spark-note textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  resize: none;
  height: 60px;
  transition: border-color 0.2s;
}

.spark-note textarea:focus {
  outline: none;
  border-color: rgba(255, 107, 157, 0.5);
}

.spark-note textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Send button */
.spark-send-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF6B9D, #C44569);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.spark-send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 107, 157, 0.4);
}

.spark-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   REWARDS MODAL
   ============================================ */
.rewards-modal-content {
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.rewards-header {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}

.rewards-header h2 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.rewards-total {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FF6B9D, #FFB347);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tier progress */
.tier-progress {
  margin-bottom: 1.5rem;
}

.tier-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tier-current {
  color: #FF6B9D;
  font-weight: 600;
}

.tier-next {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.tier-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.tier-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF6B9D, #FFB347);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.tier-needed {
  text-align: right;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Badges section */
.badges-section {
  margin-bottom: 1.5rem;
}

.badges-section h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.badge-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 1.5rem;
  transition: all 0.2s;
  position: relative;
}

.badge-item.earned {
  background: rgba(255, 107, 157, 0.2);
  border: 1px solid rgba(255, 107, 157, 0.4);
}

.badge-item.locked {
  opacity: 0.3;
  filter: grayscale(1);
}

.badge-item:hover {
  transform: scale(1.1);
}

/* Rewards section */
.rewards-section {
  margin-bottom: 1rem;
}

.rewards-section h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.reward-item.unlocked {
  background: rgba(144, 255, 106, 0.1);
  border: 1px solid rgba(144, 255, 106, 0.3);
}

.reward-item.locked {
  opacity: 0.5;
}

.reward-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 1.25rem;
}

.reward-info {
  flex: 1;
}

.reward-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.reward-tier {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.reward-status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.reward-status.unlocked {
  background: rgba(144, 255, 106, 0.2);
  color: #90FF6A;
}

.reward-status.locked {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   CELEBRATION EFFECTS
   ============================================ */
.spark-celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3000;
}

/* Confetti particle */
.confetti-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(-100%) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* Sparkle burst */
.sparkle-burst {
  position: fixed;
  width: 200px;
  height: 200px;
  pointer-events: none;
  z-index: 3001;
}

.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #FFD700;
  border-radius: 50%;
  animation: sparkle-explode 0.8s ease-out forwards;
}

@keyframes sparkle-explode {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* Heart float */
.heart-float {
  position: absolute;
  font-size: 2rem;
  animation: float-up 2s ease-out forwards;
  pointer-events: none;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-150px) scale(1.5);
  }
}

/* Achievement unlock */
.achievement-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 2px solid #FFD700;
  border-radius: 16px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 4000;
  box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
  animation: toast-slide-in 0.5s ease forwards;
}

.achievement-toast.hide {
  animation: toast-slide-out 0.5s ease forwards;
}

@keyframes toast-slide-in {
  to {
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toast-slide-out {
  to {
    transform: translateX(-50%) translateY(-100px);
  }
}

.achievement-emoji {
  font-size: 2.5rem;
  animation: badge-pop 0.5s ease;
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.achievement-text {
  color: #fff;
}

.achievement-title {
  font-weight: 700;
  font-size: 1rem;
  color: #FFD700;
}

.achievement-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   STREAK COUNTER
   ============================================ */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, #FF6B00, #FF9500);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.streak-badge .flame {
  animation: flame-flicker 0.5s ease infinite;
}

@keyframes flame-flicker {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ============================================
   SAVED CARD INFO
   ============================================ */
.saved-card-info {
  margin-bottom: 1rem;
}

.saved-card-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(144, 255, 106, 0.1);
  border: 1px solid rgba(144, 255, 106, 0.3);
  border-radius: 12px;
  font-size: 0.9rem;
  color: #fff;
}

.saved-card-badge .quick-tip-badge {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, #FF6B9D, #FFB347);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  animation: pulse-glow 2s ease-in-out infinite;
}

.no-card-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.no-card-notice a {
  color: #FF6B9D;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.no-card-notice a:hover {
  color: #FFB347;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
  .spark-modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }

  .spark-amounts {
    grid-template-columns: repeat(2, 1fr);
  }

  .badges-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .spark-button {
    bottom: 130px;
    right: 16px;
    width: 52px;
    height: 47px;
  }

  .spark-button svg {
    width: 24px;
    height: 24px;
  }
}

/* ============================================
   SPARK HISTORY
   ============================================ */
.history-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-section h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spark-history-list {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.spark-history-list::-webkit-scrollbar {
  width: 4px;
}

.spark-history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.spark-history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 157, 0.4);
  border-radius: 2px;
}

.spark-history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 107, 157, 0.6);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  transition: background 0.2s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-amount {
  color: #FF6B9D;
  font-weight: 700;
  font-size: 1rem;
}

.history-note {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  font-style: italic;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.history-source {
  font-size: 0.9rem;
}

.history-date {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.history-loading {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

.history-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.history-empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.history-empty p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-size: 0.95rem;
}

.history-empty-hint {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.8rem !important;
  margin-top: 0.25rem !important;
}

.history-error {
  text-align: center;
  padding: 1.5rem;
}

.history-error p {
  color: rgba(255, 107, 157, 0.8);
  margin-bottom: 0.75rem;
}

.history-error button {
  padding: 0.5rem 1rem;
  background: rgba(255, 107, 157, 0.2);
  border: 1px solid rgba(255, 107, 157, 0.4);
  border-radius: 8px;
  color: #FF6B9D;
  cursor: pointer;
  transition: background 0.2s;
}

.history-error button:hover {
  background: rgba(255, 107, 157, 0.3);
}

.load-more-btn {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 107, 157, 0.3);
  color: #fff;
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
