/**
 * MLM Profile Preview - Tooltip Styling
 * 
 * Modern styling for user profile preview tooltips in MLM tree
 * 
 * @package BuddyBoss_Theme_Child
 * @since 1.0.0
 */

/* Base tooltip container */
.mlm-preview-tooltip {
  position: absolute;
  width: 320px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 999999;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  display: none;
}

.mlm-preview-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mlm-preview-tooltip.hidden {
  opacity: 0;
  transform: translateY(-10px);
}

/* Preview card */
.mlm-preview-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}

/* Header section */
.mlm-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, #fac500 0%, #f5b800 100%);
  color: #333333;
}

.mlm-preview-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.5);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mlm-preview-header-info {
  flex: 1;
  min-width: 0;
}

.mlm-preview-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mlm-preview-username {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: rgba(51, 51, 51, 0.7);
  line-height: 1.2;
}

/* Body section */
.mlm-preview-body {
  padding: 16px 20px;
  background: #ffffff;
}

/* Account type badge */
.mlm-preview-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Gratis - Minimale styling */
.mlm-badge-gratis,
.mlm-badge-free {
  background: #f5f5f5;
  color: #666666;
  border: 1px solid #e0e0e0;
}

/* Standaard/Brons - Basis styling met brons kleur */
.mlm-badge-standaard,
.mlm-badge-brons,
.mlm-badge-standard,
.mlm-badge-bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #b8722d 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Zilver - Zilver/grijs met shine */
.mlm-badge-zilver,
.mlm-badge-silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
  color: #333333;
  box-shadow: 0 3px 10px rgba(192, 192, 192, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 12px;
  padding: 6px 16px;
}

/* Goud - Opvallend goud met glow */
.mlm-badge-goud,
.mlm-badge-gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  color: #333333;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.4);
  font-size: 12px;
  padding: 7px 18px;
  animation: subtle-glow-gold 2s ease-in-out infinite;
}

/* Platinum/Diamant - Premium met diamant sparkle effect */
.mlm-badge-platinum,
.mlm-badge-diamant,
.mlm-badge-diamond {
  background: linear-gradient(135deg, #e5e4e2 0%, #b9f2ff 50%, #e5e4e2 100%);
  background-size: 200% 200%;
  color: #1a1a1a;
  box-shadow: 0 5px 20px rgba(229, 228, 226, 0.6),
    0 0 30px rgba(185, 242, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-size: 13px;
  padding: 8px 20px;
  font-weight: 800;
  animation: shimmer 3s ease-in-out infinite,
    subtle-glow-platinum 2s ease-in-out infinite;
  position: relative;
}

/* Sparkle effect voor platinum/diamant */
.mlm-badge-platinum::after,
.mlm-badge-diamant::after,
.mlm-badge-diamond::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.8) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  animation: sparkle 3s infinite;
}

@keyframes sparkle {
  0% {
    left: -150%;
  }
  100% {
    left: 150%;
  }
}

/* Goud krijgt ook een subtiel sparkle effect */
.mlm-badge-goud::after,
.mlm-badge-gold::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 60%
  );
  transform: rotate(45deg);
  animation: sparkle 4s infinite;
}

/* Animaties voor premium badges */
@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes subtle-glow-gold {
  0%,
  100% {
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5),
      0 0 20px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.7),
      0 0 25px rgba(255, 215, 0, 0.5);
  }
}

@keyframes subtle-glow-platinum {
  0%,
  100% {
    box-shadow: 0 5px 20px rgba(229, 228, 226, 0.6),
      0 0 30px rgba(185, 242, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
  50% {
    box-shadow: 0 5px 25px rgba(229, 228, 226, 0.8),
      0 0 40px rgba(185, 242, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
}

/* Hover effects voor alle badges */
.mlm-badge-standaard:hover,
.mlm-badge-brons:hover,
.mlm-badge-standard:hover,
.mlm-badge-bronze:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 12px rgba(205, 127, 50, 0.5);
}

.mlm-badge-zilver:hover,
.mlm-badge-silver:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(192, 192, 192, 0.6);
}

.mlm-badge-goud:hover,
.mlm-badge-gold:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.7), 0 0 30px rgba(255, 215, 0, 0.5);
}

