/**
 * Morphext WP Stylesheet
 * Consolidated styles for secure morphext implementation
 */

/* Ensure morphext elements are properly styled */
.morphext-wp {
    display: none;
    visibility: hidden;
    opacity: 0;
}

.morphext-wp.morphext-initialized {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Animation keyframes for essential animations */
@keyframes bounceInLeft {
    from, 60%, 75%, 90%, to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    0% {
        opacity: 0;
        transform: translate3d(-3000px, 0, 0);
    }
    60% {
        opacity: 1;
        transform: translate3d(25px, 0, 0);
    }
    75% {
        transform: translate3d(-10px, 0, 0);
    }
    90% {
        transform: translate3d(5px, 0, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes flash {
    from, 50%, to {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

@keyframes pulse {
    from {
        transform: scale3d(1, 1, 1);
    }
    50% {
        transform: scale3d(1.05, 1.05, 1.05);
    }
    to {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Webkit prefixes for better browser compatibility */
@-webkit-keyframes bounceInLeft {
    from, 60%, 75%, 90%, to {
        -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    0% {
        opacity: 0;
        -webkit-transform: translate3d(-3000px, 0, 0);
    }
    60% {
        opacity: 1;
        -webkit-transform: translate3d(25px, 0, 0);
    }
    75% {
        -webkit-transform: translate3d(-10px, 0, 0);
    }
    90% {
        -webkit-transform: translate3d(5px, 0, 0);
    }
    to {
        -webkit-transform: translate3d(0, 0, 0);
    }
}

@-webkit-keyframes flash {
    from, 50%, to {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

@-webkit-keyframes pulse {
    from {
        -webkit-transform: scale3d(1, 1, 1);
    }
    50% {
        -webkit-transform: scale3d(1.05, 1.05, 1.05);
    }
    to {
        -webkit-transform: scale3d(1, 1, 1);
    }
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Ensure animation classes work with proper prefixes */
.animate__bounceInLeft {
    -webkit-animation-name: bounceInLeft !important;
    animation-name: bounceInLeft !important;
}

.animate__flash {
    -webkit-animation-name: flash !important;
    animation-name: flash !important;
}

.animate__pulse {
    -webkit-animation-name: pulse !important;
    animation-name: pulse !important;
}

.animate__fadeIn {
    -webkit-animation-name: fadeIn !important;
    animation-name: fadeIn !important;
}

/* Ensure animated elements are visible and properly styled */
.morphext-wp .animated {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}

/* Override common theme styles that might hide animations */
.theme-default .morphext-wp,
#content .morphext-wp,
.entry-content .morphext-wp,
.post-content .morphext-wp,
.page-content .morphext-wp {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure animations work in all containers */
div .morphext-wp,
section .morphext-wp,
article .morphext-wp,
aside .morphext-wp,
header .morphext-wp,
footer .morphext-wp,
nav .morphext-wp {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Target common theme selectors */
* .morphext-wp,
*[class*="content"] .morphext-wp,
*[class*="wrapper"] .morphext-wp,
*[class*="container"] .morphext-wp,
*[id*="content"] .morphext-wp,
*[id*="wrapper"] .morphext-wp,
*[id*="container"] .morphext-wp {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Additional overrides for stubborn themes */
html body .morphext-wp,
html div .morphext-wp,
body div .morphext-wp,
body > div .morphext-wp,
div[class*="content"] .morphext-wp,
div[id*="content"] .morphext-wp,
main .morphext-wp,
article .morphext-wp,
section .morphext-wp,
.entry-content .morphext-wp,
.post-content .morphext-wp,
.page-content .morphext-wp {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

/* Force visibility on all morphext elements */
.morphext-wp,
.morphext-wp.morphext-initialized,
.morphext .animated,
.animate__bounceInLeft,
.animate__flash,
.animate__pulse {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

/* Override any theme or plugin that hides elements */
body .morphext-wp { visibility: visible !important; opacity: 1 !important; }
div .morphext-wp { visibility: visible !important; opacity: 1 !important; }
span .morphext-wp { visibility: visible !important; opacity: 1 !important; }

/* Maximum specificity overrides */
html body div .morphext-wp { visibility: visible !important; opacity: 1 !important; }
html body span .morphext-wp { visibility: visible !important; opacity: 1 !important; }
#page .morphext-wp { visibility: visible !important; opacity: 1 !important; }
#content .morphext-wp { visibility: visible !important; opacity: 1 !important; }

/* Force visibility on all animated elements */
.animated { visibility: visible !important; opacity: 1 !important; }

/* Ensure animations run regardless of theme interference */
.animate__bounceInLeft, .animate__flash, .animate__pulse {
    -webkit-animation-duration: 1s !important;
    animation-duration: 1s !important;
    -webkit-animation-fill-mode: both !important;
    animation-fill-mode: both !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

/* Override any display:none or visibility:hidden set by theme JS */
.morphext-wp { display: inline-block !important; }
.morphext-initialized { display: inline-block !important; }

/* Force show all morphext elements */
.morphext { visibility: visible !important; opacity: 1 !important; }

/* Ensure animations still work */
.morphext-wp .animated {
    transition: all 1s !important;
    animation-duration: 1s !important;
    animation-fill-mode: both !important;
}

/* Override any JavaScript that might hide elements */
.js .morphext-wp,
.no-js .morphext-wp,
.morphext-wp.js-active,
.morphext-wp.js {
    visibility: visible !important;
    opacity: 1 !important;
}