/* Optimized Services Carousel Component */
.carousel-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(255, 255, 255, 0.9));
    position: relative;
    overflow: hidden;
    contain: layout style paint;
    --carousel-item-width: 300px;
    --carousel-item-count: 7;
    --carousel-animation-duration: 40s;
    --carousel-gap: 24px;
}

.carousel-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(225, 29, 72, 0.03) 0%, transparent 70%);
    animation: carousel-glow 12s ease-in-out infinite;
    will-change: transform;
}

@keyframes carousel-glow {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(8%) scale(1.05); }
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    padding: 1.5rem 0;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.carousel-container::before,
.carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 10;
    pointer-events: none;
}

.carousel-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(248, 250, 252, 0.9), transparent);
}

.carousel-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(248, 250, 252, 0.9), transparent);
}

#carousel-track {
    display: flex;
    align-items: stretch;
    width: calc(var(--carousel-item-count) * 2 * var(--carousel-item-width));
    animation: marquee var(--carousel-animation-duration) linear infinite;
    backface-visibility: hidden;
}

.carousel-item {
    flex: 0 0 var(--carousel-item-width);
    box-sizing: border-box;
    padding: 0 calc(var(--carousel-gap) / 2);
    display: flex;
    align-items: stretch;
    transition: transform 0.3s ease;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-1 * var(--carousel-item-count) * var(--carousel-item-width)));
  }
}

/* Hover effects */
.carousel-container:hover #carousel-track {
    animation-play-state: paused;
}

.carousel-container:hover .carousel-item {
    opacity: 0.7;
}

.carousel-container:hover .carousel-item:hover {
    opacity: 1;
    transform: scale(1.03);
}

/* Clean Overview Service Card */
.service-card--overview {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.08), 
        0 2px 4px -1px rgba(0, 0, 0, 0.04);
    transform: translateY(0) translateZ(0);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 220px;
    will-change: transform, box-shadow, border-color;
}

/* Hover shimmer effect */
.service-card--overview::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(225, 29, 72, 0.08), 
        transparent
    );
    transition: left 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.service-card--overview > * {
    position: relative;
    z-index: 2;
}

.service-card--overview:hover::before {
    left: 100%;
}

.service-card--overview:hover {
    transform: translateY(-6px) scale(1.01) translateZ(0);
    border: 1px solid rgb(225, 29, 72);
}

.service-card--overview i {
    font-size: 2.5rem;
    color: rgb(225 29 72);
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: scale(1) translateZ(0);
    display: block;
    text-align: center;
    width: 100%;
}

.service-card--overview:hover i {
    transform: scale(1.08) rotate(3deg) translateZ(0);
    color: rgb(190, 18, 60);
}

.service-card--overview h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: rgb(51, 65, 85);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
    text-align: center;
    width: 100%;
}

.service-card--overview:hover h3 {
    color: rgb(225, 29, 72);
}

.service-card--overview p {
    font-size: 0.925rem;
    color: rgb(100, 116, 139);
    line-height: 1.5;
    margin: 0;
    text-align: center;
    width: 100%;
}

/* Clean card layout without categories */
.service-card--overview {
    padding: 2rem 1.5rem;
}

/* Legacy service card styles for backward compatibility */
.service-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.08), 
        0 2px 4px -1px rgba(0, 0, 0, 0.04);
    transform: translateY(0) translateZ(0);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    will-change: transform, box-shadow, border-color;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(225, 29, 72, 0.08), 
        transparent
    );
    transition: left 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.service-card > * {
    position: relative;
    z-index: 2;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-6px) scale(1.01) translateZ(0);
    border: 1px solid rgb(225, 29, 72);
}

.service-card i {
    font-size: 2.5rem;
    color: rgb(225 29 72);
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: scale(1) translateZ(0);
    display: block;
}

.service-card:hover i {
    transform: scale(1.08) rotate(3deg) translateZ(0);
    color: rgb(190, 18, 60);
}

.service-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: rgb(51, 65, 85);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.service-card:hover h3 {
    color: rgb(225, 29, 72);
}

.service-card p {
    font-size: 0.925rem;
    color: rgb(100, 116, 139);
    line-height: 1.5;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .carousel-section {
        --carousel-item-width: 280px;
        --carousel-animation-duration: 35s;
        --carousel-gap: 20px;
    }
    
    .carousel-container {
        height: 280px;
    }
    
    .service-card--overview {
        min-height: 220px;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .carousel-section {
        --carousel-item-width: 260px;
        --carousel-animation-duration: 30s;
        --carousel-gap: 16px;
    }
    
    .carousel-container {
        height: 260px;
    }
    
    .service-card,
    .service-card--overview {
        padding: 1.75rem 1.25rem;
        min-height: 200px;
    }

    .service-card i,
    .service-card--overview i {
        font-size: 2.25rem;
    }
}

@media (max-width: 480px) {
    .carousel-section {
        --carousel-item-width: 240px;
        --carousel-animation-duration: 25s;
        --carousel-gap: 12px;
    }
    
    .carousel-container {
        height: 240px;
    }

    .service-card,
    .service-card--overview {
        padding: 1.5rem 1rem;
        min-height: 180px;
    }
    
    .service-card i,
    .service-card--overview i {
        font-size: 2rem;
    }
    
    .service-card h3,
    .service-card--overview h3 {
        font-size: 1rem;
    }
    
    .service-card p,
    .service-card--overview p {
        font-size: 0.875rem;
    }
}

/* Performance optimizations */
.carousel-section {
    contain: layout style paint;
}

#carousel-track {
    contain: layout style;
}

.service-card,
.service-card--overview {
    contain: layout style;
}

/* Scroll reveal animation */
.scroll-reveal {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .carousel-section {
        --carousel-animation-duration: 60s; /* Much slower for reduced motion */
    }
    
    .carousel-item {
        animation-play-state: paused !important;
    }
    
    .carousel-glow,
    .service-card::before,
    .service-card--overview::before,
    .service-card:hover,
    .service-card--overview:hover {
        animation: none !important;
        transition: none !important;
    }
    
    .service-card:hover,
    .service-card--overview:hover {
        transform: none !important;
    }
    
    .carousel-container:hover .carousel-item:hover {
        transform: none !important;
    }
}

/* High performance mode for older devices */
@media (max-resolution: 150dpi) {
    .service-card,
    .service-card--overview {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 1);
    }
} 