.mlm-badge-platinum:hover,
.mlm-badge-diamant:hover,
.mlm-badge-diamond:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(229, 228, 226, 0.8),
    0 0 45px rgba(185, 242, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Bio text */
.mlm-preview-bio {
  margin: 0 0 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #666;
}

/* Meta information */
.mlm-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mlm-preview-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888;
  line-height: 1.3;
}

.mlm-preview-meta-item svg {
  flex-shrink: 0;
  color: #999;
}

.mlm-preview-meta-item span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Footer section */
.mlm-preview-footer {
  padding: 12px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  text-align: center;
}

.mlm-preview-link {
  display: inline-block;
  padding: 8px 20px;
  background: #fac500;
  color: #333333 !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  border: 1px solid #fac500;
}

.mlm-preview-link:hover {
  background: #f5b800;
  border-color: #f5b800;
  transform: translateY(-1px);
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(250, 197, 0, 0.3);
}

.mlm-preview-link:active {
  transform: translateY(0);
}

/* Loading state */
.mlm-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
}

.mlm-preview-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #fac500;
  border-radius: 50%;
  animation: mlm-spinner 0.8s linear infinite;
}

@keyframes mlm-spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.mlm-preview-loading p {
  margin: 0;
  font-size: 13px;
  color: #666;
}

/* Error state */
.mlm-preview-error {
  padding: 30px 20px;
  text-align: center;
}

.mlm-preview-error p {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: #d32f2f;
}

.mlm-preview-error small {
  font-size: 12px;
  color: #999;
  display: block;
}

/* Hover effect op MLM tree nodes */
#rtwapwcm_mlm_show .node .title {
  cursor: pointer !important;
  transition: color 0.2s ease;
}

#rtwapwcm_mlm_show .node .title:hover {
  color: #fac500 !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .mlm-preview-tooltip {
    width: 280px;
  }

  .mlm-preview-header {
    padding: 16px;
  }

  .mlm-preview-avatar {
    width: 50px;
    height: 50px;
  }

  .mlm-preview-name {
    font-size: 15px;
  }

  .mlm-preview-username {
    font-size: 12px;
  }

  .mlm-preview-body {
    padding: 14px 16px;
  }

  .mlm-preview-footer {
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  .mlm-preview-tooltip {
    width: calc(100vw - 40px);
    max-width: 280px;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .mlm-preview-tooltip {
    background: #2d2d2d;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .mlm-preview-card {
    background: #2d2d2d;
  }

  .mlm-preview-body {
    background: #2d2d2d;
  }

  .mlm-preview-bio {
    color: #b0b0b0;
  }

  .mlm-preview-meta-item {
    color: #999;
  }

  .mlm-preview-footer {
    background: #262626;
    border-top-color: #404040;
  }

  .mlm-preview-loading p {
    color: #b0b0b0;
  }
}

/* Skeleton loader alternative (optioneel) */
.mlm-preview-skeleton {
  padding: 20px;
}

.mlm-preview-skeleton-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: mlm-skeleton-loading 1.5s infinite;
}

.mlm-preview-skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: mlm-skeleton-loading 1.5s infinite;
  border-radius: 4px;
  margin: 8px 0;
}

.mlm-preview-skeleton-line.short {
  width: 60%;
}

@keyframes mlm-skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Accessibility improvements */
.mlm-preview-tooltip:focus-within {
  outline: 2px solid #fac500;
  outline-offset: 2px;
}

.mlm-preview-link:focus {
  outline: 2px solid #fac500;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .mlm-preview-tooltip {
    display: none !important;
  }
}
