/**
 * LM Call Button - Frontend Styles
 * Modern CSS with animations
 */

/* CSS Variables */
:root {
    --lm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container */
.lm-call-buttons {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
}

.lm-call-buttons[data-position="right"] {
    right: 20px;
}

.lm-call-buttons[data-position="left"] {
    left: 20px;
}

/* Button Container */
.lm-btn-container {
    position: fixed;
    z-index: 99998;
    pointer-events: auto;
}

.lm-call-buttons[data-position="right"] .lm-btn-container {
    right: 20px;
}

.lm-call-buttons[data-position="left"] .lm-btn-container {
    left: 20px;
}

/* Overlay */
.lm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lm-overlay.active {
    display: block;
    opacity: 1;
}

/* Main Button */
.lm-main-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--lm-transition);
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.lm-main-btn:hover {
    transform: scale(1.1);
}

.lm-main-btn i {
    font-size: 24px;
    line-height: 1;
}

.lm-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Style Variations */
.style1 .lm-main-btn {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.style1 .lm-main-btn:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.style2 .lm-main-btn {
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.style3 .lm-main-btn {
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(255, 255, 255, 0.2);
}

.style3 .lm-main-btn:hover {
    transform: scale(1.15);
}

/* Button List */
.lm-btn-list {
    position: absolute;
    bottom: calc(100% + 15px);
    background: white;
    border-radius: 16px;
    padding: 12px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: var(--lm-transition);
    min-width: 200px;
    max-width: 300px;
    z-index: 1;
}

.lm-btn-list.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lm-btn-list.right-align {
    right: calc(100% + 10px);
    bottom: 0;
}

.lm-btn-list.left-align {
    left: calc(100% + 10px);
    bottom: 0;
}

/* Button Items */
.lm-btn-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    transition: var(--lm-transition);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    margin-bottom: 6px;
}

.lm-btn-item:last-child {
    margin-bottom: 0;
}

.lm-btn-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lm-btn-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.lm-btn-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 50%;
}

/* ============================================
   EFFECTS - Button Animations
   ============================================ */

/* Wave Effect */
.lm-effect-wave {
    animation: lm-wave 2s ease-in-out infinite;
}

@keyframes lm-wave {
    0% {
        box-shadow: 0 0 0 0 rgba(233, 30, 99, 0.6);
    }

    50% {
        box-shadow: 0 0 0 20px rgba(233, 30, 99, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(233, 30, 99, 0);
    }
}

.lm-effect-wave::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    animation: lm-wave-ring 2s ease-out infinite;
    border: 3px solid currentColor;
    opacity: 0;
}

@keyframes lm-wave-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Pulse Effect */
.lm-effect-pulse {
    animation: lm-pulse 2s ease-in-out infinite;
}

@keyframes lm-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* Bounce Effect */
.lm-effect-bounce {
    animation: lm-bounce 2s ease infinite;
}

@keyframes lm-bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-8px);
    }
}

/* Glow Effect */
.lm-effect-glow {
    animation: lm-glow 2s ease-in-out infinite;
}

@keyframes lm-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3),
            0 0 10px rgba(255, 255, 255, 0.2),
            0 0 15px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.6),
            0 0 20px rgba(255, 255, 255, 0.4),
            0 0 30px rgba(255, 255, 255, 0.2);
    }
}

/* Spin Effect */
.lm-effect-spin {
    animation: lm-spin 4s linear infinite;
}

@keyframes lm-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.lm-effect-spin i,
.lm-effect-spin img {
    animation: lm-spin-reverse 4s linear infinite;
}

@keyframes lm-spin-reverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* Shake Effect */
.lm-effect-shake {
    animation: lm-shake 0.82s cubic-bezier(.36, .07, .19, .97) infinite;
}

@keyframes lm-shake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

/* Flash Effect */
.lm-effect-flash {
    animation: lm-flash 2s ease-in-out infinite;
}

@keyframes lm-flash {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0.4;
    }
}

/* Rubber Band Effect */
.lm-effect-rubberband {
    animation: lm-rubberband 1.5s ease-in-out infinite;
}

