/**
 * @file
 * RPL Share - Sleek Modern Share Button Design.
 */

/* =============================================
   SHARE CONTAINER
   ============================================= */

.rpl-share {
  position: relative;
  display: inline-flex;
}

.rpl-share-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Invisible hit area for easier interaction */
.rpl-share-wrapper::after {
  content: "";
  position: absolute;
  pointer-events: auto; 
}

.rpl-share-wrapper.rpl-share-vertical::after {
  left: 50%;
  transform: translateX(-50%);
  bottom: 50px;         
  width: 90px;           
  height: 28px;          
}

.rpl-share-wrapper.rpl-share-horizontal::after {
  top: 50%;
  transform: translateY(-50%);
  left: 50px;           
  width: 28px;         
  height: 90px;         
}



.rpl-share-dir-left .rpl-share-wrapper.rpl-share-horizontal::after {
  left: auto;
  right: 50px;    
  width: 28px;
  height: 90px;
  top: 50%;
  transform: translateY(-50%);
}

/* Invisible hit area for easier interaction */


/* Vertical Layout (default) - button at bottom, icons pop UP */
.rpl-share-wrapper.rpl-share-vertical {
  flex-direction: column-reverse;
  padding-bottom: 10px;
}

/* Horizontal Layout - button at left, icons pop RIGHT */
.rpl-share-wrapper.rpl-share-horizontal {
  flex-direction: row;
  padding-right: 10px;
}

/* =============================================
   MAIN TRIGGER BUTTON
   ============================================= */

.rpl-share-main-btn {
  width: 50px;
  height: 50px;
  background: #8031A7;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  position: relative;
}

.rpl-share-main-btn:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.rpl-share-main-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.4s ease;
}

/* Hover/Focus State for Main Button */
.rpl-share-wrapper:hover .rpl-share-main-btn,
.rpl-share-wrapper.rpl-share-active .rpl-share-main-btn {
  background: #222;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.rpl-share-wrapper:hover .rpl-share-main-btn svg,
.rpl-share-wrapper.rpl-share-active .rpl-share-main-btn svg {
  transform: rotate(180deg);
}

/* =============================================
   SOCIAL ICONS LIST
   ============================================= */

.rpl-share-social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
  position: absolute;
  
  /* Hidden State */
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  pointer-events: none;
}

/* Vertical: Position above button */
.rpl-share-vertical .rpl-share-social-list {
  flex-direction: column;
  bottom: 65px;
  left: 50%;
  transform: translateX(-50%) translateY(20px) scale(0.8);
}

/* Horizontal: Position to right of button */
.rpl-share-horizontal .rpl-share-social-list {
  flex-direction: row;
  left: 65px;
  top: 50%;
  transform: translateY(-50%) translateX(-20px) scale(0.8);
}

/* Reveal State */
.rpl-share-wrapper:hover .rpl-share-social-list,
.rpl-share-wrapper.rpl-share-active .rpl-share-social-list {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rpl-share-vertical:hover .rpl-share-social-list,
.rpl-share-vertical.rpl-share-active .rpl-share-social-list {
  transform: translateX(-50%) translateY(0) scale(1);
}

.rpl-share-horizontal:hover .rpl-share-social-list,
.rpl-share-horizontal.rpl-share-active .rpl-share-social-list {
  transform: translateY(-50%) translateX(0) scale(1);
}

/* =============================================
   INDIVIDUAL SOCIAL BUTTONS
   ============================================= */

.rpl-share-social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  text-decoration: none;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid;
  position: relative;
  backdrop-filter: blur(5px);
  color: inherit;
}

.rpl-share-social-btn:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.rpl-share-social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* =============================================
   TOOLTIPS
   ============================================= */

.rpl-share-social-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  white-space: nowrap;
  z-index: 100;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Vertical: Tooltip to the left */
.rpl-share-vertical .rpl-share-social-btn::before {
  right: 55px;
  top: 50%;
  transform: translateY(-50%);
}

.rpl-share-vertical .rpl-share-social-btn:hover::before,
.rpl-share-vertical .rpl-share-social-btn:focus::before {
  opacity: 1;
  visibility: visible;
  right: 60px;
}

/* Horizontal: Tooltip above */
.rpl-share-horizontal .rpl-share-social-btn::before {
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
}

.rpl-share-horizontal .rpl-share-social-btn:hover::before,
.rpl-share-horizontal .rpl-share-social-btn:focus::before {
  opacity: 1;
  visibility: visible;
  bottom: 60px;
}

/* =============================================
   BRAND COLORS
   ============================================= */

