/* الكرت الأساسي */
.msce-service-card {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    min-height: 260px;
    background: #111827;
    box-shadow: 0 20px 35px rgba(0,0,0,.45);
    padding: 0;
    direction: rtl;
}

.msce-service-card__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    filter: brightness(0.7);
    transition: transform .5s ease, filter .5s ease, opacity .3s ease;
    opacity: var(--msce-bg-opacity, 1);
}

.msce-service-card__overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(46,213,115,0.4), transparent 55%),
                radial-gradient(circle at bottom right, rgba(20,184,166,0.5), rgba(15,23,42,0.95));
    mix-blend-mode: multiply;
}

.msce-service-card__inner {
    position: relative;
    z-index: 2;
    padding: 24px 26px 24px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 260px;
}

.msce-service-card__corner-icon {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 46px;
    height: 46px;
    border-radius: 18px;
    background: rgba(15,23,42,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 25px rgba(0,0,0,.35);
    color: #fde68a;
    font-size: 20px;
    overflow: hidden;
}

.msce-service-card__corner-icon-img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.msce-service-card__title {
    margin: 0;
    margin-top: 40px;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 12px rgba(0,0,0,.7);
}

.msce-service-card__subtitle {
    margin-top: 4px;
    font-size: 14px;
    color: rgba(255,255,255,.85);
}

.msce-service-card__buttons {
    margin-top: auto;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.msce-btn {
    position: relative;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    outline: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.msce-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.msce-btn--secondary {
    background: rgba(15,23,42,0.9);
    color: #e5e7eb;
    box-shadow: 0 12px 24px rgba(0,0,0,.45);
}

.msce-btn--secondary .msce-btn__icon {
    transform: translateY(1px);
}

.msce-btn--primary {
    background: #22c55e;
    color: #f9fafb;
    box-shadow: 0 16px 30px rgba(34,197,94,.65);
}

.msce-btn--primary .msce-btn__icon {
    font-size: 16px;
}

.msce-btn--primary:hover {
    background: #16a34a;
}

.msce-btn--secondary:hover {
    background: rgba(15,23,42,1);
}

/* تأثيرات حركة الخلفية حسب الكلاس */
.msce-bg-effect-zoom:hover .msce-service-card__bg {
    transform: scale(1.12);
    filter: brightness(0.85);
}

.msce-bg-effect-pan-left:hover .msce-service-card__bg {
    transform: scale(1.08) translateX(-10px);
}

.msce-bg-effect-pan-right:hover .msce-service-card__bg {
    transform: scale(1.08) translateX(10px);
}

.msce-bg-effect-float:hover .msce-service-card__bg {
    animation: msce-bg-float 4s ease-in-out infinite;
}

@keyframes msce-bg-float {
    0% { transform: scale(1.05) translateY(0); }
    50% { transform: scale(1.08) translateY(-6px); }
    100% { transform: scale(1.05) translateY(0); }
}

/* شبكة الكروت (3 أو 4) */
.msce-service-section {
    padding: 20px 0;
}

.msce-service-cards-grid {
    display: grid;
    gap: 24px;
}

.msce-service-cards-grid.msce-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.msce-service-cards-grid.msce-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* أنيميشنات الأيقونة */
.msce-icon-anim-bounce {
    animation: msce-bounce .7s ease;
}

.msce-icon-anim-pulse {
    animation: msce-pulse .8s ease;
}

.msce-icon-anim-rotate {
    animation: msce-rotate .6s ease;
}

.msce-icon-anim-shake {
    animation: msce-shake .5s ease;
}

@keyframes msce-bounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
    60% { transform: translateY(4px); }
}

@keyframes msce-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

@keyframes msce-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes msce-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

/* موبايل وتابلت */
@media (max-width: 1024px) {
    .msce-service-cards-grid.msce-cols-3,
    .msce-service-cards-grid.msce-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .msce-service-card__inner {
        padding: 22px 20px 20px 20px;
    }
    .msce-service-card__title {
        font-size: 22px;
    }
    .msce-service-card__buttons {
        flex-direction: column;
    }
    .msce-btn {
        width: 100%;
        justify-content: center;
    }
    .msce-service-cards-grid.msce-cols-3,
    .msce-service-cards-grid.msce-cols-4 {
        grid-template-columns: 1fr;
    }
}
