/* Reelium Story Player Wrapper */
.reelium-story-player-wrapper {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

/* 1. Horizontal Circle Slider */
.reelium-story-slider {
    position: relative;
    width: 100%;
}
.reelium-story-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    scroll-behavior: smooth;
    gap: 16px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}
.reelium-story-container::-webkit-scrollbar {
    display: none;
}

.reelium-story-item-wrapper {
    display:flex;
    justify-content:center;
    align-items:center;
    flex-shrink: 0;
    position: relative;
    width: var(--reelium-story-circle-size, 110px); 
    height: calc(var(--reelium-story-circle-size, 110px) + 22px); 
    margin: 0;
    padding:4px;
    cursor: pointer;
    transition: width 0.5s cubic-bezier(0.77, 0, 0.175, 1),
                height 0.5s cubic-bezier(0.77, 0, 0.175, 1),
                margin 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.reelium-story-item {
    width: var(--reelium-story-circle-size, 110px); 
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease-in-out;
    opacity: 1;
    visibility: visible;
    
}
.reelium-story-item:hover {
    transform: scale(1.05);
}
.reelium-story-thumbnail {
    width: var(--reelium-story-circle-size, 110px); 
    height: var(--reelium-story-circle-size, 110px);
    border-radius: 50%;
    border: 2px solid var(--reelium-primary, var(--primary-color, rgba(236, 72, 153, 0.8)));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.reelium-story-thumbnail img, .reelium-story-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.reelium-story-label {
    font-size: 14px; 
    color: var(--reelium-text, #333);
    margin-top: 8px;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reelium-story-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    user-select: none;
    border-radius: var(--reelium-radius, 55px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s 0.1s ease, 
                visibility 0.3s 0.1s ease,
                border-radius 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 2;
}

/* --- ACTIVE PLAYER STATE --- */
.reelium-story-item-wrapper.is-active {
    width: var(--reelium-story-player-width, 196px);
    height: var(--reelium-story-player-height, 348px);
    cursor: default;
    aspect-ratio: 9/16;
}

.reelium-story-item-wrapper.is-active .reelium-story-item {
    opacity: 0;
    visibility: hidden;
    transition-delay: 0s;
}

.reelium-story-item-wrapper.is-active .reelium-story-player {
    border-radius: var(--reelium-radius, 12px);
    opacity: 1;
    visibility: visible;
}

.reelium-story-player-wrapper.is-active .reelium-nav-buttons {
    display: none !important;
}

/* --- Internal Player UI --- */
.reelium-story-player video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}
.reelium-story-player .reelium-story-loading {
    display: none;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}
.reelium-story-player .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: reelium-spin 1s linear infinite;
}
@keyframes reelium-spin {
    to { transform: rotate(360deg); }
}

.reelium-story-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: 12px;
    display: flex;
    gap: 4px;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}
.reelium-story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.reelium-story-progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
    transition: width 0.1s linear;
    min-width: 0;
}
.reelium-story-progress-fill.is-active,
.reelium-story-progress-fill.is-complete {
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.18);
}

.reelium-story-tap-zones {
    flex: 1;
    display: flex;
    z-index: 5;
}
.reelium-story-tap-prev { width: 30%; height: 100%; cursor: pointer; }
.reelium-story-tap-pause { flex: 1; }
.reelium-story-tap-next { width: 30%; height: 100%; cursor: pointer; }

.reelium-story-footer {
    position: relative;
    z-index: 10;
    padding: 20px;
    background: linear-gradient(0deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
}
.reelium-story-cta-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    gap: 0 !important;
    width: 100%;
    padding: 12px !important;
    font-size: 16px;
    font-weight: 600;
    background: var(--reelium-primary, var(--primary-color, #32f17f));
    color: var(--reelium-text, #000);
    text-align: center !important;
    text-indent: 0 !important;
    line-height: 1.2 !important;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.reelium-story-cta-button::before,
.reelium-story-cta-button::after {
    display: none !important;
    content: none !important;
}
.reelium-story-cta-button .reelium-cta-label {
    display: block;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: inherit !important;
}
.reelium-story-cta-button.style-rounded { border-radius: var(--reelium-button-radius, 8px); }
.reelium-story-cta-button.style-square { border-radius: var(--reelium-button-radius, 0); }
.reelium-story-cta-button.style-pill { border-radius: var(--reelium-button-radius, 50px); }

/* --- Slider Nav Buttons --- */
.reelium-story-slider .reelium-nav-buttons {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: none;
    justify-content: space-between;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.reelium-story-slider.has-overflow .reelium-nav-buttons {
    display: flex;
}

.reelium-story-slider.has-overflow:hover .reelium-nav-buttons {
    opacity: 1;
}
.reelium-story-slider .reelium-nav-buttons button {
    pointer-events: all;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    padding:0px;
}
.reelium-story-slider .reelium-nav-buttons button:hover:not(:disabled) {
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}
.reelium-story-slider .reelium-nav-buttons button:active:not(:disabled) {
    transform: scale(0.95);
}
.reelium-story-slider .reelium-nav-buttons button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: rgba(255, 255, 255, 0.7);
}
.reelium-story-slider .reelium-nav-buttons button svg {
    width: 20px;
    height: 20px;
    stroke: #000;
    stroke-width: 2.5;
    fill: none;
}
.reelium-story-slider .reelium-nav-prev { 
    margin-left: -20px; 
}
.reelium-story-slider .reelium-nav-next { 
    margin-right: -20px; 
}

/* Mobile responsive */
@media (max-width: 768px) {
    .reelium-story-slider .reelium-nav-buttons button {
        width: 36px;
        height: 36px;
    }
    .reelium-story-slider .reelium-nav-buttons button svg {
        width: 18px;
        height: 18px;
    }
    .reelium-story-slider .reelium-nav-prev { 
        margin-left: -18px; 
    }
    .reelium-story-slider .reelium-nav-next { 
        margin-right: -18px; 
    }
}
