/* Distribution Animation Styles */

.distribution-animation-container {
    width: 100%;
    max-width: 100%;
    height: 320px;
    background: linear-gradient(135deg, #f6f9fc 0%, #e9f0f7 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

/* Distributor Machine (Left) */
.distribution-animation-container .distributor {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 140px;
    z-index: 20;
}

.distribution-animation-container .machine-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #475569, #64748b);
    border-radius: 1rem;
    position: relative;
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    overflow: visible;
    border: 3px solid #334155;
    display: flex;
    flex-direction: row;
}

.distribution-animation-container .machine-body::after {
    content: '';
    position: absolute;
    bottom: 12px;
    right: 15px;
    width: 50px;
    height: 25px;
    background: repeating-linear-gradient(90deg,
            transparent,
            transparent 4px,
            #1e293b 4px,
            #1e293b 6px);
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.distribution-animation-container .machine-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 25px;
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #0f172a;
    border-top: none;
}

.distribution-animation-container .machine-top::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: #10b981;
    border-radius: 2px;
    box-shadow: 0 0 8px #10b981;
}

.distribution-animation-container .machine-screen {
    position: absolute;
    top: 35px;
    right: 15px;
    width: 50px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid #334155;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.distribution-animation-container .machine-screen::after {
    content: "⚙️";
    animation: distributionRotate 3s linear infinite;
}

@keyframes distributionRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Roller Shutter Gate System */

.distribution-animation-container .gate-container {
    position: absolute;
    left: 15px;
    top: 55px;
    width: 60px;
    height: 70px;
    z-index: 15;
    background: linear-gradient(to bottom, #1e293b 0%, #334155 50%, #1e293b 100%);
    border-radius: 4px;
    box-shadow:
        inset 0 0 15px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.2),
        1px 0 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    border: 2px solid #0f172a;
}

.distribution-animation-container .roller-shutter {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            #64748b 0%,
            #475569 10%,
            #64748b 20%,
            #475569 30%,
            #64748b 40%,
            #475569 50%,
            #64748b 60%,
            #475569 70%,
            #64748b 80%,
            #475569 90%,
            #64748b 100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.3);
}

.distribution-animation-container .roller-shutter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 7px,
            rgba(0, 0, 0, 0.4) 7px,
            rgba(0, 0, 0, 0.4) 9px,
            transparent 9px,
            transparent 16px,
            rgba(255, 255, 255, 0.15) 16px,
            rgba(255, 255, 255, 0.15) 18px);
}

.distribution-animation-container .gate-open .roller-shutter {
    transform: scaleY(0.05) translateY(-100%);
}

.distribution-animation-container .shutter-housing {
    position: absolute;
    top: 48px;
    left: 12px;
    width: 66px;
    height: 12px;
    background: linear-gradient(to bottom, #0f172a, #1e293b);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 2px solid #0f172a;
    border-bottom: none;
    z-index: 16;
}

.distribution-animation-container .shutter-housing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 4px;
    background: #475569;
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.distribution-animation-container .gate-light {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444, 0 0 4px rgba(239, 68, 68, 0.6);
    border: 1px solid #0f172a;
    transition: all 0.3s ease;
}

.distribution-animation-container .machine-body.active .gate-light {
    background: #10b981;
    box-shadow: 0 0 10px #10b981, 0 0 4px rgba(16, 185, 129, 0.6);
}

/* Team Members (Right) */
.distribution-animation-container .team-members {
    position: absolute;
    left: 200px;
    right: 0;
    top: 0;
    height: 100%;
    pointer-events: none;
}

.distribution-animation-container .team-member {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: distributionFadeIn 0.5s ease forwards;
    pointer-events: auto;
}

.distribution-animation-container .team-member:nth-child(1) {
    left: calc(18.97% + 26px);
    top: 15.00%;
    animation-delay: 0.2s;
}

.distribution-animation-container .team-member:nth-child(2) {
    left: calc(15.63% + 26px);
    top: 37.50%;
    animation-delay: 0.4s;
}

.distribution-animation-container .team-member:nth-child(3) {
    left: calc(17.86% + 26px);
    top: 62.50%;
    animation-delay: 0.6s;
}

.distribution-animation-container .team-member:nth-child(4) {
    left: calc(16.74% + 26px);
    top: 85.00%;
    animation-delay: 0.8s;
}

.distribution-animation-container .member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 3px solid #e2e8f0;
}

.distribution-animation-container .member-avatar.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
}

.distribution-animation-container .member-avatar.green {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}

.distribution-animation-container .member-avatar.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
}

.distribution-animation-container .member-avatar.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
}

.distribution-animation-container .member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Documents Animation */
.distribution-animation-container .document {
    position: absolute;
    left: 0;
    width: 32px;
    height: 40px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    z-index: 30;
}

.distribution-animation-container .document::before {
    content: "📄";
}

.distribution-animation-container .doc-1 {
    animation: distributionDocumentFlow1 8s ease-in-out infinite;
    animation-delay: 0s;
}

.distribution-animation-container .doc-2 {
    animation: distributionDocumentFlow2 8s ease-in-out infinite;
    animation-delay: 2s;
}

.distribution-animation-container .doc-3 {
    animation: distributionDocumentFlow3 8s ease-in-out infinite;
    animation-delay: 4s;
}

.distribution-animation-container .doc-4 {
    animation: distributionDocumentFlow4 8s ease-in-out infinite;
    animation-delay: 6s;
}

