@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

@keyframes progress-indeterminate {
    0% {
        transform: translateX(-100%) scaleX(0.4);
    }

    50% {
        transform: translateX(30%) scaleX(0.7);
    }

    100% {
        transform: translateX(200%) scaleX(0.4);
    }
}

[data-animate="fade-in"] {
    animation: fade-in 300ms ease both;
}

[data-animate="slide-up"] {
    animation: slide-up 350ms ease both;
}

[data-animate="slide-down"] {
    animation: slide-down 250ms ease both;
}

[data-animate="scale-in"] {
    animation: scale-in 250ms ease both;
}

[data-animate-delay="1"] {
    animation-delay: 75ms;
}

[data-animate-delay="2"] {
    animation-delay: 150ms;
}

[data-animate-delay="3"] {
    animation-delay: 225ms;
}

[data-animate-delay="4"] {
    animation-delay: 300ms;
}

.modal:not([hidden]),
.modal-dialog[open] {
    animation: fade-in 180ms ease both;
}

.modal:not([hidden]) .modal__dialog,
.modal-dialog[open] .modal-dialog__content {
    animation: scale-in 220ms ease both;
}

.primary-navigation[data-open="true"] {
    animation: slide-down 180ms ease both;
}

.toast {
    animation: slide-in-right 250ms ease both;
}

.toast[data-closing="true"] {
    animation: fade-out 180ms ease both;
}

.property-card,
.service-card,
.review-card,
.dashboard-card,
.stat-card {
    animation: slide-up 300ms ease both;
}

.property-grid > :nth-child(2),
.service-grid > :nth-child(2),
.review-grid > :nth-child(2),
.dashboard-card-grid > :nth-child(2),
.stat-card-grid > :nth-child(2) {
    animation-delay: 40ms;
}

.property-grid > :nth-child(3),
.service-grid > :nth-child(3),
.review-grid > :nth-child(3),
.dashboard-card-grid > :nth-child(3),
.stat-card-grid > :nth-child(3) {
    animation-delay: 80ms;
}

.property-grid > :nth-child(4),
.service-grid > :nth-child(4),
.review-grid > :nth-child(4),
.dashboard-card-grid > :nth-child(4),
.stat-card-grid > :nth-child(4) {
    animation-delay: 120ms;
}

.property-grid > :nth-child(5),
.service-grid > :nth-child(5),
.review-grid > :nth-child(5),
.dashboard-card-grid > :nth-child(5),
.stat-card-grid > :nth-child(5) {
    animation-delay: 160ms;
}

.property-grid > :nth-child(6),
.service-grid > :nth-child(6),
.review-grid > :nth-child(6),
.dashboard-card-grid > :nth-child(6),
.stat-card-grid > :nth-child(6) {
    animation-delay: 200ms;
}

.is-loading,
[data-loading="true"] {
    position: relative;
    pointer-events: none;
}

.is-loading::after,
[data-loading="true"]::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    border-radius: inherit;
    background: rgb(255 255 255 / 0.65);
    content: "";
    cursor: wait;
}

.skeleton {
    overflow: hidden;
    border-radius: var(--radius-small);
    background:
        linear-gradient(
            90deg,
            #e2e8f0 25%,
            #f8fafc 50%,
            #e2e8f0 75%
        );
    background-size: 200% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

.skeleton--text {
    width: 100%;
    height: 0.9rem;
}

.skeleton--title {
    width: 65%;
    height: 1.4rem;
}

.skeleton--image {
    width: 100%;
    aspect-ratio: 16 / 10;
}

.skeleton--circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.form-field[data-invalid="true"],
.form-message[data-shake="true"] {
    animation: shake 300ms ease;
}

.progress-indeterminate {
    position: relative;
    height: 4px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--color-border-light);
}

.progress-indeterminate::after {
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    content: "";
    transform-origin: left;
    animation: progress-indeterminate 1.2s ease-in-out infinite;
}

[data-pulse="true"] {
    animation: pulse 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    [data-animate],
    .modal,
    .modal-dialog,
    .modal__dialog,
    .modal-dialog__content,
    .primary-navigation,
    .toast,
    .property-card,
    .service-card,
    .review-card,
    .dashboard-card,
    .stat-card,
    .skeleton,
    .form-field,
    .form-message,
    .progress-indeterminate::after,
    [data-pulse="true"] {
        animation: none !important;
    }

    .property-card,
    .service-card,
    .property-card__image,
    .service-card__image,
    .button,
    .icon-button {
        transition: none !important;
    }
}