/**
 * Website Builder Demo - Premium Animation Styles
 * 
 * Premium animations featuring:
 * - Sophisticated easing curves
 * - Smooth choreographed sequences
 * - Enhanced visual effects
 * - Optimized performance
 */

/* ==================== FLOATING CODE PARTICLES ==================== */
@keyframes floatCode {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
        transform: translateY(-50px) translateX(10px) rotate(180deg) scale(1.1);
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-120px) translateX(-10px) rotate(360deg) scale(0.8);
        opacity: 0;
    }
}

.floating-code {
    position: absolute;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #4D7CFE;
    text-shadow: 0 0 20px rgba(77, 124, 254, 0.9), 0 0 40px rgba(77, 124, 254, 0.6);
    opacity: 0;
    animation: floatCode 8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
    will-change: transform, opacity;
    filter: drop-shadow(0 0 8px rgba(77, 124, 254, 0.8));
}

.floating-code:nth-child(1) { animation-delay: 0s; left: 10%; }
.floating-code:nth-child(2) { animation-delay: 1.6s; left: 25%; }
.floating-code:nth-child(3) { animation-delay: 3.2s; left: 40%; }
.floating-code:nth-child(4) { animation-delay: 4.8s; left: 55%; }
.floating-code:nth-child(5) { animation-delay: 6.4s; left: 70%; }
.floating-code:nth-child(6) { animation-delay: 0.8s; left: 15%; }
.floating-code:nth-child(7) { animation-delay: 2.4s; left: 30%; }
.floating-code:nth-child(8) { animation-delay: 4.0s; left: 45%; }
.floating-code:nth-child(9) { animation-delay: 5.6s; left: 60%; }
.floating-code:nth-child(10) { animation-delay: 0.4s; left: 75%; }
.floating-code:nth-child(11) { animation-delay: 2.8s; left: 20%; }
.floating-code:nth-child(12) { animation-delay: 5.2s; left: 50%; }
.floating-code:nth-child(13) { animation-delay: 2.0s; left: 35%; }
.floating-code:nth-child(14) { animation-delay: 3.6s; left: 65%; }
.floating-code:nth-child(15) { animation-delay: 6.0s; left: 80%; }
.floating-code:nth-child(16) { animation-delay: 1.2s; left: 12%; }

/* ==================== AI PULSE ANIMATION ==================== */
@keyframes aiPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 16px rgba(77, 124, 254, 0.6));
    }
    50% {
        transform: scale(1.15);
        filter: brightness(1.5) drop-shadow(0 0 32px rgba(77, 124, 254, 1));
    }
}

.ai-pulse {
    animation: aiPulse 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    will-change: transform, filter;
}

/* ==================== CODE TYPING ANIMATION ==================== */
@keyframes typeCode {
    0% {
        opacity: 0;
        transform: translateX(-8px) translateY(4px);
        filter: blur(2px);
    }
    60% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
        filter: blur(0);
    }
}

/* Premium staggered code typing - Desktop only */
@media (min-width: 1024px) {
    .builder-active .code-line-1 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 0.45s forwards; }
    .builder-active .code-line-2 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 0.75s forwards; }
    .builder-active .code-line-3 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 1.05s forwards; }
    .builder-active .code-line-4 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 1.35s forwards; }
    .builder-active .code-line-5 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 1.65s forwards; }
    .builder-active .code-line-6 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 1.95s forwards; }
    .builder-active .code-line-7 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 2.25s forwards; }
    .builder-active .code-line-8 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 2.55s forwards; }
    .builder-active .code-line-9 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 2.85s forwards; }
    .builder-active .code-line-10 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 3.15s forwards; }
    .builder-active .code-line-11 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 3.45s forwards; }
    .builder-active .code-line-12 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 3.75s forwards; }
    .builder-active .code-line-13 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 4.05s forwards; }
    .builder-active .code-line-14 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 4.35s forwards; }
    .builder-active .code-line-15 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 4.65s forwards; }
    .builder-active .code-line-16 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 4.95s forwards; }
    .builder-active .code-line-17 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 5.25s forwards; }
    .builder-active .code-line-18 { animation: typeCode 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 5.55s forwards; }
}

