/* Popup Container */
#spn-container {
    position: fixed;
    z-index: 999999;
}

/* Position Classes */
#spn-container[data-position="top-left"] {
    top: 20px;
    left: 20px;
}

#spn-container[data-position="top-right"] {
    top: 20px;
    right: 20px;
}

#spn-container[data-position="bottom-left"] {
    bottom: 20px;
    left: 20px;
}

#spn-container[data-position="bottom-right"] {
    bottom: 20px;
    right: 20px;
}
#spn-container[data-position="middle-right"] {
    bottom: calc(50% - 50px);
    right: 20px;
}

/* Icon Wrapper */
.spn-icon-wrapper {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.spn-icon-wrapper:hover {
    transform: scale(1.1);
}

/* Pulsating Effect */
@keyframes spn-pulsate {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 150, 255, 0.7);
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(0, 150, 255, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 150, 255, 0);
    }
}

.spn-pulsate {
    animation: spn-pulsate var(--pulsate-duration) infinite;
}

/* Icon */
.spn-icon {
    background: rgb(99 163 255);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.spn-icon i {
    font-size: 24px;
}

.spn-icon img {
    border-radius: 50%;
    object-fit: cover;
}

/* Popup */
.spn-popup {
    position: absolute;
    display: none;
    width: 350px;
    max-width: 90vw;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1000000;
}

/* Position adjustments for popup */
#spn-container[data-position="top-left"] .spn-popup {
    left: 0;
    top: 70px;
}

#spn-container[data-position="top-right"] .spn-popup {
    right: 0;
    top: 70px;
}

#spn-container[data-position="bottom-left"] .spn-popup {
    left: 0;
    bottom: 70px;
}

#spn-container[data-position="bottom-right"] .spn-popup {
    right: 0;
    bottom: 70px;
}
#spn-container[data-position="middle-right"] .spn-popup {
    right: 0;
    bottom: calc(50% - 50px);
}

.spn-popup-inner {
    position: relative;
}

/* Close Button */
.spn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s ease;
}

.spn-close:hover {
    background: #ddd;
}

.spn-close i {
    font-size: 14px;
    color: #333;
}

/* Content */
.spn-content {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Animations */
.spn-fadeIn {
    animation: spn-fadeIn 0.5s ease forwards;
}

.spn-fadeOut {
    animation: spn-fadeOut 0.5s ease forwards;
}

.spn-slideInUp {
    animation: spn-slideInUp 0.5s ease forwards;
}

.spn-slideOutDown {
    animation: spn-slideOutDown 0.5s ease forwards;
}

.spn-slideInDown {
    animation: spn-slideInDown 0.5s ease forwards;
}

.spn-slideOutUp {
    animation: spn-slideOutUp 0.5s ease forwards;
}

.spn-slideInLeft {
    animation: spn-slideInLeft 0.5s ease forwards;
}

.spn-slideOutRight {
    animation: spn-slideOutRight 0.5s ease forwards;
}

.spn-slideInRight {
    animation: spn-slideInRight 0.5s ease forwards;
}

.spn-slideOutLeft {
    animation: spn-slideOutLeft 0.5s ease forwards;
}

.spn-zoomIn {
    animation: spn-zoomIn 0.5s ease forwards;
}

.spn-zoomOut {
    animation: spn-zoomOut 0.5s ease forwards;
}

.spn-bounceIn {
    animation: spn-bounceIn 0.75s ease forwards;
}

/* Hidden State */
.spn-hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .spn-popup {
        width: 300px;
    }

    #spn-container[data-position="top-left"],
    #spn-container[data-position="top-right"],
    #spn-container[data-position="bottom-left"],
    #spn-container[data-position="bottom-right"] {
        margin: 10px;
    }

    #spn-container[data-position="top-left"] .spn-popup,
    #spn-container[data-position="bottom-left"] .spn-popup {
        left: -10px;
    }

    #spn-container[data-position="top-right"] .spn-popup,
    #spn-container[data-position="bottom-right"] .spn-popup {
        right: -10px;
    }
}

/* Animation Keyframes */
@keyframes spn-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spn-fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes spn-slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spn-slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(30px);
    }
}

@keyframes spn-slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spn-slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

@keyframes spn-slideInLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spn-slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

@keyframes spn-slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spn-slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

@keyframes spn-zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spn-zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes spn-bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}
