/* WP Ru-max Chat Widget Styles */

#wp-ru-max-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.wp-ru-max-icon {
    display: block;
    border-radius: 50%;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    animation: wp-ru-max-bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

.wp-ru-max-icon:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.45) !important;
}

#wp-ru-max-balloon {
    animation: wp-ru-max-fade-up 0.4s ease both;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Typing indicator */
.wp-ru-max-cursor::after {
    content: '|';
    display: inline-block;
    animation: wp-ru-max-blink 0.8s infinite;
    color: #6366f1;
}

/* ---- Base keyframes ---- */
@keyframes wp-ru-max-bounce-in {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { transform: scale(1.1); }
    70%  { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes wp-ru-max-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes wp-ru-max-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ---- Attention animations ---- */

/* Пульсация */
.wp-ru-max-anim-pulse {
    animation: wp-ru-max-pulse 1.8s ease-in-out infinite !important;
}
@keyframes wp-ru-max-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); transform: scale(1); }
    50%  { box-shadow: 0 0 0 16px rgba(99, 102, 241, 0); transform: scale(1.06); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); transform: scale(1); }
}

/* Рябь */
.wp-ru-max-anim-ripple {
    animation: none !important;
    position: relative;
}
.wp-ru-max-anim-ripple::before,
.wp-ru-max-anim-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    transform: translate(-50%, -50%) scale(1);
    animation: wp-ru-max-ripple 2s ease-out infinite;
    pointer-events: none;
}
.wp-ru-max-anim-ripple::after {
    animation-delay: 0.7s;
}
@keyframes wp-ru-max-ripple {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0;   }
}

/* Подпрыгивание */
.wp-ru-max-anim-bounce {
    animation: wp-ru-max-jump 1.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite !important;
}
@keyframes wp-ru-max-jump {
    0%, 100% { transform: translateY(0); }
    20%      { transform: translateY(-14px); }
    40%      { transform: translateY(0px); }
    55%      { transform: translateY(-7px); }
    70%      { transform: translateY(0px); }
}

/* Покачивание */
.wp-ru-max-anim-shake {
    animation: wp-ru-max-shake 1.5s ease-in-out infinite !important;
}
@keyframes wp-ru-max-shake {
    0%, 100% { transform: rotate(0deg); }
    10%      { transform: rotate(-12deg); }
    20%      { transform: rotate(12deg); }
    30%      { transform: rotate(-10deg); }
    40%      { transform: rotate(10deg); }
    50%      { transform: rotate(-6deg); }
    60%      { transform: rotate(6deg); }
    70%      { transform: rotate(0deg); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #wp-ru-max-balloon {
        max-width: 180px !important;
        font-size: 13px !important;
    }

    .wp-ru-max-icon {
        width: 52px !important;
        height: 52px !important;
    }
}

/* ================================================================== */
/* RETENTION MODAL                                                      */
/* ================================================================== */
.wp-ru-max-retention-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: wpRuMaxFadeIn 0.25s ease;
}
.wp-ru-max-retention-modal.show {
    display: flex;
}
@keyframes wpRuMaxFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.wp-ru-max-retention-content {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 420px;
    padding: 24px;
    animation: wpRuMaxSlideUp 0.3s ease;
}
@keyframes wpRuMaxSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.wp-ru-max-retention-header h3 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    color: #222;
}
.wp-ru-max-retention-body p {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #444;
}
.wp-ru-max-retention-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.wp-ru-max-retention-actions button {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.wp-ru-max-retention-actions button:active {
    transform: scale(0.97);
}
.wp-ru-max-retention-stay {
    background: #4a90d9;
    color: #fff;
}
.wp-ru-max-retention-stay:hover {
    background: #3a7bc0;
}
.wp-ru-max-retention-leave {
    background: #f0f0f0;
    color: #555;
}
.wp-ru-max-retention-leave:hover {
    background: #e0e0e0;
}
