@keyframes blink-text {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}


.story-thumbnail {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.story-thumbnail:hover {
    transform: scale(1.05);
}

.thumbnail-image,
.thumbnail-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}


.thumbnail-video::-webkit-media-controls,
.thumbnail-video::-webkit-media-controls-panel,
.thumbnail-video::-webkit-media-controls-play-button,
.thumbnail-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.video-overlay i {
    font-size: 24px;
    opacity: 0.8;
}

.story-thumbnail:hover .video-overlay i {
    opacity: 1;
    transform: scale(1.1);
    transition: all 0.2s ease;
}


@viewport {
    width: device-width;
    initial-scale: 1.0;
    maximum-scale: 1.0;
    user-scalable: no;
}

.frontend-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.frontend-story-modal.show {
    display: block;
}

.frontend-story-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.frontend-story-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.frontend-story-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.frontend-story-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    font-size: 18px;
    transition: background 0.2s ease;
}

.frontend-story-modal-close:hover {
    background: rgba(0, 0, 0, 1);
}

.frontend-story-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.frontend-story-modal-media {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.frontend-story-modal-media img,
.frontend-story-modal-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

.frontend-story-modal-description {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    word-wrap: break-word;
    border-radius: 8px;
    margin: 10px;
}

.frontend-story-modal-description h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.frontend-story-modal-description p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.frontend-story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    backdrop-filter: blur(2px);
    transition: background 0.2s ease;
}

.frontend-story-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.frontend-story-prev {
    left: 8px;
}

.frontend-story-next {
    right: 8px;
}

.frontend-story-nav-btn i {
    font-size: 20px;
    line-height: 1;
}

@media (max-width: 768px) {
    .frontend-story-modal-container {
        padding: 35px 10px 10px 10px;
    }

    .frontend-story-modal-content {
        max-width: 100%;
        max-height: calc(100vh - 70px);
        border-radius: 8px;
    }

    .frontend-story-modal-close {
        top: 25px !important;
        right: 15px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
        z-index: 9999 !important;
        background: rgba(0, 0, 0, 0.9) !important;
        display: flex !important;
        position: absolute !important;
    }

    .frontend-story-nav-btn {
        width: 48px;
        height: 48px;
    }

    .frontend-story-nav-btn i {
        font-size: 20px;
    }

    .frontend-story-modal-description {
        padding: 15px;
        max-height: 150px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 6px;
        margin: 8px;
    }

    .frontend-story-modal-description h3 {
        font-size: 16px;
        color: #fff;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }

    .frontend-story-modal-description p {
        font-size: 13px;
        color: #fff;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

@media (max-width: 480px) {
    .frontend-story-modal-container {
        padding: 30px 5px 5px 5px;
    }

    .frontend-story-modal-content {
        max-height: calc(100vh - 60px);
    }

    .frontend-story-modal-close {
        top: 20px !important;
        right: 12px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
        z-index: 9999 !important;
        background: rgba(0, 0, 0, 0.9) !important;
        display: flex !important;
        position: absolute !important;
    }

    .frontend-story-nav-btn {
        width: 44px;
        height: 44px;
    }

    .frontend-story-nav-btn i {
        font-size: 18px;
    }

    .frontend-story-modal-description {
        padding: 12px;
        max-height: 120px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 6px;
        margin: 6px;
    }
}


@supports (padding: max(0px)) {
    .frontend-story-modal-container {
        padding: max(20px, env(safe-area-inset-top) + 10px) max(20px, env(safe-area-inset-right) + 10px) max(20px, env(safe-area-inset-bottom) + 10px) max(20px, env(safe-area-inset-left) + 10px);
    }

    @media (max-width: 768px) {
        .frontend-story-modal-container {
            padding: max(10px, env(safe-area-inset-top) + 5px) max(10px, env(safe-area-inset-right) + 5px) max(10px, env(safe-area-inset-bottom) + 5px) max(10px, env(safe-area-inset-left) + 5px);
        }
    }

    @media (max-width: 480px) {
        .frontend-story-modal-container {
            padding: max(5px, env(safe-area-inset-top) + 2px) max(5px, env(safe-area-inset-right) + 2px) max(5px, env(safe-area-inset-bottom) + 2px) max(5px, env(safe-area-inset-left) + 2px);
        }
    }
}


@media screen and (display-mode: standalone) {
    .frontend-story-modal-container {
        padding-top: max(20px, env(safe-area-inset-top) + 20px);
        padding-bottom: max(20px, env(safe-area-inset-bottom) + 20px);
    }
}


@media (max-width: 768px) {
    .frontend-story-modal .frontend-story-modal-close {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

@media (max-width: 480px) {
    .frontend-story-modal .frontend-story-modal-close {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}


.frontend-story-modal-description::-webkit-scrollbar {
    width: 6px;
}

.frontend-story-modal-description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.frontend-story-modal-description::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.frontend-story-modal-description::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}