/* ============================================
   JagoEN.com — Viral Growth Engine Styles
   Friend Challenges, Achievement Sharing, Modals
   ============================================ */

/* ─── Friends Modal ─── */
.friends-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.friends-modal {
  background: var(--color-surface);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(99, 102, 241, 0.3);
  transform: scale(0.9);
  animation: scaleIn 0.3s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes scaleIn {
  to { transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.friends-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.friends-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.friends-tab:hover {
  color: var(--color-primary);
}

.friends-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.friends-tab-content {
  display: none;
}

.friends-tab-content.active {
  display: block;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.2s;
}

.friend-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.friend-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.friend-info {
  flex: 1;
}

.friend-name {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.friend-code {
  font-size: 0.85rem;
  color: var(--color-secondary);
  font-family: 'Courier New', monospace;
}

.challenge-card {
  background: var(--color-bg);
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ─── Achievement Share Modal ─── */
.achievement-share-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.achievement-share-content {
  background: var(--color-surface);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
  border: 3px solid rgba(251, 191, 36, 0.5);
  transform: scale(0.9);
  animation: scaleIn 0.3s forwards;
}

.share-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 600;
}

.share-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.share-btn-whatsapp:hover {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.1);
}

.share-btn-facebook:hover {
  border-color: #1877F2;
  background: rgba(24, 119, 242, 0.1);
}

.share-btn-twitter:hover {
  border-color: #1DA1F2;
  background: rgba(29, 161, 242, 0.1);
}

.share-btn-telegram:hover {
  border-color: #0088cc;
  background: rgba(0, 136, 204, 0.1);
}

.share-btn-linkedin:hover {
  border-color: #0077B5;
  background: rgba(0, 119, 181, 0.1);
}

.share-btn-download:hover {
  border-color: var(--color-success);
  background: var(--color-success-bg);
}

/* ─── Achievement Popup (Notification) ─── */
.achievement-popup {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.achievement-popup.show {
  top: 2rem;
}

.achievement-popup-content {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(251, 191, 36, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.3);
  text-align: center;
  min-width: 300px;
  animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.achievement-popup-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.achievement-popup-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.achievement-popup-desc {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

/* ─── Floating Friend Button ─── */
.floating-friend-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
  transition: all 0.3s;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-friend-btn:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.6);
}

.floating-friend-btn::before {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  border-radius: 50%;
  border: 3px solid var(--color-surface);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ─── Share Incentive Banner ─── */
.share-incentive-banner {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.share-incentive-icon {
  font-size: 2rem;
}

.share-incentive-text {
  flex: 1;
}

.share-incentive-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.share-incentive-desc {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ─── Push Notification Prompt ─── */
.push-prompt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.push-prompt-modal {
  background: var(--color-surface);
  border-radius: 20px;
  max-width: 450px;
  width: 100%;
  padding: 2.5rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(99, 102, 241, 0.4);
  transform: scale(0.9);
  animation: scaleIn 0.3s forwards;
}

/* ─── Viral Incentive Cards ─── */
.viral-incentive-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}

.viral-incentive-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.viral-incentive-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.viral-incentive-icon {
  font-size: 2.5rem;
}

.viral-incentive-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

.viral-incentive-reward {
  background: var(--color-success);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ─── Referral Link Copy Box ─── */
.referral-link-box {
  display: flex;
  gap: 0.5rem;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 0.75rem;
  margin: 1rem 0;
}

.referral-link-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  outline: none;
}

.referral-link-copy-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.referral-link-copy-btn:hover {
  background: var(--color-primary-dark);
  transform: scale(1.05);
}

/* ─── Mobile Responsiveness ─── */
@media (max-width: 640px) {
  .friends-modal {
    padding: 1.5rem;
    max-height: 90vh;
  }

  .achievement-share-content {
    padding: 1.5rem;
  }

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

  .floating-friend-btn {
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
  }

  .friends-tabs {
    gap: 0.25rem;
  }

  .friends-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .push-prompt-modal {
    padding: 2rem 1.5rem;
  }

  .viral-incentive-card {
    padding: 1.25rem;
  }
}