/* ==================== TERMINAL ANIMATIONS ==================== */
@keyframes terminalType {
    0% {
        opacity: 0;
        transform: translateX(-6px);
        filter: blur(1px);
    }
    70% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

@media (min-width: 1024px) {
    .builder-active .terminal-line-1 { animation: terminalType 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 1.35s forwards; }
    .builder-active .terminal-line-2 { animation: terminalType 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 1.95s forwards; }
    .builder-active .terminal-line-3 { animation: terminalType 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 2.55s forwards; }
    .builder-active .terminal-line-4 { animation: terminalType 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 3.15s forwards; }
    .builder-active .terminal-line-5 { animation: terminalType 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 3.75s forwards; }
    .builder-active .terminal-line-6 { animation: terminalType 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 4.35s forwards; }
    .builder-active .terminal-line-7 { animation: terminalType 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 4.95s forwards; }
    .builder-active .terminal-line-8 { animation: terminalType 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) 5.55s forwards; }
}

/* ==================== PREVIEW ELEMENT ANIMATIONS ==================== */
@keyframes buildElement {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.92);
        filter: blur(6px);
    }
    60% {
        opacity: 0.6;
        transform: translateY(8px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.builder-active .preview-element-1 {
    animation: buildElement 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s forwards;
}

.builder-active .preview-element-2 {
    animation: buildElement 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 3.0s forwards;
}

.builder-active .preview-element-3 {
    animation: buildElement 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 4.2s forwards;
}

/* Testimonial removed - no longer used */
.builder-active .preview-element-4 {
    display: none;
}

/* ==================== COMPLETION ANIMATION ==================== */
@keyframes completeReveal {
    0% {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        max-height: 40px;
        margin-bottom: 0.125rem;
        transform: translateY(0);
    }
}

@media (min-width: 1024px) {
    @keyframes completeReveal {
        100% {
            max-height: 30px;
        }
    }
}

.builder-active .preview-complete {
    animation: completeReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 6.0s forwards;
    overflow: hidden;
}

/* ==================== TYPING CURSOR ==================== */
.builder-active .typing-cursor {
    opacity: 0;
    animation: cursorAppear 0.15s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards, 
               cursorBlink 1.2s ease-in-out 0.8s infinite;
}

.builder-active .terminal-cursor {
    opacity: 0;
    animation: cursorAppear 0.15s cubic-bezier(0.4, 0, 0.2, 1) 2.2s forwards, 
               cursorBlink 1.2s ease-in-out 2.4s infinite;
}

@keyframes cursorAppear {
    0% { 
        opacity: 0; 
        transform: scale(0.8);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

@keyframes cursorBlink {
    0%, 45% { 
        opacity: 1; 
        box-shadow: 0 0 8px currentColor;
    }
    50%, 95% { 
        opacity: 0; 
        box-shadow: none;
    }
    100% { 
        opacity: 1; 
        box-shadow: 0 0 8px currentColor;
    }
}

/* ==================== IDE TAB INTERACTIONS ==================== */
.ide-tab {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ide-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.ide-tab.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(77, 124, 254, 0.3);
    box-shadow: 0 2px 12px rgba(77, 124, 254, 0.15);
}

.ide-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #4D7CFE, #00D4A1);
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ide-tab.active::after {
    opacity: 1;
    transform: scaleX(1);
}

/* ==================== GRADIENT ANIMATION ==================== */
@keyframes thinkingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
        filter: brightness(1.3);
    }
}

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

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.thinking-text {
    animation: gradientShift 6s cubic-bezier(0.4, 0, 0.2, 1) infinite, thinkingPulse 3s ease-in-out infinite;
}

/* ==================== DEFAULT HEIGHTS (DESKTOP) ==================== */
.builder-code-editor {
    min-height: 280px;
    max-height: 320px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.builder-terminal {
    min-height: 140px;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.builder-preview {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(10px);
}


/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 1024px) {
    .floating-code {
        font-size: 10px;
    }
}

/* ==================== MOBILE RESPONSIVENESS ==================== */
@media (max-width: 1023px) {
    /* Hide code editor and terminal on mobile */
    .builder-code-editor,
    .builder-terminal {
        display: none;
    }
    
    /* Hide floating code particles on mobile */
    .floating-code {
        display: none;
    }
    
    /* Glassmorphic container on mobile */
    #builder-demo .max-w-7xl > div {
        backdrop-filter: blur(24px) !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
    }
    
    /* Make preview full width and remove opacity */
    .builder-preview {
        background: linear-gradient(to bottom right, rgb(15, 23, 42), rgb(2, 6, 23)) !important;
    }
}

/* ==================== MOBILE OPTIMIZATION ==================== */
@media (max-width: 1023px) {
    /* Progress Area - Clean and Spacious */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] {
        padding: 0.875rem !important;
    }
    
    /* Stack progress area on mobile for breathing room */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    /* AI Status - compact */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child {
        width: 100% !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child .w-8 {
        width: 2rem !important;
        height: 2rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child h3 {
        font-size: 0.8125rem !important;
        line-height: 1.2 !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child p {
        font-size: 0.625rem !important;
    }
    
    /* Progress Bar - full width on mobile */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > .flex-1 {
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > .flex-1 .mb-1 {
        margin-bottom: 0.375rem !important;
    }
    
    /* Stats - horizontal row with better spacing */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child {
        width: 100% !important;
        justify-content: space-around !important;
        gap: 1rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child > div {
        flex: 1 !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child p:first-child {
        font-size: 1.125rem !important;
        margin-bottom: 0.125rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child p:last-child {
        font-size: 0.625rem !important;
        letter-spacing: 0.05em !important;
    }
    
    /* Hide IDE tabs on mobile - cleaner interface */
    #builder-demo .ide-tab {
        display: none !important;
    }
    
    #builder-demo .bg-white\/\[0\.05\].border-b.px-2 {
        display: none !important;
    }
    
    /* Hide code editor on mobile - focus on preview */
    .builder-code-editor,
    #builder-demo .builder-code-editor {
        display: none !important;
    }
    
    /* Hide terminal on mobile too */
    .builder-terminal,
    #builder-demo .builder-terminal {
        display: none !important;
    }
    
    /* Preview adapts to content */
    .builder-preview {
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
    }
    
    /* Preview - refined spacing */
    .builder-preview .p-2 {
        padding: 0.75rem !important;
    }
    
    /* Preview elements - compact and clean */
    #builder-demo .preview-element-2 h1 {
        font-size: 1rem !important;
        margin-bottom: 0.625rem !important;
        line-height: 1.3 !important;
    }
    
    #builder-demo .preview-element-2 p {
        font-size: 0.75rem !important;
        margin-bottom: 0.625rem !important;
        line-height: 1.4 !important;
    }
    
    #builder-demo .preview-element-3 {
        gap: 0.5rem !important;
    }
    
    #builder-demo .preview-element-3 > div {
        padding: 0.5rem !important;
    }
    
    #builder-demo .preview-element-3 h3 {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    #builder-demo .preview-element-3 p {
        font-size: 0.625rem !important;
        line-height: 1.3 !important;
    }
    
    /* Browser controls - refined */
    #builder-demo .builder-preview .bg-white\/\[0\.05\].border-b {
        padding: 0.625rem 0.875rem !important;
    }
    
    #builder-demo .builder-preview .bg-white\/\[0\.05\].border-b .w-2\.5 {
        width: 0.5rem !important;
        height: 0.5rem !important;
    }
    
    /* Stack elements vertically on mobile */
    section#builder-demo .bg-white\/\[0\.03\] > div[class*="grid"] {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Preview is the only visible element on mobile - takes full space */
    section#builder-demo .builder-preview {
        order: 1 !important;
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    /* Progress Area - Even more compact */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] {
        padding: 0.75rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex {
        gap: 0.625rem !important;
    }
    
    /* AI Status - smaller */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child .w-8 {
        width: 1.75rem !important;
        height: 1.75rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child svg {
        width: 0.875rem !important;
        height: 0.875rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child h3 {
        font-size: 0.75rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child p {
        font-size: 0.5625rem !important;
    }
    
    /* Progress bar labels - smaller */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > .flex-1 span {
        font-size: 0.625rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > .flex-1 .h-1\.5 {
        height: 0.375rem !important;
    }
    
    /* Stats - tighter spacing */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child {
        gap: 0.625rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child p:first-child {
        font-size: 1rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child p:last-child {
        font-size: 0.5625rem !important;
    }
    
    /* Section header - compact */
    #builder-demo .text-center.mb-6 h2 {
        font-size: 1.125rem !important;
        margin-bottom: 0.375rem !important;
        line-height: 1.3 !important;
    }
    
    #builder-demo .text-center.mb-6 p {
        font-size: 0.875rem !important;
    }
    
    #builder-demo .text-center.mb-6 .inline-block {
        margin-bottom: 0.5rem !important;
    }
    
    #builder-demo .text-center.mb-6 .inline-block span {
        padding: 0.375rem 0.875rem !important;
        font-size: 0.625rem !important;
    }
    
    /* Preview - responsive and clean */
    .builder-preview {
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
    }
    
    /* Hide testimonial section on small screens - saves space */
    #builder-demo .preview-element-4 {
        display: none !important;
    }
    
    /* Tighter preview spacing */
    #builder-demo .preview-element-2 h1 {
        font-size: 0.875rem !important;
    }
    
    #builder-demo .preview-element-2 p {
        font-size: 0.6875rem !important;
    }
    
    #builder-demo .preview-element-3 h3 {
        font-size: 0.6875rem !important;
    }
    
    #builder-demo .preview-element-3 p {
        font-size: 0.5625rem !important;
    }
}

