:root {
    --transition: all 0.5s all;
    --redius: 14px;
    --btn-redius: 6px;
    --border: 1px solid #ebebeb;

    /*global color*/
    --brand-color: #fd7e14;
    --brand-color-secondary: #fff4e6;
    --color-primary-50: #030712;
    --color-primary-100: #111827; /*--primary text, level text --*/
    --color-primary-200: #1f2937;
    --color-primary-300: #374151; /*--table text, thead text --*/
    --color-primary-400: #4b5563;
    --color-primary-500: #6b7280; /*--thead text, form-select text, info text --*/
    --color-primary-600: #9ca3af;
    --color-primary-700: #d1d5db; /*--meta --*/
    --color-primary-800: #e5e7eb;
    --color-primary-900: #f3f4f6;
    --color-primary-950: #f9fafb;
    --dl-reverse: #121212; /*--This function inverts the color of background section. --*/
    --white: var(--white) fff;
    --black: #000000;
    --background: #f9f5f2;

    /*alert color*/
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --danger: #dc3545;

    --monospace: "Space Mono", monospace;
}

/* wrap them in some class and tag so they have higher priority then elementor default css */
body.wp-theme-one.wp-theme-one.wp-theme-one {
    /* Bubbles */
    .bps-story-bubbles {
        padding: 0 0 10px;
    }

    .bps-story-bubbles .swiper-wrapper {
        display: flex;
        gap: 5px;
        padding-inline-end: 36px;
    }

    .bps-story-bubbles .swiper-wrapper .bps-bubble:last-child {
        margin-right: 60px;
    }

    .bps-bubble {
        width: 90px;
        flex-shrink: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .bps-bubble.bps-add-story .bps-bubble-bg {
        border: var(--border);
        height: 62px;
        width: 62px;
    }

    .bps-bubble.bps-add-story .bps-bubble-bg {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        margin-bottom: 5px;
        border-radius: 50px !important;
        background: var(--background);
    }

    .bps-bubble-bg {
        width: 70px;
        height: 75px;
        background-size: cover;
        background-position: center;
        position: relative;
        cursor: pointer;
        border-radius: 50% !important;

        /* ROUNDED AVATRS */
        background-size: 0;
    }
    .bps-avatar {
        width: 68px;
        height: 68px !important;
        border-radius: 50%;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        border: 2px solid #ddd;
        padding: 2px;
    }
    .bps-username {
        margin-top: 3px;
        font-size: 13px;
        color: #333;
        word-break: break-word;
        line-height: 20px;
        text-transform: capitalize;
        font-weight: 500;
    }

    .bps-meta-texts {
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* margin-left: 10px; */
    }
    .bps-story-timeago {
        font-size: 12px;
        color: var(--color-primary-800);
    }

    #bps-story-carousel-wrapper {
        position: relative;
        height: 100%;
        transition: all 0.3s ease;
    }
    /* Story Viewer */
    #bps-story-viewer-popup {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 1);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    #bps-story-viewer-popup.bps-visible {
        opacity: 1;
    }

    .bps-story-bars {
        display: flex;
        gap: 6px;
        margin-bottom: 10px;
    }

    .bps-story-bar {
        flex: 1;
        height: 3px;
        background: rgba(255, 255, 255, 0.2);
        overflow: hidden;
    }

    .bps-story-bar span {
        display: block;
        height: 100%;
        width: 0%;
        background: white;
    }

    .swiper-button-prev,
    .swiper-button-next {
        color: #fff;
    }

    #bps-story-close {
        font-size: 32px;
        color: white;
        background: transparent;
        border: none;
        z-index: 10000;
        cursor: pointer;
        padding: 0;
        transform: scale(1.5);
        line-height: 0;
        min-height: 10px;
    }

    .bps-hidden {
        display: none !important;
    }

    .bps-viewer-swiper {
        width: 100%;
        max-width: 500px;
        height: 100%;
        aspect-ratio: 16 / 9;
        position: relative;
        left: 0;
    }
    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }

    .bps-viewer-swiper .swiper-wrapper {
        display: flex;
    }
    .bps-viewer-swiper .swiper-slide {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        width: 100%;
        height: auto;
        margin-top: 40px;
        border-radius: 10px;
        height: 100vh;
        width: 500px;
        visibility: hidden;

        /* transition-property: transform, opacity; */
    }
    .bps-viewer-swiper .swiper-slide.swiper-slide-active {
        visibility: visible;
    }

    .bps-viewer-swiper img,
    .bps-viewer-swiper video {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }

    /* Story Bars */
    .bps-story-bars {
        position: absolute;
        top: 60px;
        left: 10px;
        right: 10px;
        z-index: 10;
        display: flex;
        gap: 5px;
        width: calc(100% - 20px);
    }
    .bps-story-bar {
        flex: 1;
        height: 2px;
        background: rgba(255, 255, 255, 0.3);
        overflow: hidden;
        border-radius: 2px;
        position: relative;
    }
    .bps-story-bar span {
        display: block;
        height: 100%;
        width: 0;
        background: white;
        transition: width 0s;
    }
    .bps-story-bar.filled span {
        width: 100% !important;
    }

    /* Required Swiper classes */

    .bps-story-header {
        display: flex;
        align-items: center;
        gap: 10px;
        color: white;
        font-weight: 600;
        z-index: 10;
    }
    .bps-story-header-main {
        position: absolute;
        top: 80px;
        z-index: 9999;
        justify-content: space-between;
        display: flex;
        width: 500px;
        padding: 0 10px;
    }
    .bps-story-header-main #bps-prev-user,
    .bps-story-header-main #bps-next-user {
        position: absolute;
        top: 45vh;
        right: 5px;
        height: 40px;
        width: 40px;
        padding: 0;
        border-radius: 50px;
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
        svg {
            width: 24px;
            height: 24px;
        }
    }

    .bps-story-header-main #bps-prev-user:disabled,
    .bps-story-header-main #bps-next-user:disabled {
        opacity: 0.1;
    }
    .bps-story-header-main #bps-prev-user {
        right: auto;
        left: 5px;
    }

    /* responsive */

    .bps-story-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #fff;
    }

    .bps-story-username {
        font-size: 14px;
        font-size: #ccc;
    }
    .bps-story-username a {
        color: #fff;
    }

    .bps-bubble.bps-unseen .bps-avatar {
        border: 2px solid #dc2743;
        border-radius: 50%;
        padding: 1.5px;
        background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
        background-clip: content-box, border-box;
        background-origin: border-box;
    }
    .bps-play-icon {
        position: absolute;
        bottom: 6px;
        right: 6px;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        padding: 3px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #bps-story-mute {
        margin-right: 10px;
        background: transparent;
        color: #fff;
        transform: scale(1.5);
    }
    #bps-story-toggle {
        color: #fff;
        border: none;
        padding: 6px 10px;
        background: transparent;
        margin-left: auto;
        transform: scale(1.5);
    }

    #bps-story-toggle svg {
        margin-top: 15px;
        transform: scale(2);
    }

    .bps-exit-transition {
        animation: bpsFadeOut 300ms ease forwards;
        perspective: 500px;
    }

    .bps-user-transition {
        opacity: 0;
        transform: scale(0.96) rotateY(10deg);
        transition: all 0.3s ease;
    }

    /* UPLOAD OVERLAY */
    .bps-upload-overlay {
        position: fixed;
        z-index: 9999;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .bps-upload-box {
        background: #fff;
        padding: 30px;
        text-align: center;
        border-radius: 10px;
        max-width: 400px;
        width: 90%;
    }
    .bps-upload-progress {
        width: 100%;
        height: 6px;
        background: #eee;
        margin-top: 20px;
        overflow: hidden;
        border-radius: 4px;
    }
    .bps-upload-progress span {
        display: block;
        height: 100%;
        width: 0;
        background: #4caf50;
        transition: width 0.3s ease-in-out;
    }

    /* Progress rigns */
    .bps-bubble .bps-bubble-bg {
        position: relative;
    }

    /* Show loader when uploading */
    .bps-bubble.bps-uploading .bps-ring-wrapper {
        opacity: 1;
    }

    /* STORY OPTIONS WRAPPER */
    .bps-story-options-wrapper {
        position: relative;
    }

    .bps-story-options-wrapper button {
        background: transparent;
        color: #fff;
        margin: 0;
        padding: 10px 20px 6px 0 !important;
    }

    .bps-story-options-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        background: #222;
        color: #fff;
        border-radius: 5px;
        padding: 6px 0;
        min-width: 120px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        z-index: 99;
        display: none;
    }
    .bps-story-options-dropdown button {
        display: block;
        width: 100%;
        background: none;
        border: none;
        color: inherit;
        text-align: left;
        padding: 8px 12px !important;
        cursor: pointer;
    }

    .bps-story-options-dropdown button:hover {
        background: #333;
    }

    .bps-story-options-wrapper {
        position: relative;
        display: inline-block;
    }
    .bps-story-options-wrapper:focus-within .bps-story-options-dropdown {
        display: block;
    }
}

