/* Custom animations */
@keyframes pulse-slow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 6s infinite;
}

.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

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

/* Equal height sections */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    min-height: 600px;
    align-items: stretch;
    gap: 1.5rem;
}

.services-content {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

.services-images {
    flex: 1 1 50%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
}

/* Service item hover styles */
.service-item {
    transition: background-color 0.3s ease, border-left 0.3s ease, padding-left 0.3s ease, border-radius 0.3s ease;
    cursor: pointer;
}

.service-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    border-radius: 0.5rem;
}

/* Ensure service image container consistency */
.service-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    height: 16rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Smooth image transitions */
.service-image {
    opacity: 0;
    transform: translateX(50px) scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.service-image.active {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.service-image.floating {
    animation: float 3s ease-in-out infinite;
}

/* Tracing beam styles */
.tracing-beam-container {
    position: relative;
    display: flex;
}

.tracing-beam-beam {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 20px;
    z-index: 1;
}

.tracing-beam-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border-radius: 50%;
    transition: top 0.3s ease;
    z-index: 2;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.tracing-beam-line {
    stroke: #3b82f6;
    stroke-width: 2;
    fill: none;
}

/* Image hover effects */
.service-image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.service-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.service-image-container:hover::before {
    opacity: 1;
}

.service-label {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 2;
}

.service-image-container:hover .service-label {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 1023px) {
    .services-grid {
        flex-direction: column;
        min-height: auto;
        gap: 2rem;
    }

    .services-content,
    .services-images {
        flex: none;
        width: 100%;
    }

    .services-images {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, auto);
        gap: 1rem;
        padding: 0;
    }

    #service-visual {
        position: static;
        max-width: none;
        width: 100%;
    }

    .service-image-container {
        height: 10rem;
        max-width: none;
        margin: 0;
        opacity: 1 !important;
        transform: none !important;
    }

    .service-image {
        opacity: 1;
        transform: none;
    }

    .service-image.active,
    .service-image.floating {
        animation: none;
    }

    .tracing-beam-beam {
        display: none;
    }
}

@media (min-width: 1024px) {

    .services-content,
    .services-images {
        flex: 1;
    }
}