@media (max-width: 375px) {
    /* Extra small phones - maximum simplification */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] {
        padding: 0.625rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex {
        gap: 0.5rem !important;
    }
    
    /* AI Status - minimal */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child {
        gap: 0.5rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child .w-8 {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child h3 {
        font-size: 0.6875rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:first-child p {
        display: none !important; /* Hide "AI Designer Active" on tiny screens */
    }
    
    /* Progress bar - minimal labels */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > .flex-1 .mb-1 {
        margin-bottom: 0.25rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > .flex-1 span {
        font-size: 0.5625rem !important;
    }
    
    /* Stats - show only 2 most important (hide Files) */
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child > div:nth-child(2) {
        display: none !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child {
        gap: 1.5rem !important;
    }
    
    #builder-demo .max-w-7xl > .bg-white\/\[0\.05\] > .flex > div:last-child p:first-child {
        font-size: 0.9375rem !important;
    }
    
    /* Section header - super compact */
    #builder-demo .text-center.mb-6 {
        margin-bottom: 1rem !important;
    }
    
    #builder-demo .text-center.mb-6 h2 {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    #builder-demo .text-center.mb-6 p {
        font-size: 0.8125rem !important;
    }
}

/* ==================== CONFETTI CELEBRATION ==================== */
@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) translateX(0) rotate(0deg);
        opacity: 1;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(var(--confetti-x-drift)) rotate(var(--confetti-rotation));
        opacity: 0;
    }
}

