/* Overlay */
.reels-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-in-out;
    z-index: 9997;
}

.reels-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar - Base Styles */
.reels-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 320px;
    height: 100vh;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    background-color: rgba(242, 242, 242, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9998;
    border-radius: 0 0 6px 6px;
    touch-action: none;
    transform: translateZ(0); /* Force new stacking context */
    -webkit-transform: translateZ(0);
}

.reels-sidebar {
    /* Add this to the existing properties above */
    transition: 
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Left placement */
.reels-sidebar:not(.right) {
    left: 0;
    transform: translateX(-320px);
}

.reels-sidebar:not(.right).active {
    transform: translateX(0);
}

/* Right placement */
.reels-sidebar.right {
    right: 0;
    transform: translateX(320px);
}

.reels-sidebar.right.active {
    transform: translateX(0);
}


/* Desktop Indicator */
.desktop-indicator {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    background-color: rgba(242,242,242, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 2px;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    transition: background-color 0.2s;
}


.desktop-indicator:hover {
    background: rgba(0, 0, 0, 0.95);
}

.desktop-indicator svg {
    width: 20px;
    height: 20px;
    fill: black;
}

/* For left placement */
.desktop-indicator.left {
    left: 0;
    right: auto;
    border-radius: 0 4px 4px 0;
}

/* For right placement */
.desktop-indicator.right {
    right: 0;
    left: auto;
    border-radius: 4px 0 0 4px;
}

.desktop-indicator.right svg {
    transform: rotate(180deg);
}

.desktop-indicator span {
    font-family: 'Inter', Sans-serif;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: black;
    font-size: 14px;
    font-weight:500 !important;
}

/* CTA Button Styles */
.cta-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    padding: 10px 24px 12px 24px;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: auto;
    z-index: 10;
    font-size: 16px; /* Base font size */
    white-space: nowrap; /* Prevent text wrapping */
    max-width: 90%; /* Prevent button from extending beyond video width */
    font-family: 'Inter', san-serif;
}

.cta-button.square {
    border-radius: 0;
}

.cta-button.rounded {
    border-radius: 4px;
}

.cta-button.pill {
    border-radius: 50px;
}

.cta-button.visible {
    opacity: 1;
}

/* Mobile Indicator */
.mobile-indicator {
    position: fixed;
    top: 75%;
    transform: translateY(-50%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    background-color: rgba(242,242,242, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 999998;
}

/* For left placement */
.mobile-indicator.left {
    left: 0;
    right: auto;
    border-radius: 0 8px 8px 0;
}

/* For right placement */
.mobile-indicator.right {
    right: 0;
    left: auto;
    border-radius: 8px 0 0 8px;
}

/* Miscellaneous styles */
.indicator-line {
    width: 3px;
    height: 40px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    margin-right: 4px;
}

.mobile-indicator span {
    font-family: 'Inter', Sans-serif;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: black;
    font-size: 12px;
    font-weight:500 !important;
    padding-top:2px;
    padding-bottom:2px;
}


.video-container {
    height: 100%;
    overflow-y: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 177.78%;
    margin-bottom: 20px;
    background: #000;
    border-radius: 8px !important;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    z-index:1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    -webkit-border-radius: 8px !important;
    -webkit-transform-style: preserve-3d;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    
}

.video-wrapper video:not([playing]) {
    object-fit: contain !important;
}

.video-container{
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.video-wrapper video::-webkit-media-controls {
    border-radius: 8px !important;
    background: transparent;
}

.video-container::-webkit-scrollbar {
    display:none;
}

.video-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.video-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-wrapper.paused:hover .video-overlay:not(.hidden) {
    opacity: 1;
}

/* Add to reels-sidebar.css */

.sequence-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 3; /* Increase z-index to ensure visibility */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transform: translateZ(0); /* Force new stacking context */
    -webkit-transform: translateZ(0);
}

.video-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 4; /* Increase z-index */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.sequence-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    z-index: 2; /* Just below indicators but above other elements */
    pointer-events: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.sequence-area {
    flex: none;
    width: 25%;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    touch-action: none; /* Prevent default touch actions */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color, #32f17f);
    width: 0%;
    transition: width 0.1s linear;
}

.sequence-area.prev {
    margin-right: auto; /* Push to left side */
}

.sequence-area.next {
    margin-left: auto; /* Push to right side */
}

/* Remove old button styles */
.sequence-button {
    display: none;
}

.reelium-branding {
    position: fixed;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index:99999;
}

.reelium-branding:hover {
    opacity: 1;
}

.reelium-sidebar-logo {
    height: 24px;
    width: auto;
    filter: brightness(0.8);
}

.reelium-branding a {
    text-decoration: none;
}

/* Responsive "hack" with media queries */
@media (max-width: 320px) {
    .reels-sidebar {
		margin-top:52px;
        width: 280px;
    }
	.desktop-indicator {
        display: none;
    }
    .reels-sidebar:not(.right) { transform: translateX(-280px); }
    .reels-sidebar.right { transform: translateX(280px); }
    
    .cta-button {
        font-size: 11px;
        padding: 5px 10px;
        bottom: 8px;
    }
}

@media (min-width: 321px) and (max-width: 375px) {
    .reels-sidebar {
        width: 300px;
    }
	.desktop-indicator {
        display: none;
    }
    .reels-sidebar:not(.right) { transform: translateX(-300px); }
    .reels-sidebar.right { transform: translateX(300px); }
}

@media (min-width: 376px) and (max-width: 425px) {
    .reels-sidebar {
        width: 320px;
    }
	.desktop-indicator {
        display: none;
    }
    .reels-sidebar:not(.right) { transform: translateX(-320px); }
    .reels-sidebar.right { transform: translateX(320px); }
}

@media (max-width: 480px) {
    .cta-button {
        max-width: 80%;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: max(11px, min(3vw, 14px)); /* Responsive font size with minimum and maximum values */
    }
}

@media (min-width: 426px) and (max-width: 767px) {
    .reels-sidebar {
        width: 90vw;
    }
	.desktop-indicator {
        display: none;
    }
    .reels-sidebar:not(.right) { transform: translateX(-90vw); }
    .reels-sidebar.right { transform: translateX(90vw); }
    
    .cta-button {
        font-size: 12px;
        padding: 6px 12px;
        bottom: 10px;
    }
    
    .sequence-indicator {
        top: 10px; /* Slightly adjust position on mobile */
        right: 10px;
        font-size: 14px; /* Slightly larger for better touch targets */
        padding: 6px 10px;
    }
    
    .video-progress {
        height: 4px; /* Slightly thicker on mobile */
    }
    
    .sequence-area {
        width: 30%; /* Slightly wider touch areas on mobile */
    }
    
}


/* Desktop Responsive Styles */
@media (min-width: 769px) {
    .desktop-indicator {
        display: flex;
    }
    
    .cta-button {
        font-size: 14px;
        padding: 8px 16px;
        bottom: 15px;
    }
	
	.reels-sidebar {
        width: 320px;
    }
    .reels-sidebar:not(.right) { transform: translateX(-320px); }
    .reels-sidebar.right { transform: translateX(320px); }

    .mobile-indicator {
        display: none;
    }
}