@media screen and (max-width: 500px) {
    body.wp-theme-one.wp-theme-one.wp-theme-one {
        .bps-story-bars {
            top: 65px;
            width: 114%;
            left: -7%;
        }
        .bps-story-header-main {
            padding: 0 15px;
            top: 75px;
            width: 100%;
        }
    }
}

@media screen and (max-width: 600px) {
    body.wp-theme-one.wp-theme-one.wp-theme-one {
        .bps-viewer-swiper .swiper-slide {
            width: 100%;
        }
        .bps-story-header-main #bps-prev-user,
        .bps-story-header-main #bps-next-user {
            right: 65px;
        }
        .bps-story-header-main #bps-prev-user {
            right: auto;
            left: 65px;
        }

        .swiper-button-next,
        .swiper-rtl .swiper-button-prev {
            display: none;
            right: var(--swiper-navigation-sides-offset, 50px);
            left: auto;
        }

        .swiper-button-prev,
        .swiper-rtl .swiper-button-next {
            display: none;
            left: var(--swiper-navigation-sides-offset, 50px);
            right: auto;
        }

        .bps-story-bars {
            padding-right: 36px;
            padding-left: 36px;
        }
    }
}

@keyframes bpsFadeOut {
    from {
        opacity: 1;
        transform: rotateY(0deg) scale(1);
    }
    to {
        opacity: 0;
        transform: rotateY(90deg) scale(0.95);
    }
}

