/* Modern compact service grid cards */
#service-grid .service-card.service-card--modern {
    background: linear-gradient(165deg, rgba(28, 28, 32, 0.96) 0%, rgba(18, 18, 22, 0.98) 100%);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    min-height: 0;
    height: auto;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

#service-grid .service-card.service-card--modern::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    z-index: 0;
}

#service-grid .service-card.service-card--modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 165, 0, 0.1);
}

#service-grid .service-card.service-card--modern.pushed {
    border-color: #ffd700 !important;
    border-width: 3px !important;
    box-shadow:
        0 10px 36px rgba(0, 0, 0, 0.5),
        0 0 32px rgba(255, 215, 0, 0.65),
        0 0 56px rgba(255, 165, 0, 0.4),
        inset 0 0 14px rgba(255, 215, 0, 0.12) !important;
    animation: service-card-push-glow 2.2s ease-in-out infinite;
    position: relative;
    z-index: 3;
}

#service-grid .service-card.service-card--modern.pushed::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        125deg,
        rgba(255, 215, 0, 0.22) 0%,
        transparent 42%,
        rgba(255, 140, 0, 0.18) 100%
    );
    animation: service-card-push-shimmer 2.8s ease-in-out infinite;
}

@keyframes service-card-push-glow {
    0%, 100% {
        box-shadow:
            0 10px 36px rgba(0, 0, 0, 0.5),
            0 0 28px rgba(255, 215, 0, 0.55),
            0 0 48px rgba(255, 165, 0, 0.32),
            inset 0 0 12px rgba(255, 215, 0, 0.1);
    }
    50% {
        box-shadow:
            0 14px 44px rgba(0, 0, 0, 0.55),
            0 0 40px rgba(255, 215, 0, 0.85),
            0 0 64px rgba(255, 165, 0, 0.5),
            inset 0 0 18px rgba(255, 215, 0, 0.18);
    }
}

@keyframes service-card-push-shimmer {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

#service-grid .service-card.service-card--modern.has-custom-border:not(.pushed) {
    border-width: 2px !important;
    opacity: 0.98;
}

/* Header: name + push */
#service-grid .service-card.service-card--modern .service-card-header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 6px;
    position: relative;
    z-index: 2;
}

#service-grid .service-card.service-card--modern .service-card-username-compact {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    -webkit-text-fill-color: #fff;
    background: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

#service-grid .service-card.service-card--modern .service-card-content-compact {
    padding: 0 10px 8px;
    position: relative;
    z-index: 2;
}

/* Image: shorter, 4:3 */
#service-grid .service-card.service-card--modern .service-card-image-compact-wrapper {
    margin-bottom: 8px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

#service-grid .service-card.service-card--modern .service-card-image-compact-frame {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#service-grid .service-card.service-card--modern .service-card-image-compact,
#service-grid .service-card.service-card--modern .profile-card-img-compact,
#service-grid .service-card.service-card--modern .service-image-placeholder-compact {
    height: 132px !important;
    min-height: 132px !important;
    max-height: 132px !important;
}

#service-grid .service-card.service-card--modern .profile-card-img-compact {
    object-fit: cover;
    border-radius: 0;
}

/* Category pills overlaid on image bottom */
#service-grid .service-card.service-card--modern .service-categories-compact {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    margin: 0;
    min-height: 28px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
    z-index: 4;
    pointer-events: none;
}

#service-grid .service-card.service-card--modern .service-categories-compact .category-badge-3d {
    width: auto !important;
    min-height: 0 !important;
    padding: 3px 8px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em;
    border-radius: 999px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35) !important;
    pointer-events: auto;
    flex: 0 0 auto;
    grid-column: auto !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#service-grid .service-card.service-card--modern .service-categories-compact .category-badge-3d:hover {
    transform: translateY(-1px) scale(1.03);
}

#service-grid .service-card.service-card--modern .service-categories-compact .no-categories-text {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
}

/* Meta row: compact chips */
#service-grid .service-card.service-card--modern .service-card-info-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#service-grid .service-card.service-card--modern .service-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#service-grid .service-card.service-card--modern .service-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

#service-grid .service-card.service-card--modern .service-meta-chip i {
    font-size: 0.65rem;
    opacity: 0.75;
}

#service-grid .service-card.service-card--modern .service-profile-info-compact {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

#service-grid .service-card.service-card--modern .bio-compact {
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
    color: rgba(255, 255, 255, 0.65) !important;
    font-style: normal;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Actions: slim bar */
#service-grid .service-card.service-card--modern .service-card-actions-compact {
    display: flex;
    gap: 6px;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
    position: relative;
    z-index: 2;
}

#service-grid .service-card.service-card--modern .btn-action-compact {
    flex: 1;
    min-height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    transition: background 0.18s, border-color 0.18s;
}

#service-grid .service-card.service-card--modern .btn-action-compact:hover {
    background: rgba(255, 179, 0, 0.18);
    border-color: rgba(255, 179, 0, 0.4);
    transform: none;
}

#service-grid .service-card.service-card--modern .push-badge-card {
    background: linear-gradient(135deg, #ffe566 0%, #ffd700 35%, #ff8c00 100%);
    color: #1a1200;
    font-weight: 800;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
        0 2px 10px rgba(255, 215, 0, 0.55),
        0 0 16px rgba(255, 165, 0, 0.35);
    flex-shrink: 0;
    animation: push-badge-pulse 2s ease-in-out infinite;
}

@keyframes push-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* Override legacy min-heights from styles.css */
#service-grid .service-card.service-card--modern {
    min-height: unset !important;
    max-height: none !important;
    padding-bottom: 0 !important;
}

@media (max-width: 480px) {
    #service-grid .service-card.service-card--modern .service-card-image-compact,
    #service-grid .service-card.service-card--modern .profile-card-img-compact,
    #service-grid .service-card.service-card--modern .service-image-placeholder-compact {
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
    }
}