@keyframes distributionFadeIn {
    from {
        opacity: 0;
        transform: translate(calc(-50% + 20px), -50%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Desktop Document Flow Animations */
@keyframes distributionDocumentFlow1 {
    0% {
        left: 0;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.5);
        opacity: 0;
        z-index: 30;
    }

    5% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    12.5% {
        left: 60px;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(1);
    }

    15% {
        left: 80px;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.8);
        z-index: 30;
        opacity: 1;
    }

    15.5% {
        z-index: 10;
    }

    20% {
        left: 90px;
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
        z-index: 10;
        top: 50%;
    }

    27.5% {
        left: 200px;
        opacity: 1;
        transform: translateY(-50%) scale(1);
        z-index: 10;
        top: 50%;
    }

    28% {
        z-index: 30;
    }

    45%,
    50% {
        left: calc(200px + (100% - 200px) * 0.1897 + 6px);
        top: 15%;
        opacity: 0;
        transform: translateY(-50%) scale(1);
    }

    45% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
        left: 0;
        top: 50%;
    }
}

@keyframes distributionDocumentFlow2 {
    0% {
        left: 0;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.5);
        opacity: 0;
        z-index: 30;
    }

    5% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    12.5% {
        left: 60px;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(1);
    }

    15% {
        left: 80px;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.8);
        z-index: 30;
        opacity: 1;
    }

    15.5% {
        z-index: 10;
    }

    20% {
        left: 90px;
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
        z-index: 10;
        top: 50%;
    }

    27.5% {
        left: 200px;
        opacity: 1;
        transform: translateY(-50%) scale(1);
        z-index: 10;
        top: 50%;
    }

    28% {
        z-index: 30;
    }

    45%,
    50% {
        left: calc(200px + (100% - 200px) * 0.1563 + 6px);
        top: 37.5%;
        opacity: 0;
        transform: translateY(-50%) scale(1);
    }

    45% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
        left: 0;
        top: 50%;
    }
}

@keyframes distributionDocumentFlow3 {
    0% {
        left: 0;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.5);
        opacity: 0;
        z-index: 30;
    }

    5% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    12.5% {
        left: 60px;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(1);
    }

    15% {
        left: 80px;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.8);
        z-index: 30;
        opacity: 1;
    }

    15.5% {
        z-index: 10;
    }

    20% {
        left: 90px;
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
        z-index: 10;
        top: 50%;
    }

    27.5% {
        left: 200px;
        opacity: 1;
        transform: translateY(-50%) scale(1);
        z-index: 10;
        top: 50%;
    }

    28% {
        z-index: 30;
    }

    45%,
    50% {
        left: calc(200px + (100% - 200px) * 0.1786 + 6px);
        top: 62.5%;
        opacity: 0;
        transform: translateY(-50%) scale(1);
    }

    45% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
        left: 0;
        top: 50%;
    }
}

@keyframes distributionDocumentFlow4 {
    0% {
        left: 0;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.5);
        opacity: 0;
        z-index: 30;
    }

    5% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    12.5% {
        left: 60px;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(1);
    }

    15% {
        left: 80px;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.8);
        z-index: 30;
        opacity: 1;
    }

    15.5% {
        z-index: 10;
    }

    20% {
        left: 90px;
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
        z-index: 10;
        top: 50%;
    }

    27.5% {
        left: 200px;
        opacity: 1;
        transform: translateY(-50%) scale(1);
        z-index: 10;
        top: 50%;
    }

    28% {
        z-index: 30;
    }

    45%,
    50% {
        left: calc(200px + (100% - 200px) * 0.1674 + 6px);
        top: 85%;
        opacity: 0;
        transform: translateY(-50%) scale(1);
    }

    45% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
        left: 0;
        top: 50%;
    }
}

/* Mobile Document Flow Animations */
@keyframes mobileDistributionDocumentFlow1 {
    0% {
        left: 0;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.4);
        opacity: 0;
        z-index: 30;
    }

    5% {
        opacity: 1;
        transform: translateY(-50%) scale(0.8);
    }

    12.5% {
        left: 35px;
        top: calc(50% + 14px);
    }

    15% {
        left: 45px;
        opacity: 1;
        z-index: 30;
    }

    15.5% {
        z-index: 10;
    }

    20% {
        left: 55px;
        opacity: 0;
        z-index: 10;
        top: 50%;
    }

    27.5% {
        left: 130px;
        opacity: 1;
        z-index: 10;
        top: 50%;
    }

    28% {
        z-index: 30;
    }

    45%,
    50% {
        left: calc(130px + (100% - 130px) * 0.4333 + 6px);
        top: 15%;
        opacity: 0;
    }

    45% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
        left: 0;
        top: 50%;
    }
}

@keyframes mobileDistributionDocumentFlow2 {
    0% {
        left: 0;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.4);
        opacity: 0;
        z-index: 30;
    }

    5% {
        opacity: 1;
        transform: translateY(-50%) scale(0.8);
    }

    12.5% {
        left: 35px;
        top: calc(50% + 14px);
    }

    15% {
        left: 45px;
        opacity: 1;
        z-index: 30;
    }

    15.5% {
        z-index: 10;
    }

    20% {
        left: 55px;
        opacity: 0;
        z-index: 10;
        top: 50%;
    }

    27.5% {
        left: 130px;
        opacity: 1;
        z-index: 10;
        top: 50%;
    }

    28% {
        z-index: 30;
    }

    45%,
    50% {
        left: calc(130px + (100% - 130px) * 0.3699 + 6px);
        top: 37.5%;
        opacity: 0;
    }

    45% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
        left: 0;
        top: 50%;
    }
}

