.rk-3d-animation-widget {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rk-3d-screen {
    width: 80%;
    max-width: 1200px;
    height: 70vh;
    position: relative;
    perspective: 2500px;
    transform-style: preserve-3d;
    transform-origin: center center;
    backface-visibility: hidden;
}

.rk-3d-screen-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.rk-3d-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.rk-3d-video-wrapper.active {
    opacity: 1;
}

.rk-3d-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    /* Ensure smooth scrubbing */
    will-change: transform, opacity;
    transition: box-shadow 0.3s ease;
}

.rk-3d-video-wrapper:hover .rk-3d-video {
    box-shadow:
        0 35px 70px -12px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.rk-3d-video-wrapper:not(.active) {
    pointer-events: none;
}

.rk-video-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    transform: translateZ(1px);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .rk-3d-screen {
        width: 90%;
        height: 60vh;
    }
}

@media (max-width: 768px) {
    .rk-3d-screen {
        width: 95%;
        height: 50vh;
    }
    
    .rk-video-caption {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* Product Showcase Specific Styles */
.rk-3d-product-showcase {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
}

.rk-3d-product-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.rk-3d-product-wrapper.active {
    opacity: 1;
    z-index: 10;
}

.rk-product-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.rk-product-info {
    position: absolute;
    top: 10%;
    left: 10%;
    z-index: 20;
    max-width: 400px;
    color: white;
    transform: translateZ(50px);
}

.rk-product-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin: 0 0 1rem 0;
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.rk-product-description {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    line-height: 1.6;
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
}

.rk-product-video, .rk-product-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    transform: translateZ(20px);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.rk-product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.rk-placeholder-content {
    text-align: center;
    color: white;
    z-index: 15;
    position: relative;
}

.rk-placeholder-content h3 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    font-weight: 700;
}

.rk-placeholder-content p {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.8;
}

/* Product Navigation */
.rk-product-nav {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 30;
}

.rk-product-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.rk-product-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.rk-product-nav-btn:hover::before {
    left: 100%;
}

.rk-product-nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.rk-nav-title {
    position: relative;
    z-index: 1;
}

/* Enhanced responsive design */
@media (max-width: 768px) {
    .rk-product-info {
        top: 5%;
        left: 5%;
        max-width: 90%;
    }

    .rk-product-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .rk-product-description {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }

    .rk-product-nav {
        bottom: 2%;
        gap: 0.5rem;
    }

    .rk-product-nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Elementor editor specific styles */
.elementor-editor-active .rk-3d-animation-widget {
    min-height: 500px;
}