/* ========================================
   GLOBAL FEATURES - Gift Card Landing Page
   ======================================== */

/* ----------------------------------------
   1. HEADER LAYOUT
   ---------------------------------------- */
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

/* ----------------------------------------
   2. REWARDS BADGE
   ---------------------------------------- */
.rewards-badge {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.rewards-badge:hover {
  background: rgba(255, 255, 255, 0.1);
}

.badge-icon {
  font-size: 1.25rem;
  animation: bounce-gentle 2s ease-in-out infinite;
}

@keyframes bounce-gentle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.badge-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: #1a1a2e; /* Solid dark background */
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

.rewards-badge:hover .badge-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.badge-dropdown-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  transition: background 0.2s ease;
  text-decoration: none;
  color: var(--text-primary);
}

.badge-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.badge-item img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
}

.badge-item-info {
  flex: 1;
}

.badge-item-brand {
  font-weight: 600;
  font-size: 0.875rem;
}

.badge-item-value {
  font-size: 0.75rem;
  color: #22c55e;
  font-weight: 600;
}

.badge-item-arrow {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* Hidden by default */
.rewards-badge[data-count="0"] {
  display: none;
}

/* ----------------------------------------
   3. RESPONSIVE
   ---------------------------------------- */
@media (max-width: 768px) {
  .header-right {
    gap: var(--spacing-sm);
  }

  .badge-dropdown {
    /* Compact dropdown on mobile */
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 200px;
    max-width: 220px;
    max-height: 200px;
    overflow-y: auto;
    transform: translateY(-10px);
  }

  .rewards-badge:hover .badge-dropdown {
    transform: translateY(0);
  }

  .badge-dropdown-header {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .badge-item {
    padding: 8px 10px;
    gap: 8px;
  }

  .badge-item img {
    width: 24px;
    height: 24px;
  }

  .badge-item-brand {
    font-size: 0.75rem;
  }

  .badge-item-value {
    font-size: 0.625rem;
  }
}

/* ----------------------------------------
   4. STATUS BAR (Footer fixed bar - always visible)
   ---------------------------------------- */
.status-bar {
  background: rgba(0, 0, 0, 0.95) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--spacing-sm) 0;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999 !important;
  transform: translateZ(0); /* Force GPU layer */
  -webkit-transform: translateZ(0);
}

.status-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.status-bar .status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-status 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

@keyframes pulse-status {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.status-bar .status-text {
  color: #22c55e;
  font-weight: 600;
}

.status-divider {
  color: rgba(255, 255, 255, 0.2);
}

.status-users {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.users-icon {
  font-size: 1rem;
}

.users-count {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 32px;
  text-align: center;
  transition: all 0.3s ease;
}

.users-count.updating {
  transform: scale(1.1);
  color: var(--primary);
}

@media (max-width: 768px) {
  .status-content {
    font-size: 0.75rem;
    gap: var(--spacing-sm);
  }

  .users-text {
    display: none;
  }
}

/* Add padding to body so content doesn't get hidden behind fixed status bar */
body {
  padding-bottom: 50px;
}

/* ----------------------------------------
   5. SOCIAL PROOF NOTIFICATIONS
   ---------------------------------------- */
.social-proof-container {
  position: fixed;
  bottom: 70px;
  right: 20px;
  z-index: 99998;
  pointer-events: none;
}

.social-proof-notification {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: slideInRight 0.4s ease-out;
  pointer-events: auto;
}

.social-proof-notification.is-current-user {
  border-color: #22c55e;
  box-shadow: 0 10px 40px rgba(34, 197, 94, 0.3);
}

.social-proof-notification.hiding {
  animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.sp-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sp-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sp-content {
  flex: 1;
  min-width: 0;
}

.sp-user {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: "Consolas", "Monaco", monospace;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-proof-notification.is-current-user .sp-user {
  color: #22c55e;
  font-weight: 600;
}

.sp-message {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.sp-message strong {
  color: #fbbf24;
}

.sp-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sp-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* ----------------------------------------
   6. USER ID IN STATUS BAR
   ---------------------------------------- */
.status-user-id {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.user-id-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.user-id-value {
  color: var(--primary);
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ----------------------------------------
   7. MOBILE RESPONSIVE - SOCIAL PROOF
   ---------------------------------------- */
@media (max-width: 768px) {
  .social-proof-container {
    left: auto;
    right: 10px;
    bottom: 60px;
  }

  .social-proof-notification {
    min-width: auto;
    max-width: none;
    padding: 10px 12px;
    gap: 10px;
  }

  .sp-icon {
    width: 32px;
    height: 32px;
  }

  .sp-icon img {
    width: 22px;
    height: 22px;
  }

  .sp-user {
    font-size: 0.625rem;
  }

  .sp-message {
    font-size: 0.75rem;
  }

  .sp-close {
    width: 20px;
    height: 20px;
    font-size: 0.875rem;
  }

  .status-user-id {
    gap: 4px;
  }

  .user-id-label {
    display: none;
  }

  .user-id-value {
    font-size: 0.625rem;
  }
}