@keyframes confettiSpin {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    100% {
        transform: rotateY(720deg) rotateX(360deg);
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -20px;
    opacity: 0;
    animation: confettiFall var(--fall-duration) linear forwards,
               confettiSpin var(--spin-duration) linear infinite;
}

.confetti.square {
    background: var(--confetti-color);
}

.confetti.circle {
    background: var(--confetti-color);
    border-radius: 50%;
}

.confetti.rectangle {
    width: 15px;
    height: 8px;
    background: var(--confetti-color);
}

.confetti.star {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid var(--confetti-color);
    position: relative;
}

.confetti.star::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--confetti-color);
    top: 3px;
    left: -5px;
}

/* ==================== BACKGROUND ORB ANIMATIONS ==================== */
@keyframes orbPulse1 {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

@keyframes orbPulse2 {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
}

@keyframes orbFloat1 {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-30px);
    }
}

@keyframes orbFloat2 {
    0%, 100% {
        transform: translateX(0px);
    }
    50% {
        transform: translateX(20px);
    }
}

.builder-bg-orb-1 {
    animation: orbPulse1 6s ease-in-out infinite, orbFloat1 8s ease-in-out infinite;
}

.builder-bg-orb-2 {
    animation: orbPulse2 7s ease-in-out infinite, orbFloat2 10s ease-in-out infinite;
}

.builder-bg-orb-3 {
    animation: orbPulse1 5s ease-in-out infinite;
}

/* ==================== REDUCED MOTION ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    .floating-code,
    .ai-pulse,
    .code-line-1, .code-line-2, .code-line-3, .code-line-4, .code-line-5,
    .code-line-6, .code-line-7, .code-line-8, .code-line-9, .code-line-10,
    .code-line-11, .code-line-12, .code-line-13, .code-line-14, .code-line-15,
    .code-line-16, .code-line-17, .code-line-18,
    .terminal-line-1, .terminal-line-2, .terminal-line-3, .terminal-line-4,
    .terminal-line-5, .terminal-line-6, .terminal-line-7, .terminal-line-8,
    .preview-element-1, .preview-element-2, .preview-element-3, .preview-element-4,
    .preview-complete,
    .typing-cursor,
    .terminal-cursor,
    .confetti {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .confetti {
        display: none !important;
    }
}
