/* Motion Design for Buttons */

/* Base transitions */
.btn,
button,
input[type="submit"],
input[type="button"] {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Hover & Active states */
.btn:hover:not(:disabled),
button:hover:not(:disabled),
input[type="submit"]:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active:not(:disabled),
button:active:not(:disabled),
input[type="submit"]:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Loading State */
.btn-loading {
    color: transparent !important;
    pointer-events: none !important;
    position: relative;
    opacity: 0.8;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: calc(50% - 10px);
    left: calc(50% - 10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Feedback */
.btn-success-feedback {
    animation: btn-pulse-success 0.5s ease;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

@keyframes btn-pulse-success {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.5);
    }

    100% {
        transform: scale(1);
    }
}

/* Error Feedback */
.btn-error-feedback {
    animation: btn-shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

@keyframes btn-shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Specific for Filter/Clear buttons */
.btn-filter.btn-loading::after,
.btn-clear.btn-loading::after {
    border-top-color: var(--primary, #eb8153);
}

/* Filter indicator dot */
.btn-filter-wrapper {
    position: relative;
    display: inline-block;
}

.filter-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background-color: #FF4C41;
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
    z-index: 2;
}

.filter-dot.active {
    display: block;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 76, 65, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 76, 65, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 76, 65, 0);
    }
}

.offcanvas-footer {
    background: #fff;
    z-index: 3;
}