@keyframes mobileDistributionDocumentFlow3 {
    0% {
        left: 0;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.4);
        opacity: 0;
        z-index: 30;
    }

    5% {
        opacity: 1;
        transform: translateY(-50%) scale(0.8);
    }

    12.5% {
        left: 35px;
        top: calc(50% + 14px);
    }

    15% {
        left: 45px;
        opacity: 1;
        z-index: 30;
    }

    15.5% {
        z-index: 10;
    }

    20% {
        left: 55px;
        opacity: 0;
        z-index: 10;
        top: 50%;
    }

    27.5% {
        left: 130px;
        opacity: 1;
        z-index: 10;
        top: 50%;
    }

    28% {
        z-index: 30;
    }

    45%,
    50% {
        left: calc(130px + (100% - 130px) * 0.4122 + 6px);
        top: 62.5%;
        opacity: 0;
    }

    45% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
        left: 0;
        top: 50%;
    }
}

@keyframes mobileDistributionDocumentFlow4 {
    0% {
        left: 0;
        top: calc(50% + 14px);
        transform: translateY(-50%) scale(0.4);
        opacity: 0;
        z-index: 30;
    }

    5% {
        opacity: 1;
        transform: translateY(-50%) scale(0.8);
    }

    12.5% {
        left: 35px;
        top: calc(50% + 14px);
    }

    15% {
        left: 45px;
        opacity: 1;
        z-index: 30;
    }

    15.5% {
        z-index: 10;
    }

    20% {
        left: 55px;
        opacity: 0;
        z-index: 10;
        top: 50%;
    }

    27.5% {
        left: 130px;
        opacity: 1;
        z-index: 10;
        top: 50%;
    }

    28% {
        z-index: 30;
    }

    45%,
    50% {
        left: calc(130px + (100% - 130px) * 0.3910 + 6px);
        top: 85%;
        opacity: 0;
    }

    45% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
        left: 0;
        top: 50%;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .distribution-animation-container {
        height: 260px;
        padding: 0.75rem;
        margin: 1rem 0 1.5rem 0;
    }

    .distribution-animation-container .distributor {
        left: 10px;
        width: 160px;
        transform: translateY(-50%) scale(0.7);
        transform-origin: left center;
    }

    .distribution-animation-container .team-members {
        left: 130px;
    }

    .distribution-animation-container .member-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .distribution-animation-container .document {
        width: 24px;
        height: 30px;
        font-size: 0.875rem;
    }

    .distribution-animation-container .team-member:nth-child(1) {
        left: 43.33%;
    }

    .distribution-animation-container .team-member:nth-child(2) {
        left: 36.99%;
    }

    .distribution-animation-container .team-member:nth-child(3) {
        left: 41.22%;
    }

    .distribution-animation-container .team-member:nth-child(4) {
        left: 39.10%;
    }

    /* Switch to mobile animations */
    .distribution-animation-container .doc-1 {
        animation-name: mobileDistributionDocumentFlow1;
    }

    .distribution-animation-container .doc-2 {
        animation-name: mobileDistributionDocumentFlow2;
    }

    .distribution-animation-container .doc-3 {
        animation-name: mobileDistributionDocumentFlow3;
    }

    .distribution-animation-container .doc-4 {
        animation-name: mobileDistributionDocumentFlow4;
    }
}

/* ============================================
   Lead Prioritization Animation Styles
   ============================================ */