@keyframes lm-rubberband {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scaleX(1.25) scaleY(0.75);
    }

    40% {
        transform: scaleX(0.75) scaleY(1.25);
    }

    50% {
        transform: scaleX(1.15) scaleY(0.85);
    }

    65% {
        transform: scaleX(0.95) scaleY(1.05);
    }

    75% {
        transform: scaleX(1.05) scaleY(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* Swing Effect */
.lm-effect-swing {
    transform-origin: top center;
    animation: lm-swing 1.5s ease-in-out infinite;
}

@keyframes lm-swing {
    20% {
        transform: rotate(15deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    60% {
        transform: rotate(5deg);
    }

    80% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Tada Effect */
.lm-effect-tada {
    animation: lm-tada 1.5s ease-in-out infinite;
}

@keyframes lm-tada {
    0% {
        transform: scale(1) rotate(0);
    }

    10%,
    20% {
        transform: scale(0.9) rotate(-3deg);
    }

    30%,
    50%,
    70%,
    90% {
        transform: scale(1.1) rotate(3deg);
    }

    40%,
    60%,
    80% {
        transform: scale(1.1) rotate(-3deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* Wobble Effect */
.lm-effect-wobble {
    animation: lm-wobble 1.5s ease-in-out infinite;
}

@keyframes lm-wobble {
    0% {
        transform: translateX(0%);
    }

    15% {
        transform: translateX(-5px) rotate(-5deg);
    }

    30% {
        transform: translateX(4px) rotate(3deg);
    }

    45% {
        transform: translateX(-3px) rotate(-3deg);
    }

    60% {
        transform: translateX(2px) rotate(2deg);
    }

    75% {
        transform: translateX(-1px) rotate(-1deg);
    }

    100% {
        transform: translateX(0%);
    }
}

/* Jello Effect */
.lm-effect-jello {
    animation: lm-jello 1.5s ease-in-out infinite;
}

@keyframes lm-jello {

    0%,
    100% {
        transform: skewX(0deg) skewY(0deg);
    }

    11.1% {
        transform: skewX(-12.5deg) skewY(-12.5deg);
    }

    22.2% {
        transform: skewX(6.25deg) skewY(6.25deg);
    }

    33.3% {
        transform: skewX(-3.125deg) skewY(-3.125deg);
    }

    44.4% {
        transform: skewX(1.5625deg) skewY(1.5625deg);
    }

    55.5% {
        transform: skewX(-0.78125deg) skewY(-0.78125deg);
    }

    66.6% {
        transform: skewX(0.390625deg) skewY(0.390625deg);
    }

    77.7% {
        transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
    }
}

/* Heartbeat Effect */
.lm-effect-heartbeat {
    animation: lm-heartbeat 1.5s ease-in-out infinite;
}

@keyframes lm-heartbeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.15);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.15);
    }

    70% {
        transform: scale(1);
    }
}

/* Ring Effect */
.lm-effect-ring {
    animation: lm-ring 2s ease-in-out infinite;
}

@keyframes lm-ring {
    0% {
        transform: rotate(0);
    }

    5% {
        transform: rotate(15deg);
    }

    10% {
        transform: rotate(-12deg);
    }

    15% {
        transform: rotate(10deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    25% {
        transform: rotate(6deg);
    }

    30% {
        transform: rotate(-4deg);
    }

    35% {
        transform: rotate(2deg);
    }

    40%,
    100% {
        transform: rotate(0);
    }
}

/* Float Effect */
.lm-effect-float {
    animation: lm-float 3s ease-in-out infinite;
}

@keyframes lm-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* No Effect */
.lm-effect-none {
    animation: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Mobile Responsive */
@media (max-width: 768px) {
    .lm-call-buttons[data-position="right"] {
        right: 15px;
    }

    .lm-call-buttons[data-position="left"] {
        left: 15px;
    }

    .lm-call-buttons[data-position="right"] .lm-btn-container {
        right: 15px;
    }

    .lm-call-buttons[data-position="left"] .lm-btn-container {
        left: 15px;
    }

    .lm-btn-list {
        min-width: 180px;
        padding: 10px;
    }

    .lm-btn-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .lm-main-btn {
        transform: scale(0.9);
    }

    .lm-main-btn:hover {
        transform: scale(1);
    }
}

/* Print - Hide buttons */
@media print {

    .lm-call-buttons,
    .lm-btn-container {
        display: none !important;
    }
}

/* Accessibility */
.lm-main-btn:focus,
.lm-btn-item:focus {
    outline: 3px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .lm-effect-wave,
    .lm-effect-pulse,
    .lm-effect-bounce,
    .lm-effect-glow,
    .lm-effect-spin,
    .lm-effect-shake,
    .lm-effect-flash,
    .lm-effect-rubberband,
    .lm-effect-swing,
    .lm-effect-tada,
    .lm-effect-wobble,
    .lm-effect-jello,
    .lm-effect-heartbeat,
    .lm-effect-ring,
    .lm-effect-float {
        animation: none;
    }

    .lm-effect-wave::before {
        animation: none;
    }

    .lm-btn-list {
        transition: opacity 0.15s ease;
    }
}