/* Facebook */
.rpl-share-social-btn.rpl-share-facebook {
  border-color: #1877F2;
  color: #1877F2;
}
.rpl-share-social-btn.rpl-share-facebook:hover,
.rpl-share-social-btn.rpl-share-facebook:focus {
  background: #1877F2;
  color: white;
  box-shadow: 0 0 20px rgba(24, 119, 242, 0.6);
  transform: translateY(-3px);
}

/* X (Twitter) */
.rpl-share-social-btn.rpl-share-x {
  border-color: #000000;
  color: #000000;
}
.rpl-share-social-btn.rpl-share-x:hover,
.rpl-share-social-btn.rpl-share-x:focus {
  background: #000000;
  color: white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  transform: translateY(-3px);
}

/* LinkedIn */
.rpl-share-social-btn.rpl-share-linkedin {
  border-color: #0A66C2;
  color: #0A66C2;
}
.rpl-share-social-btn.rpl-share-linkedin:hover,
.rpl-share-social-btn.rpl-share-linkedin:focus {
  background: #0A66C2;
  color: white;
  box-shadow: 0 0 20px rgba(10, 102, 194, 0.6);
  transform: translateY(-3px);
}

/* WhatsApp */
.rpl-share-social-btn.rpl-share-whatsapp {
  border-color: #25D366;
  color: #25D366;
}
.rpl-share-social-btn.rpl-share-whatsapp:hover,
.rpl-share-social-btn.rpl-share-whatsapp:focus {
  background: #25D366;
  color: white;
  box-shadow: 0 0 20px rgba(37, 211, 102, 0.6);
  transform: translateY(-3px);
}

/* Email */
.rpl-share-social-btn.rpl-share-email {
  border-color: #EA4335;
  color: #EA4335;
}
.rpl-share-social-btn.rpl-share-email:hover,
.rpl-share-social-btn.rpl-share-email:focus {
  background: #EA4335;
  color: white;
  box-shadow: 0 0 20px rgba(234, 67, 53, 0.6);
  transform: translateY(-3px);
}

/* SMS */
.rpl-share-social-btn.rpl-share-sms {
  border-color: #5FC454;
  color: #5FC454;
}
.rpl-share-social-btn.rpl-share-sms:hover,
.rpl-share-social-btn.rpl-share-sms:focus {
  background: #5FC454;
  color: white;
  box-shadow: 0 0 20px rgba(95, 196, 84, 0.6);
  transform: translateY(-3px);
}

/* Pinterest */
.rpl-share-social-btn.rpl-share-pinterest {
  border-color: #E60023;
  color: #E60023;
}
.rpl-share-social-btn.rpl-share-pinterest:hover,
.rpl-share-social-btn.rpl-share-pinterest:focus {
  background: #E60023;
  color: white;
  box-shadow: 0 0 20px rgba(230, 0, 35, 0.6);
  transform: translateY(-3px);
}

/* Copy Link */
.rpl-share-social-btn.rpl-share-copy {
  border-color: #6B7280;
  color: #6B7280;
}
.rpl-share-social-btn.rpl-share-copy:hover,
.rpl-share-social-btn.rpl-share-copy:focus {
  background: #6B7280;
  color: white;
  box-shadow: 0 0 20px rgba(107, 114, 128, 0.6);
  transform: translateY(-3px);
}

/* More (AddToAny) */
.rpl-share-social-btn.rpl-share-more {
  border-color: #0166FF;
  color: #0166FF;
}
.rpl-share-social-btn.rpl-share-more:hover,
.rpl-share-social-btn.rpl-share-more:focus {
  background: #0166FF;
  color: white;
  box-shadow: 0 0 20px rgba(1, 102, 255, 0.6);
  transform: translateY(-3px);
}

/* =============================================
   STAGGERED ANIMATION DELAYS (VERTICAL)
   ============================================= */

.rpl-share-vertical .rpl-share-social-list li:nth-child(1) { transition-delay: 0.2s; }
.rpl-share-vertical .rpl-share-social-list li:nth-child(2) { transition-delay: 0.17s; }
.rpl-share-vertical .rpl-share-social-list li:nth-child(3) { transition-delay: 0.14s; }
.rpl-share-vertical .rpl-share-social-list li:nth-child(4) { transition-delay: 0.11s; }
.rpl-share-vertical .rpl-share-social-list li:nth-child(5) { transition-delay: 0.08s; }
.rpl-share-vertical .rpl-share-social-list li:nth-child(6) { transition-delay: 0.05s; }
.rpl-share-vertical .rpl-share-social-list li:nth-child(7) { transition-delay: 0.02s; }
.rpl-share-vertical .rpl-share-social-list li:nth-child(8) { transition-delay: 0s; }

