/* Badrock Animation Button Widget Styles */

/* Button Base Styles */
.badrock-animation-button-wrapper {
    display: inline-block;
}

.badrock-animation-button {
    display: inline-block;
    background: #d4af37;
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.badrock-animation-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.badrock-animation-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animation Classes for Target Elements */

/* Fade Animations */
.animate-fade-out {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.animate-fade-in {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Slide Animations */
.animate-slide-up {
    transform: translateY(-100%) !important;
    opacity: 0 !important;
}

.animate-slide-down {
    transform: translateY(100%) !important;
    opacity: 0 !important;
}

.animate-slide-left {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
}

.animate-slide-right {
    transform: translateX(100%) !important;
    opacity: 0 !important;
}

/* Zoom Animations */
.animate-zoom-in {
    transform: scale(1.2) !important;
    opacity: 0 !important;
}

.animate-zoom-out {
    transform: scale(0) !important;
    opacity: 0 !important;
}

/* Rotate Animation */
.animate-rotate {
    transform: rotate(180deg) !important;
    opacity: 0 !important;
}

/* Flip Animations */
.animate-flip-x {
    transform: rotateX(90deg) !important;
    opacity: 0 !important;
}

.animate-flip-y {
    transform: rotateY(90deg) !important;
    opacity: 0 !important;
}

/* Bounce Animation */
.animate-bounce {
    animation: bounceOut 0.75s both !important;
}

@keyframes bounceOut {
    20% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    50%, 55% {
        opacity: 1;
        transform: scale3d(1.1, 1.1, 1.1);
    }
    to {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
}

/* Shake Animation */
.animate-shake {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
}

@keyframes 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);
    }
}

/* Pulse Animation */
.animate-pulse {
    animation: pulse 0.6s ease-in-out infinite alternate !important;
}

@keyframes pulse {
    from {
        transform: scale3d(1, 1, 1);
    }
    to {
        transform: scale3d(1.05, 1.05, 1.05);
    }
}

/* Remove Animation - completely hidden */
.animate-remove {
    display: none !important;
}

/* Animation Base Class - ensures smooth transitions */
.animate-target {
    transition-property: all !important;
    transition-timing-function: ease !important;
    transition-duration: 0.8s !important;
}

/* Specific transition timing functions */
.animate-target.ease-in {
    transition-timing-function: ease-in !important;
}

.animate-target.ease-out {
    transition-timing-function: ease-out !important;
}

.animate-target.ease-in-out {
    transition-timing-function: ease-in-out !important;
}

.animate-target.linear {
    transition-timing-function: linear !important;
}

.animate-target.back {
    transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

/* Loading state for button */
.badrock-animation-button.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.badrock-animation-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .badrock-animation-button {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Accessibility */
.badrock-animation-button:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .badrock-animation-button {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .animate-target,
    .badrock-animation-button {
        transition: none !important;
        animation: none !important;
    }
    
    .animate-fade-out {
        display: none !important;
    }
}