.prioritization-animation-container {
    width: 100%;
    max-width: 100%;
    height: 320px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* AI Prioritization Processor (Left) */
.prioritization-animation-container .ai-processor {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    z-index: 20;
}

.prioritization-animation-container .processor-core {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 50%;
    position: relative;
    box-shadow:
        0 8px 16px rgba(245, 158, 11, 0.4),
        inset 0 2px 8px rgba(255, 255, 255, 0.3),
        inset 0 -2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #b45309;
    animation: processorPulse 2s ease-in-out infinite;
}

.prioritization-animation-container .processor-core::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.prioritization-animation-container .processor-icon {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.prioritization-animation-container .processor-rings {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.prioritization-animation-container .processor-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ringExpand 2s ease-out infinite;
}

.prioritization-animation-container .processor-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.prioritization-animation-container .processor-ring:nth-child(3) {
    animation-delay: 1s;
}

/* Lead Cards Container (Right) */
.prioritization-animation-container .leads-stack {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    height: 260px;
    z-index: 10;
}

.prioritization-animation-container .lead-card {
    position: absolute;
    width: 100%;
    height: 60px;
    background: white;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    opacity: 0;
}

/* Z-index based on final position: top to bottom = high to low */
.prioritization-animation-container .lead-card-1 {
    z-index: 18; /* High priority - Top position (22%) */
}

.prioritization-animation-container .lead-card-2 {
    z-index: 17; /* Medium priority - Second position (39%) */
}

.prioritization-animation-container .lead-card-3 {
    z-index: 16; /* Medium priority - Third position (56%) */
}

.prioritization-animation-container .lead-card-4 {
    z-index: 15; /* Low priority - Bottom position (73%) */
}

.prioritization-animation-container .lead-card.active {
    opacity: 1;
}

.prioritization-animation-container .lead-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.prioritization-animation-container .lead-info {
    flex: 1;
    min-width: 0;
}

.prioritization-animation-container .lead-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prioritization-animation-container .lead-source {
    font-size: 0.75rem;
    color: #64748b;
}

.prioritization-animation-container .lead-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
    text-align: right;
}

.prioritization-animation-container .status-value {
    font-weight: 600;
    font-size: 0.75rem;
    color: #0f172a;
    line-height: 1.2;
    white-space: nowrap;
}

.prioritization-animation-container .priority-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prioritization-animation-container .priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.prioritization-animation-container .priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.prioritization-animation-container .priority-low {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

/* Lead Card Animations */
.prioritization-animation-container .lead-card-1 {
    animation: leadCardFlow1 10s ease-in-out infinite;
    animation-delay: 2s; /* Second to appear */
}

.prioritization-animation-container .lead-card-2 {
    animation: leadCardFlow2 10s ease-in-out infinite;
    animation-delay: 0s; /* First to appear - New Lead */
}

.prioritization-animation-container .lead-card-3 {
    animation: leadCardFlow3 10s ease-in-out infinite;
    animation-delay: 4s; /* Third to appear */
}

.prioritization-animation-container .lead-card-4 {
    animation: leadCardFlow4 10s ease-in-out infinite;
    animation-delay: 6s; /* Fourth to appear */
}

/* Keyframe Animations */
@keyframes processorPulse {
    0%, 100% {
        transform: translateY(-50%) scale(1);
        box-shadow:
            0 8px 16px rgba(245, 158, 11, 0.4),
            inset 0 2px 8px rgba(255, 255, 255, 0.3),
            inset 0 -2px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: translateY(-50%) scale(1.05);
        box-shadow:
            0 12px 24px rgba(245, 158, 11, 0.5),
            inset 0 2px 8px rgba(255, 255, 255, 0.4),
            inset 0 -2px 8px rgba(0, 0, 0, 0.2);
    }
}

@keyframes ringExpand {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }
    100% {
        width: 180%;
        height: 180%;
        opacity: 0;
    }
}

@keyframes leadCardFlow1 {
    0% {
        right: -300px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        z-index: 19; /* Moving card on top */
    }
    5% {
        opacity: 1;
        right: 30px;
        z-index: 19; /* Moving card on top */
    }
    15% {
        top: 50%;
        transform: translateY(-50%);
        z-index: 19; /* Moving card on top */
    }
    25% {
        top: 22%;
        transform: translateY(-50%);
        z-index: 18; /* Final position z-index (High - top) */
    }
    30%, 90% {
        top: 22%;
        transform: translateY(-50%);
        z-index: 18; /* Maintain final position z-index */
    }
    95% {
        opacity: 1;
    }
    100% {
        right: 30px;
        top: 22%;
        transform: translateY(-50%);
        opacity: 0;
        z-index: 18; /* Final position z-index */
    }
}

@keyframes leadCardFlow2 {
    0% {
        right: -300px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        z-index: 19; /* Moving card on top */
    }
    5% {
        opacity: 1;
        right: 30px;
        z-index: 19; /* Moving card on top */
    }
    15% {
        top: 50%;
        transform: translateY(-50%);
        z-index: 19; /* Moving card on top */
    }
    25% {
        top: 39%;
        transform: translateY(-50%);
        z-index: 17; /* Final position z-index (Medium - second) */
    }
    30%, 90% {
        top: 39%;
        transform: translateY(-50%);
        z-index: 17; /* Maintain final position z-index */
    }
    95% {
        opacity: 1;
    }
    100% {
        right: 30px;
        top: 39%;
        transform: translateY(-50%);
        opacity: 0;
        z-index: 17; /* Final position z-index */
    }
}

@keyframes leadCardFlow3 {
    0% {
        right: -300px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        z-index: 19; /* Moving card on top */
    }
    5% {
        opacity: 1;
        right: 30px;
        z-index: 19; /* Moving card on top */
    }
    15% {
        top: 50%;
        transform: translateY(-50%);
        z-index: 19; /* Moving card on top */
    }
    25% {
        top: 56%;
        transform: translateY(-50%);
        z-index: 16; /* Final position z-index (Medium - third) */
    }
    30%, 90% {
        top: 56%;
        transform: translateY(-50%);
        z-index: 16; /* Maintain final position z-index */
    }
    95% {
        opacity: 1;
    }
    100% {
        right: 30px;
        top: 56%;
        transform: translateY(-50%);
        opacity: 0;
        z-index: 16; /* Final position z-index */
    }
}

@keyframes leadCardFlow4 {
    0% {
        right: -300px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        z-index: 19; /* Moving card on top */
    }
    5% {
        opacity: 1;
        right: 30px;
        z-index: 19; /* Moving card on top */
    }
    15% {
        top: 50%;
        transform: translateY(-50%);
        z-index: 19; /* Moving card on top */
    }
    25% {
        top: 73%;
        transform: translateY(-50%);
        z-index: 15; /* Final position z-index (Low - bottom) */
    }
    30%, 90% {
        top: 73%;
        transform: translateY(-50%);
        z-index: 15; /* Maintain final position z-index */
    }
    95% {
        opacity: 1;
    }
    100% {
        right: 30px;
        top: 73%;
        transform: translateY(-50%);
        opacity: 0;
        z-index: 15; /* Final position z-index */
    }
}

/* Mobile Responsiveness for Prioritization Animation */
@media (max-width: 768px) {
    .prioritization-animation-container {
        height: 280px;
        padding: 1rem;
    }

    .prioritization-animation-container .ai-processor {
        left: 20px;
        width: 80px;
        height: 80px;
    }

    .prioritization-animation-container .processor-icon {
        font-size: 1.75rem;
    }

    .prioritization-animation-container .leads-stack {
        right: 15px;
        width: calc(100% - 120px);
    }

    .prioritization-animation-container .lead-card {
        height: 50px;
        padding: 0.5rem 0.75rem;
    }

    .prioritization-animation-container .lead-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .prioritization-animation-container .lead-name {
        font-size: 0.75rem;
    }

    .prioritization-animation-container .lead-source {
        font-size: 0.625rem;
    }

    .prioritization-animation-container .status-value {
        font-size: 0.625rem;
    }

    .prioritization-animation-container .priority-badge {
        font-size: 0.5rem;
        padding: 0.125rem 0.25rem;
    }
}

/* ============================================
   360° Contact View Animation Styles
   ============================================ */

.contact-view-animation-container {
    width: 100%;
    max-width: 100%;
    height: 320px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Center Contact Profile */
.contact-view-animation-container .contact-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    z-index: 20;
}

.contact-view-animation-container .contact-avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 2rem;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
    border: 4px solid white;
    position: relative;
    animation: contactPulse 3s ease-in-out infinite;
}

