/* RetentionFox Public-Facing CSS */

/* General Widget Styles */
.retentionfox-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #ffffff;
    color: #333;
    padding: 15px 45px 15px 20px; /* Added padding for close button */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 320px;
    font-size: 14px;
    display: none;
    align-items: center;
}

.retentionfox-widget.visible {
    display: flex;
}

.retentionfox-widget-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.retentionfox-close-btn {
    position: absolute;
    top: 5px;
    right: 8px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}
.retentionfox-close-btn:hover {
    color: #333;
}

/* Icon and Waving Hand Styles */
.retentionfox-icon-wrapper {
    position: relative;
    margin-right: 12px;
    flex-shrink: 0;
}
.retentionfox-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #f0f0f0;
}
.retentionfox-hand-img {
    position: absolute;
    bottom: -5px;
    right: -10px;
    width: 24px;
    height: 24px;
    transform-origin: bottom center;
    /* Apply the animation */
    animation: rf-wave-animation 2.5s infinite;
}

/* Branding Styles */
.retentionfox-branding {
    font-size: 10px;
    color: #aaa;
    text-align: right;
    margin-top: 8px;
    position: absolute;
    bottom: 5px;
    right: 15px;
}

.retentionfox-branding a {
    color: #aaa;
    text-decoration: none;
}
.retentionfox-branding a:hover {
    text-decoration: underline;
}


/* Keyframes for waving animation */
@keyframes rf-wave-animation {
    0% { transform: rotate(0.0deg) }
    10% { transform: rotate(14.0deg) }
    20% { transform: rotate(-8.0deg) }
    30% { transform: rotate(14.0deg) }
    40% { transform: rotate(-4.0deg) }
    50% { transform: rotate(10.0deg) }
    60% { transform: rotate(0.0deg) }
    100% { transform: rotate(0.0deg) }
}


/* Exit-Intent Popup Styles */
#retentionfox-exit-intent-popup {
    display: none; /* Initially hidden */
}
#retentionfox-exit-intent-popup .retentionfox-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10001;
}

#retentionfox-exit-intent-popup .retentionfox-popup-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px 40px;
    border-radius: 10px;
    z-index: 10002;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#retentionfox-exit-intent-popup .retentionfox-popup-content h2 {
    margin-top: 0;
    color: #2c3e50;
}


/* Idle nudge: center brand on its own line without changing the pill look */
#rf-idle-nudge { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#rf-idle-nudge .retentionfox-branding {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #9CA3AF;
}
#rf-idle-nudge .retentionfox-branding a { color: #9CA3AF; text-decoration: none; }

/* Exit intent: show brand; on wide screens pin bottom-right of card */
#rf-exit-intent-modal .retentionfox-branding {
  display: block;
  opacity: 1;
  visibility: visible;
  margin-top: 8px;           /* centered under CTA on small screens */
  font-size: 12px;
  color: #9CA3AF;
  text-align: center;
}
#rf-exit-intent-modal .retentionfox-branding a { color: #9CA3AF; text-decoration: none; }

@media (min-width: 520px) {
  .retentionfox-popup .retentionfox-branding {
    position: absolute;
    right: 12px;
    bottom: 8px;
    text-align: right;
    margin-top: 0;
    font-size: 11px;
  }
}

/* Defensive: make sure brand is never hidden by themes */
#rf-idle-nudge .retentionfox-branding,
#rf-exit-intent-modal .retentionfox-branding {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Idle nudge: add breathing room above branding */
#rf-idle-nudge .rf-row { margin-bottom: 10px; }

#rf-idle-nudge .retentionfox-branding {
  width: 100%;
  text-align: center;
  font-size: 11px;
  margin-top: 0;      /* rely on the row gap instead */
}

