/* Skeleton Loader Styles */
.stories-skeleton {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 1rem;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-skeleton::-webkit-scrollbar {
    display: none;
}

@media (max-width: 639px) {
    .stories-skeleton {
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0.5rem;
    }
}

@media (min-width: 640px) {
    .stories-skeleton {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
}

.skeleton-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.skeleton-story-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 0.5rem;
}

.skeleton-story-username {
    width: 60px;
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.stories-skeleton.hidden {
    display: none;
}

/* Custom scrollbar hide for the swiper container */
.swiper-container::-webkit-scrollbar {
    display: none;
}

.swiper-container {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    width: 100%;
    max-width: 100%;
}



.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    width: auto;
    width: auto;
}


.story-container {
    /* Create the gradient border effect */
    background-image: linear-gradient(#fff, #fff),
        linear-gradient(to bottom right, #ffc700, #ff0073);
    background-origin: border-box;
    background-clip: content-box, border-box;
    border: 2px solid transparent;
    width: var(--storylm-container-width, 64px);
    height: var(--storylm-container-height, 64px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--storylm-border-thickness, 4px);
}

.story-container.active {
    border-color: #d1d5db;
    background-image: none;
    padding: 0;
    border-style: solid;
    border-width: 3px;
}

/* Responsive story container sizes using CSS custom properties */
:root {
    --storylm-container-width: 52px;
    --storylm-container-height: 52px;
    --storylm-border-thickness: 4px;
}

@media (min-width: 768px) {
    :root {
        --storylm-container-width: 60px;
        --storylm-container-height: 60px;
        --storylm-border-thickness: 4px;
    }
}

@media (min-width: 1024px) {
    :root {
        --storylm-container-width: 68px;
        --storylm-container-height: 68px;
        --storylm-border-thickness: 4px;
    }
}

.story-profile-img {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
}

.story-username {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
    color: #4b5563;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.story-badge {
    z-index: 10;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 15px;
    color: white;
    font-weight: 600;
    text-align: center;
    display: block;
    margin: -15px 0 0 0;
}

/* smodal styling */
.smodal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    max-width: 100% !important;
    max-height: 100% !important;
}

.smodal.show {
    opacity: 1;
    visibility: visible;
}

.smodal-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 384px;
    max-height: 90vh;
    /* Changed height to not be full screen */
    overflow: visible;
    border: 15px solid #ffffff14;
    border-radius: 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.smodal-media-container {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    overflow: hidden;
    border-radius: 15px;
}

.smodal-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Swiper Navigation Button Styles */
.swiper-button-prev,
.swiper-button-next {
    color: #fff;
    width: 44px;
    height: 44px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 9999px;
    transition: background-color 0.2s ease;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.swiper-button-prev:after, .swiper-button-next:after {
    font-size: 16px;
}

/* Progress bar styles */
.progress-bar-container {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    z-index: 30;
}

.progress-bar {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    overflow: hidden;
    flex-grow: 1;
}

.progress-bar-fill {
    height: 100%;
    background-color: white;
    width: 0;
    transition: width 0.1s linear;
}

.smodal-close-btn {
    padding: 0px 0px 5px 0;
    position: absolute;
    top: 1.5rem;
    right: 1rem;
    z-index: 40;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    flex-shrink: 0;

    box-sizing: border-box;
}

.smodal-close-btn:hover {
    opacity: 0.75;
    background-color: #1d1d1d;
    color: white;
}

/* Story content overlay */
.story-content-overlay {
    position: absolute;
    bottom: 80px;
    left: 1rem;
    right: 1rem;
    color: white;
    z-index: 20;
}

.story-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.story-description {
    font-size: 0.875rem;
    line-height: 1.25rem;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Stories action buttons */
.story-actions {
    display: flex;
    justify-content: space-around;
    z-index: 999;
    position: relative;
    margin-top: -65px;
}

.story-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: white;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.story-actions button:hover {
    transform: scale(1.1);
}

.story-like-btn.liked i {
    color: #ff0073;
}

/* New Comment smodal styles */
.comment-smodal-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

input.send-comment-story__input.form-control {
    border-radius: 20px;
    border: 1px solid #bfbfbf;
}

.comment-smodal-content-wrapper h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 50vh;
    overflow-y: auto;
}

.comment-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 12px;
    border-bottom: none;
    background: #eee;
    border-radius: 15px;
}


.comment-user-img {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    object-fit: cover;
    margin-right: 10px;
    margin-left: 10px;
}

.comment-body {
    text-align: left;
    flex-grow: 1;
}

.comment-username {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.comment-text {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.25rem;
    margin: 0;
}

.comment-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1rem;
    background: #bfbfbf;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #4b5563;
    border-radius: 150px;
    padding: 0px 12px 5px 12px;
}

.comment-close-btn:hover {
    background: #505050;
    color: #ffffff;
}

.story-container svg {
    position: absolute;
    top: 33%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.5s ease;
}


.story-container:hover img {
    filter: blur(2px) brightness(90%) !important;
}

.story-container:hover svg {
    opacity: 1;
    transition: all 0.3s ease-in-out;
}



.send-comment-story__form {
    margin-top: 1rem;
    position: relative;
}

.send-comment-story__input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
}

.send-comment-story__input:focus {
    border-color: #bfbfbf;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.send-comment-story__btn {
    background: #bfbfbf;
    color: white;
    border: none;
    border-radius: 32px;
    padding: 11px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.send-comment-story__btn:hover {
    background: #1d1d1d;
}

/* Related Products Section */
.related-products-container {
    background-color: #fff;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    text-align: left;
    display: none;
    /* Hidden by default */
    border-radius: 20px;
}

.related-products-container.show {
    display: block;
    /* Show if the story has products */
}

.related-products-container h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100px;
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f9fafb;
}

.swiper-products-carousel img.product-image {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.product-info {
    padding: 0.5rem;
    width: 100%;
}

.product-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 0.75rem;
    color: #4b5563;
    margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .smodal-content-wrapper {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .comment-smodal-content-wrapper {
        max-width: 100%;
        border-radius: 0;
        height: 100vh;
    }
}

/* WordPress specific adjustments */
.storylm-container {
    margin: 1rem 0;
}

.storylm-container .swiper-container {
    overflow: visible;
}

/* Fix for WordPress admin bar */
body.admin-bar .smodal {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .smodal {
        top: 46px;
    }
}

/* Modern Story Loader Styles */
.story-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loader-text {
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Loading state container */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 400px;
    background: rgb(81, 81, 81);
    color: white;
}

.swiper-stories-carousel {
    overflow: hidden;
}