.contact-view-animation-container .contact-avatar::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.3);
    animation: contactRingExpand 3s ease-out infinite;
}

.contact-view-animation-container .contact-name {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
}

/* Interaction Events Around Center */
.contact-view-animation-container .interaction-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    z-index: 10;
}

.contact-view-animation-container .interaction-item {
    position: absolute;
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    opacity: 0;
    z-index: 15;
}

.contact-view-animation-container .interaction-item.active {
    opacity: 1;
}

.contact-view-animation-container .interaction-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.contact-view-animation-container .interaction-icon.phone {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.contact-view-animation-container .interaction-icon.email {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.contact-view-animation-container .interaction-icon.meeting {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.contact-view-animation-container .interaction-icon.message {
    background: linear-gradient(135deg, #10b981, #059669);
}

.contact-view-animation-container .interaction-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-view-animation-container .interaction-time {
    font-size: 0.5rem;
    color: #94a3b8;
}

/* Connection Lines */
.contact-view-animation-container .connection-line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 0 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.1));
    opacity: 0;
    z-index: 5;
}

.contact-view-animation-container .connection-line.active {
    opacity: 1;
    animation: lineDraw 0.8s ease-out;
}

/* Interaction Item Positions (360° around center) */
.contact-view-animation-container .interaction-item-1 {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: interactionAppear1 8s ease-in-out infinite;
    animation-delay: 0s;
}

.contact-view-animation-container .interaction-item-2 {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
    animation: interactionAppear2 8s ease-in-out infinite;
    animation-delay: 1.5s;
}

.contact-view-animation-container .interaction-item-3 {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    animation: interactionAppear3 8s ease-in-out infinite;
    animation-delay: 3s;
}

.contact-view-animation-container .interaction-item-4 {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    animation: interactionAppear4 8s ease-in-out infinite;
    animation-delay: 4.5s;
}

/* Connection Lines Positioning */
.contact-view-animation-container .connection-line-1 {
    width: 120px;
    transform: translate(-50%, -50%) rotate(-90deg);
    top: 50%;
    left: 50%;
    animation: lineAppear1 8s ease-in-out infinite;
    animation-delay: 0.3s;
}

.contact-view-animation-container .connection-line-2 {
    width: 120px;
    transform: translate(-50%, -50%) rotate(0deg);
    top: 50%;
    left: 50%;
    animation: lineAppear2 8s ease-in-out infinite;
    animation-delay: 1.8s;
}

.contact-view-animation-container .connection-line-3 {
    width: 120px;
    transform: translate(-50%, -50%) rotate(90deg);
    top: 50%;
    left: 50%;
    animation: lineAppear3 8s ease-in-out infinite;
    animation-delay: 3.3s;
}

.contact-view-animation-container .connection-line-4 {
    width: 120px;
    transform: translate(-50%, -50%) rotate(180deg);
    top: 50%;
    left: 50%;
    animation: lineAppear4 8s ease-in-out infinite;
    animation-delay: 4.8s;
}

/* Keyframe Animations */
@keyframes contactPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 12px 24px rgba(16, 185, 129, 0.4);
    }
}

@keyframes contactRingExpand {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }
    100% {
        width: 150%;
        height: 150%;
        opacity: 0;
    }
}

