/* Text Box Motion Effects - Shared CSS for all 3D model pages */

/* Enhanced text box animations and effects for overlay layout */
#right {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(0);
    /* Enhanced overlay styling */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 2px 16px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Fade in animation for the entire text box */
#right.fade-in {
    animation: fadeInRight 0.8s ease-out forwards;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Title animation effects */
#right .title {
    opacity: 0;
    animation: slideInFromTop 0.8s ease-out 0.2s forwards;
    position: relative;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Description text animation */
#right .desc {
    opacity: 0;
    animation: slideInFromBottom 0.8s ease-out 0.4s forwards;
    position: relative;
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing effect for description text */
#right .desc.typing {
    overflow: hidden;
    border-right: 2px solid transparent;
    animation: typing 3s steps(40, end) 0.6s forwards, blink-caret 0.5s step-end infinite 0.6s;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #e3e3e3;
    }
}

/* Hover effects for the overlay text box */
#right:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 
                0 4px 20px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Gradient background animation */
#right.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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%;
    }
}

/* Pulse effect for important content */
#right.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Floating effect */
#right.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Glowing border effect */
#right.glow {
    border: 2px solid transparent;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    }
    to {
        border-color: rgba(255, 255, 255, 0.8);
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
    }
}

/* Smooth scrollbar for description */
#right .desc::-webkit-scrollbar {
    width: 8px;
}

#right .desc::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#right .desc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

#right .desc::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Text reveal effect */
#right .desc.reveal {
    overflow: hidden;
    position: relative;
}

#right .desc.reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    transform: translateX(-100%);
    animation: reveal 1.5s ease-out 0.5s forwards;
}

@keyframes reveal {
    to {
        transform: translateX(100%);
    }
}

/* Mobile responsive animations */
@media only screen and (max-width: 992px) {
    #right.fade-in {
        animation: fadeInUp 0.8s ease-out forwards;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(50px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    #right:hover {
        transform: translateY(-3px) scale(1.01);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    }
    
    #right.floating {
        animation: none; /* Disable floating on mobile for better performance */
    }
    
    /* Enhanced mobile overlay styling */
    #right {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }
}

/* Smooth transitions for theme changes */
#right * {
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Loading shimmer effect */
#right.loading {
    position: relative;
    overflow: hidden;
}

#right.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Staggered animation for multiple elements */
#right .title:nth-child(1) {
    animation-delay: 0.2s;
}

#right .title:nth-child(2) {
    animation-delay: 0.4s;
}

#right .desc {
    animation-delay: 0.6s;
}

/* Interactive focus states */
#right:focus-within {
    transform: scale(1.01);
    filter: brightness(1.1);
}

/* Smooth appearance on page load */
.page-loaded #right {
    animation: fadeInRight 0.8s ease-out forwards;
}

/* Custom easing for smooth animations */
#right, #right * {
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}