/* ====================================
   WP Instagram Stories - Frontend Styles
   ==================================== */

/* Stories Container */
.wp-stories-container {
    width: 100%;
    overflow: hidden;
    /* margin: 20px 0; */
    padding: 15px 0;
    background: #fff;
}

.wp-stories-wrapper {
    display: flex;
    gap: 3rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.wp-stories-wrapper::-webkit-scrollbar {
    height: 6px;
}

.wp-stories-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.wp-stories-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.wp-stories-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Individual Story Item */
.wp-story-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    min-width: 80px;
}

/* .wp-story-item:hover {
    transform: scale(1.05);
} */

.wp-story-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
     border: 3px solid #347AE2;
    padding: 5px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.wp-story-item:hover .wp-story-thumbnail {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wp-story-thumbnail img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    border-radius: 50% !important;
    background: #fff;
    display: block;
}

.wp-story-title {
    margin-top: 8px;
    font-size: 12px;
    color: #262626;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
    font-weight: 400;
}

/* Popup Modal */
.wp-story-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wp-story-popup.wp-story-popup-active {
    opacity: 1;
    visibility: visible;
}

.wp-story-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.wp-story-popup-content {
    position: relative;
    z-index: 100000;
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.wp-story-popup.wp-story-popup-active .wp-story-popup-content {
    transform: scale(1);
}

.wp-story-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(52, 122, 226, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wp-story-popup-close:hover {
    background: #fff;
    color: #347AE2!important;
    transform: rotate(90deg);
}

.wp-story-popup-video-container {
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: #000; */
    border-radius: 8px;
}

.wp-story-video {
    border-radius: 8px;
    width: 100%;
    height: auto;
    max-height: 90vh;
    display: block;
    outline: none;
}

.wp-story-loading,
.wp-story-error {
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    font-size: 16px;
}

.wp-story-error {
    color: #ff6b6b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-stories-container {
        margin: 15px 0;
        padding: 10px 0;
    }

    .wp-stories-wrapper {
        gap: 12px;
        padding: 0 10px;
    }

    .wp-story-item {
        min-width: 70px;
    }

    .wp-story-thumbnail {
        width: 70px;
        height: 70px;
    }

    .wp-story-title {
        font-size: 11px;
        max-width: 70px;
    }

    .wp-story-popup-content {
        width: 95%;
        max-width: 400px;
    }

    .wp-story-popup-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .wp-story-thumbnail {
        width: 65px;
        height: 65px;
        border-width: 2px;
    }

    .wp-story-title {
        font-size: 10px;
        max-width: 65px;
    }

    .wp-story-popup-video-container {
        min-height: 300px;
    }
}

/* Elementor Compatibility */
.elementor-widget-container .wp-stories-container {
    margin: 0;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wp-stories-container {
        background: #1a1a1a;
    }

    .wp-story-title {
        color: #f5f5f5;
    }
}