@keyframes interactionAppear1 {
    0%, 10% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    90%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

@keyframes interactionAppear2 {
    0%, 18.75% {
        opacity: 0;
        transform: translate(50%, -50%) scale(0.5);
    }
    23.75% {
        opacity: 1;
        transform: translate(50%, -50%) scale(1);
    }
    81.25% {
        opacity: 1;
        transform: translate(50%, -50%) scale(1);
    }
    86.25%, 100% {
        opacity: 0;
        transform: translate(50%, -50%) scale(0.5);
    }
}

@keyframes interactionAppear3 {
    0%, 37.5% {
        opacity: 0;
        transform: translate(-50%, 50%) scale(0.5);
    }
    42.5% {
        opacity: 1;
        transform: translate(-50%, 50%) scale(1);
    }
    75% {
        opacity: 1;
        transform: translate(-50%, 50%) scale(1);
    }
    80%, 100% {
        opacity: 0;
        transform: translate(-50%, 50%) scale(0.5);
    }
}

@keyframes interactionAppear4 {
    0%, 56.25% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    61.25% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    68.75% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    73.75%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

@keyframes lineDraw {
    0% {
        width: 0;
    }
    100% {
        width: 120px;
    }
}

@keyframes lineAppear1 {
    0%, 10% {
        opacity: 0;
        width: 0;
    }
    15% {
        opacity: 1;
        width: 120px;
    }
    85% {
        opacity: 1;
        width: 120px;
    }
    90%, 100% {
        opacity: 0;
        width: 0;
    }
}

@keyframes lineAppear2 {
    0%, 18.75% {
        opacity: 0;
        width: 0;
    }
    23.75% {
        opacity: 1;
        width: 120px;
    }
    81.25% {
        opacity: 1;
        width: 120px;
    }
    86.25%, 100% {
        opacity: 0;
        width: 0;
    }
}

@keyframes lineAppear3 {
    0%, 37.5% {
        opacity: 0;
        width: 0;
    }
    42.5% {
        opacity: 1;
        width: 120px;
    }
    75% {
        opacity: 1;
        width: 120px;
    }
    80%, 100% {
        opacity: 0;
        width: 0;
    }
}

@keyframes lineAppear4 {
    0%, 56.25% {
        opacity: 0;
        width: 0;
    }
    61.25% {
        opacity: 1;
        width: 120px;
    }
    68.75% {
        opacity: 1;
        width: 120px;
    }
    73.75%, 100% {
        opacity: 0;
        width: 0;
    }
}

/* Mobile Responsiveness for Contact View Animation */
@media (max-width: 768px) {
    .contact-view-animation-container {
        height: 280px;
        padding: 1rem;
    }

    .contact-view-animation-container .contact-center {
        width: 80px;
        height: 80px;
    }

    .contact-view-animation-container .contact-avatar {
        font-size: 1.5rem;
    }

    .contact-view-animation-container .contact-name {
        font-size: 0.75rem;
        bottom: -25px;
    }

    .contact-view-animation-container .interaction-orbit {
        width: 200px;
        height: 200px;
    }

    .contact-view-animation-container .interaction-item {
        width: 60px;
        height: 60px;
    }

    .contact-view-animation-container .interaction-icon {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    .contact-view-animation-container .interaction-label {
        font-size: 0.5rem;
    }

    .contact-view-animation-container .interaction-time {
        font-size: 0.4rem;
    }

    .contact-view-animation-container .connection-line-1,
    .contact-view-animation-container .connection-line-2,
    .contact-view-animation-container .connection-line-3,
    .contact-view-animation-container .connection-line-4 {
        width: 100px;
    }
}

/* ============================================
   Dynamic Form Builder Animation Styles
   ============================================ */

.form-builder-animation-container {
    width: 100%;
    max-width: 100%;
    height: 320px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Form Builder Layout */
.form-builder-animation-container .builder-layout {
    display: flex;
    gap: 1.5rem;
    height: 100%;
    position: relative;
}

/* Field Toolbox (Left) */
.form-builder-animation-container .field-toolbox {
    width: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.form-builder-animation-container .toolbox-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-builder-animation-container .toolbox-item.active {
    opacity: 1;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.form-builder-animation-container .toolbox-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.form-builder-animation-container .toolbox-icon.text {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.form-builder-animation-container .toolbox-icon.email {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.form-builder-animation-container .toolbox-icon.phone {
    background: linear-gradient(135deg, #10b981, #059669);
}

.form-builder-animation-container .toolbox-icon.select {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.form-builder-animation-container .toolbox-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}

/* Form Canvas (Center) */
.form-builder-animation-container .form-canvas {
    flex: 1;
    background: white;
    border-radius: 0.5rem;
    border: 2px dashed #cbd5e1;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    z-index: 5;
}

.form-builder-animation-container .form-field {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.4s ease;
}

.form-builder-animation-container .form-field.active {
    opacity: 1;
    transform: translateX(0);
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.form-builder-animation-container .field-icon {
    width: 24px;
    height: 24px;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.form-builder-animation-container .field-info {
    flex: 1;
    min-width: 0;
}

.form-builder-animation-container .field-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.form-builder-animation-container .field-preview {
    height: 24px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    width: 100%;
}

.form-builder-animation-container .field-attribute {
    font-size: 0.625rem;
    color: #6366f1;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Lead Properties Preview (Right) */
.form-builder-animation-container .lead-preview {
    width: 140px;
    background: white;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-builder-animation-container .lead-preview-header {
    font-weight: 700;
    font-size: 0.75rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-builder-animation-container .lead-property {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s ease;
}

.form-builder-animation-container .lead-property.active {
    opacity: 1;
    transform: translateY(0);
}

.form-builder-animation-container .property-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-builder-animation-container .property-value {
    font-size: 0.75rem;
    color: #0f172a;
    font-weight: 500;
}

/* Connection Lines */
.form-builder-animation-container .field-connection {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.5), rgba(99, 102, 241, 0.2));
    z-index: 8;
    opacity: 0;
    width: 0;
}

.form-builder-animation-container .field-connection.active {
    opacity: 1;
}

/* Connection lines: start from form-canvas right edge, end at lead-preview left edge */
/* form-canvas padding: 1rem (16px), form-field padding: 0.75rem (12px), margin-bottom: 0.75rem (12px) */
/* Each form-field height ~64px, center at ~32px from top of field */
/* Connection 1: 16px (canvas padding) + 32px (field center) = 48px */
/* Connection 2: 16px + 64px (field1) + 12px (margin) + 32px = 124px */
/* Connection 3: 16px + 64px + 12px + 64px + 12px + 32px = 200px */
/* Connection line starts from form-canvas right edge (100% - 140px - 1.5rem) and extends to lead-preview left edge */
.form-builder-animation-container .connection-1 {
    top: 48px; /* Align with first form-field center */
    left: calc(100% - 140px - 1.5rem); /* Start from form-canvas right edge */
    width: 0;
}

.form-builder-animation-container .connection-2 {
    top: 124px; /* Align with second form-field center */
    left: calc(100% - 140px - 1.5rem); /* Start from form-canvas right edge */
    width: 0;
}

.form-builder-animation-container .connection-3 {
    top: 200px; /* Align with third form-field center */
    left: calc(100% - 140px - 1.5rem); /* Start from form-canvas right edge */
    width: 0;
}

/* Animations */
@keyframes toolboxItemAppear {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fieldAppear {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes propertyAppear {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes connectionDraw {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        width: 80px;
        opacity: 0.8;
    }
}

/* Toolbox Items Animation */
.form-builder-animation-container .toolbox-item-1 {
    animation: toolboxItemAppear 0.5s ease-out 0.5s forwards;
}

.form-builder-animation-container .toolbox-item-2 {
    animation: toolboxItemAppear 0.5s ease-out 1s forwards;
}

.form-builder-animation-container .toolbox-item-3 {
    animation: toolboxItemAppear 0.5s ease-out 1.5s forwards;
}

.form-builder-animation-container .toolbox-item-4 {
    animation: toolboxItemAppear 0.5s ease-out 2s forwards;
}

/* Form Fields Animation */
.form-builder-animation-container .form-field-1 {
    animation: fieldAppear 0.6s ease-out 2.5s forwards;
}

.form-builder-animation-container .form-field-2 {
    animation: fieldAppear 0.6s ease-out 3.5s forwards;
}

.form-builder-animation-container .form-field-3 {
    animation: fieldAppear 0.6s ease-out 4.5s forwards;
}

/* Lead Properties Animation */
.form-builder-animation-container .lead-property-1 {
    animation: propertyAppear 0.5s ease-out 3s forwards;
}

.form-builder-animation-container .lead-property-2 {
    animation: propertyAppear 0.5s ease-out 4s forwards;
}

.form-builder-animation-container .lead-property-3 {
    animation: propertyAppear 0.5s ease-out 5s forwards;
}

/* Connection Lines Animation */
.form-builder-animation-container .connection-1 {
    animation: connectionDraw1 0.6s ease-out 3.2s forwards;
}

.form-builder-animation-container .connection-2 {
    animation: connectionDraw2 0.6s ease-out 4.2s forwards;
}

.form-builder-animation-container .connection-3 {
    animation: connectionDraw3 0.6s ease-out 5.2s forwards;
}

@keyframes connectionDraw1 {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        width: 1.5rem; /* Gap between form-canvas and lead-preview */
        opacity: 0.8;
    }
}

@keyframes connectionDraw2 {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        width: 1.5rem; /* Gap between form-canvas and lead-preview */
        opacity: 0.8;
    }
}

@keyframes connectionDraw3 {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        width: 1.5rem; /* Gap between form-canvas and lead-preview */
        opacity: 0.8;
    }
}

/* Mobile Responsiveness for Form Builder Animation */
@media (max-width: 768px) {
    .form-builder-animation-container {
        height: 280px;
        padding: 1rem;
    }

    .form-builder-animation-container .builder-layout {
        gap: 1rem;
    }

    .form-builder-animation-container .field-toolbox {
        width: 80px;
    }

    .form-builder-animation-container .toolbox-item {
        padding: 0.5rem;
    }

    .form-builder-animation-container .toolbox-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .form-builder-animation-container .toolbox-label {
        font-size: 0.5rem;
    }

    .form-builder-animation-container .form-canvas {
        padding: 0.75rem;
    }

    .form-builder-animation-container .form-field {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .form-builder-animation-container .field-icon {
        width: 20px;
        height: 20px;
        font-size: 0.625rem;
    }

    .form-builder-animation-container .field-label {
        font-size: 0.625rem;
    }

    .form-builder-animation-container .field-preview {
        height: 20px;
    }

    .form-builder-animation-container .lead-preview {
        width: 100px;
        padding: 0.75rem;
    }

    .form-builder-animation-container .lead-preview-header {
        font-size: 0.625rem;
    }

    .form-builder-animation-container .property-label {
        font-size: 0.5rem;
    }

    .form-builder-animation-container .property-value {
        font-size: 0.625rem;
    }
}

/* ========================================
   Seamless Import Animation Styles
   ======================================== */

.import-animation-container {
    width: 100%;
    max-width: 100%;
    height: 320px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(236, 72, 153, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Source Files (Left) */
.import-animation-container .source-files {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 140px;
    z-index: 10;
}

.import-animation-container .file-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(-30px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

.import-animation-container .file-item.active {
    opacity: 1;
    transform: translateX(0);
    border-color: #ec4899;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.import-animation-container .file-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.import-animation-container .file-icon.csv {
    background: linear-gradient(135deg, #10b981, #059669);
}

.import-animation-container .file-icon.excel {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.import-animation-container .file-icon.sftp {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.import-animation-container .file-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
}

.import-animation-container .file-size {
    font-size: 0.625rem;
    color: #64748b;
}

/* Processing Center (Middle) */
.import-animation-container .processing-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
    z-index: 5;
}

.import-animation-container .processor-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    position: relative;
    z-index: 3;
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
    animation: processorRotate 3s linear infinite;
}

.import-animation-container .processing-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    z-index: 1;
}

.import-animation-container .processing-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 50%;
    animation: ringExpand 2s ease-in-out infinite;
}

.import-animation-container .processing-ring.ring-1 {
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.import-animation-container .processing-ring.ring-2 {
    width: 100px;
    height: 100px;
    animation-delay: 0.3s;
}

.import-animation-container .processing-ring.ring-3 {
    width: 120px;
    height: 120px;
    animation-delay: 0.6s;
}

.import-animation-container .progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(236, 72, 153, 0.1);
    border-radius: 3px;
    margin-top: 1.5rem;
    overflow: hidden;
    position: relative;
}

.import-animation-container .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, #db2777);
    border-radius: 3px;
    width: 0;
    animation: progressFill 6s ease-in-out infinite;
}

.import-animation-container .processing-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Imported Leads (Right) */
.import-animation-container .imported-leads {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.import-animation-container .lead-row {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.4s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.import-animation-container .lead-row.active {
    opacity: 1;
    transform: translateX(0);
    border-color: #10b981;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.1);
}

.import-animation-container .lead-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.import-animation-container .lead-details {
    flex: 1;
    min-width: 0;
}

.import-animation-container .lead-name-small {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.125rem;
}

.import-animation-container .lead-email-small {
    font-size: 0.625rem;
    color: #64748b;
}

.import-animation-container .import-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.import-animation-container .import-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 0.75rem;
}

/* Connection Arrows */
.import-animation-container .import-arrow {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.5), rgba(236, 72, 153, 0.2));
    z-index: 8;
    opacity: 0;
    width: 0;
    top: 50%;
    transform: translateY(-50%);
}

.import-animation-container .import-arrow.active {
    opacity: 1;
}

.import-animation-container .arrow-1 {
    left: 140px;
    width: 0;
    animation: arrowDraw1 8s ease-in-out infinite;
    animation-delay: 1.2s;
}

.import-animation-container .arrow-2 {
    left: 140px;
    width: 0;
    animation: arrowDraw2 8s ease-in-out infinite;
    animation-delay: 3.2s;
}

.import-animation-container .arrow-3 {
    left: 140px;
    width: 0;
    animation: arrowDraw3 8s ease-in-out infinite;
    animation-delay: 5.2s;
}

/* Animations */
@keyframes processorRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes ringExpand {
    0%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

@keyframes progressFill {
    0% {
        width: 0;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 100%;
    }
}

@keyframes fileSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes leadSlideIn {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes arrowDraw1 {
    0% {
        width: 0;
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    15% {
        width: calc(50% - 70px);
        opacity: 0.8;
    }
    25%, 100% {
        width: calc(50% - 70px);
        opacity: 0.8;
    }
}

@keyframes arrowDraw2 {
    0% {
        width: 0;
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    15% {
        width: calc(50% - 70px);
        opacity: 0.8;
    }
    25%, 100% {
        width: calc(50% - 70px);
        opacity: 0.8;
    }
}

@keyframes arrowDraw3 {
    0% {
        width: 0;
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    15% {
        width: calc(50% - 70px);
        opacity: 0.8;
    }
    25%, 100% {
        width: calc(50% - 70px);
        opacity: 0.8;
    }
}

/* Animation Activation via JavaScript */
.import-animation-container .file-item-1 {
    animation: fileSlideIn 0.6s ease-out 0.5s forwards;
}

.import-animation-container .file-item-2 {
    animation: fileSlideIn 0.6s ease-out 1.5s forwards;
}

.import-animation-container .file-item-3 {
    animation: fileSlideIn 0.6s ease-out 2.5s forwards;
}

.import-animation-container .lead-row-1 {
    animation: leadSlideIn 0.6s ease-out 3.5s forwards;
}

.import-animation-container .lead-row-2 {
    animation: leadSlideIn 0.6s ease-out 4s forwards;
}

.import-animation-container .lead-row-3 {
    animation: leadSlideIn 0.6s ease-out 4.5s forwards;
}

.import-animation-container .lead-row-4 {
    animation: leadSlideIn 0.6s ease-out 5s forwards;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .import-animation-container {
        height: 280px;
        padding: 1rem;
        gap: 1rem;
        flex-direction: column;
    }

    .import-animation-container .source-files {
        width: 100%;
        flex-direction: row;
        justify-content: center;
    }

    .import-animation-container .file-item {
        flex: 1;
        max-width: 100px;
    }

    .import-animation-container .file-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .import-animation-container .file-name {
        font-size: 0.625rem;
    }

    .import-animation-container .file-size {
        font-size: 0.5rem;
    }

    .import-animation-container .processor-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .import-animation-container .processing-rings {
        width: 80px;
        height: 80px;
    }

    .import-animation-container .processing-ring.ring-1 {
        width: 60px;
        height: 60px;
    }

    .import-animation-container .processing-ring.ring-2 {
        width: 80px;
        height: 80px;
    }

    .import-animation-container .processing-ring.ring-3 {
        width: 100px;
        height: 100px;
    }

    .import-animation-container .progress-bar {
        width: 150px;
    }

    .import-animation-container .imported-leads {
        width: 100%;
    }

    .import-animation-container .lead-row {
        padding: 0.5rem;
    }

    .import-animation-container .lead-avatar-small {
        width: 28px;
        height: 28px;
        font-size: 0.625rem;
    }

    .import-animation-container .lead-name-small {
        font-size: 0.625rem;
    }

    .import-animation-container .lead-email-small {
        font-size: 0.5rem;
    }

    .import-animation-container .import-arrow {
        display: none;
    }
}