/* STAGGERED ANIMATION DELAYS (HORIZONTAL) */
.rpl-share-horizontal .rpl-share-social-list li:nth-child(1) { transition-delay: 0s; }
.rpl-share-horizontal .rpl-share-social-list li:nth-child(2) { transition-delay: 0.03s; }
.rpl-share-horizontal .rpl-share-social-list li:nth-child(3) { transition-delay: 0.06s; }
.rpl-share-horizontal .rpl-share-social-list li:nth-child(4) { transition-delay: 0.09s; }
.rpl-share-horizontal .rpl-share-social-list li:nth-child(5) { transition-delay: 0.12s; }
.rpl-share-horizontal .rpl-share-social-list li:nth-child(6) { transition-delay: 0.15s; }
.rpl-share-horizontal .rpl-share-social-list li:nth-child(7) { transition-delay: 0.18s; }
.rpl-share-horizontal .rpl-share-social-list li:nth-child(8) { transition-delay: 0.21s; }

/* =============================================
   TOAST NOTIFICATION
   ============================================= */

.rpl-share-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.rpl-share-toast.rpl-share-toast-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   ACCESSIBILITY
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  .rpl-share-main-btn,
  .rpl-share-main-btn svg,
  .rpl-share-social-list,
  .rpl-share-social-btn,
  .rpl-share-social-btn::before,
  .rpl-share-toast {
    transition: none !important;
  }
  
  .rpl-share-social-list li {
    transition-delay: 0s !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .rpl-share-main-btn {
    border: 3px solid #000;
  }
  
  .rpl-share-social-btn {
    border-width: 3px;
  }
}

/* Screen reader only */
.rpl-share-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 480px) {
  .rpl-share-main-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  
  .rpl-share-main-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .rpl-share-social-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .rpl-share-social-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .rpl-share-vertical .rpl-share-social-list {
    bottom: 55px;
  }
  
  .rpl-share-horizontal .rpl-share-social-list {
    left: 55px;
  }
  
  .rpl-share-social-list {
    gap: 8px;
  }
}

/* =============================================
   TOUCH DEVICE SUPPORT
   ============================================= */

@media (hover: none) {
  /* On touch devices, make active state toggle on tap */
  .rpl-share-wrapper.rpl-share-touch-active .rpl-share-main-btn {
    background: #222;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  }
  
  .rpl-share-wrapper.rpl-share-touch-active .rpl-share-main-btn svg {
    transform: rotate(180deg);
  }
  
  .rpl-share-wrapper.rpl-share-touch-active .rpl-share-social-list {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  
  .rpl-share-vertical.rpl-share-touch-active .rpl-share-social-list {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  
  .rpl-share-horizontal.rpl-share-touch-active .rpl-share-social-list {
    transform: translateY(-50%) translateX(0) scale(1);
  }
}





.rpl-share-dir-left .rpl-share-horizontal .rpl-share-social-list {
  right: 65px;
  left: auto;
  transform: translateY(-50%) translateX(20px) scale(0.8);
}

.rpl-share-dir-left .rpl-share-horizontal:hover .rpl-share-social-list,
.rpl-share-dir-left .rpl-share-horizontal.rpl-share-active .rpl-share-social-list,
.rpl-share-dir-left .rpl-share-horizontal.rpl-share-touch-active .rpl-share-social-list {
  transform: translateY(-50%) translateX(0) scale(1);
}

/* VERTICAL → DOWN */
.rpl-share-dir-down .rpl-share-vertical .rpl-share-social-list {
  top: 65px;
  bottom: auto;
  transform: translateX(-50%) translateY(-20px) scale(0.8);
}

.rpl-share-dir-down .rpl-share-vertical:hover .rpl-share-social-list,
.rpl-share-dir-down .rpl-share-vertical.rpl-share-active .rpl-share-social-list,
.rpl-share-dir-down .rpl-share-vertical.rpl-share-touch-active .rpl-share-social-list {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Tooltips for DOWN */
.rpl-share-dir-down .rpl-share-vertical .rpl-share-social-btn::before {
  left: 55px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
}

.rpl-share-dir-down .rpl-share-vertical .rpl-share-social-btn:hover::before,
.rpl-share-dir-down .rpl-share-vertical .rpl-share-social-btn:focus::before {
  left: 60px;
}



.rpl-share-align-right {
  margin-left: auto;
}

@media (max-width: 480px) {
  .rpl-share {
    zoom: 0.8;
  }
}