/* add story */
.bps-add-wrapper {
    cursor: pointer;
    margin-top: 6px !important;
    margin: 0;
}
.bps-add-wrapper .bps-plus {
    width: 24px;
    height: 24px;
    color: var(--color-primary-100);
}
.bps-add-wrapper .story-loading:hover .bps-plus {
    color: var(--brand-color) !important;
}

.bps-add-wrapper .bps-username {
    font-size: 12px;
}

/* story loading */
.story-loading {
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    width:90px;
    height:90px;
    overflow:hidden;
    margin-top: -14px;
}

.story-loading svg {
    fill:none;
    stroke:#8a3ab8;
    stroke-width:2px;
    stroke-dasharray:1;
    stroke-dashoffset:0;
    stroke-linecap:round;
    transition: all 0.5s ease;
    animation: loading 4500ms ease-in-out infinite alternate;
    animation-play-state: paused; /* start paused */
}

.story-loading:hover svg {
    animation:loading 4500ms ease-in-out infinite alternate; /* play infinite hover */
}

.story-loading.is-active svg {
    animation-play-state: running; /* play during upload */
}

.story-loading.is-done svg {
    animation: none; /* completely stop animation when done */
}

@keyframes loading {
100% {
        stroke:#cd476b;
        stroke-dasharray:10;
        transform:rotate(200deg);
    }
}
