/* Existing CSS remains unchanged */
.scroll-wrapper {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.scroll-wrapper::-webkit-scrollbar {
    display: none;
}
.item, .item-lead {
    flex: 0 0 auto;
    margin-right: 10px;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative; /* Thêm để chứa absolute elements */
}
.item-meta-top {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px;
    z-index: 2;
}
.item-meta-bottom {
    position: absolute;
    bottom: 45px;
    left: 0;
    padding: 4px;
    z-index: 2;
}
.item-rating {
    font-size: 12px;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 2px 6px;
    border-radius: 12px 0 0 12px;
    display: inline-block;
}
.item-shield {
    font-size: 13px;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 4px;
    border-radius: 50%;
    display: inline-block;
}
.item {
    width: 100px;
}
.item-lead {
    width: 180px;
}
.image-wrapper {
    position: relative; /* Thêm để căn chỉnh tốt hơn */
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 100px; /* Đảm bảo không vượt quá */
    border: 2px solid #ff4f5e;
    border-radius: 50%;
    background-color: white;
    overflow: hidden;
    box-sizing: border-box; /* Quan trọng để tính padding chính xác */
    flex-shrink: 0; /* Không bị co lại */
}
.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block; /* Loại bỏ khoảng trống dưới img */
}
.image-wrapper-lead {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 18px;
    position: relative; /* Thêm để đảm bảo ảnh nằm đúng vị trí */
}
.image-wrapper-lead img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 18px;
}
.item-title {
    margin-top: 4px;
    font-size: 13px;
    color: #333;
    width: 100%;
    padding: 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.3; /* Thêm line-height cho đẹp hơn */
    box-sizing: border-box; /* Đảm bảo padding tính đúng */
}

/* ========== SKELETON STYLES ========== */
/* Skeleton base animation */
.skeleton-item {
    pointer-events: none;
}

.skeleton-banner,
.skeleton-circle,
.skeleton-text {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e8e8e8 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite linear;
}

/* Banner skeleton */
.skeleton-banner {
    width: 100%;
    height: 180px;
    border-radius: 18px;
}

/* Circle skeleton cho avatar */
.skeleton-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Text skeleton */
.skeleton-text {
    height: 10px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.skeleton-text-line1 {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

.skeleton-text-line2 {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

/* Shimmer animation */
@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Fade out skeleton */
.skeleton-wrapper.fade-out {
    animation: fadeOut 0.4s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Fade in real content */
#services-content.fade-in {
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for items */
#services-content .item {
    animation: slideIn 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Apply delays to items */
#services-content .item:nth-child(1) { animation-delay: 0s; }
#services-content .item:nth-child(2) { animation-delay: 0.05s; }
#services-content .item:nth-child(3) { animation-delay: 0.1s; }
#services-content .item:nth-child(4) { animation-delay: 0.15s; }
#services-content .item:nth-child(5) { animation-delay: 0.2s; }
#services-content .item:nth-child(6) { animation-delay: 0.25s; }
#services-content .item:nth-child(n+7) { animation-delay: 0.3s; }
