/**
 * Tierliebe Animation Styles
 * Module: Keyframes, Transitions, Hover Effects
 */

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   UX IMPROVEMENTS - MICRO-INTERACTIONS
   ============================================ */

/* Button Ripple Effect */
.btn,
.wp-block-button__link,
.wp-block-button a,
button[type="submit"],
input[type="submit"] {
    position: relative;
    overflow: hidden;
}

.btn::before,
.wp-block-button__link::before {
    content      : '';
    position     : absolute;
    top          : 50%;
    left         : 50%;
    width        : 0;
    height       : 0;
    border-radius: 50%;
    background   : rgba(255, 255, 255, 0.5);
    transform    : translate(-50%, -50%);
    transition   : width 0.6s, height 0.6s;
}

.btn:active::before,
.wp-block-button__link:active::before {
    width : 300px;
    height: 300px;
}

/* Smooth Accordion Content */
.accordion-content {
    opacity  : 0;
    transform: translateY(-10px);
}

.accordion-item.active .accordion-content {
    opacity  : 1;
    transform: translateY(0);
}

/* Tab Active Indicator */
.tab-btn {
    position: relative;
}

.tab-btn::after {
    content      : '';
    position     : absolute;
    bottom       : -3px;
    left         : 50%;
    transform    : translateX(-50%) scaleX(0);
    width        : 80%;
    height       : 4px;
    background   : var(--cute-mint);
    border-radius: 2px;
    transition   : transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn.active::after {
    transform: translateX(-50%) scaleX(1);
}

.tab-btn.active {
    transform: translateY(-2px);
}

/* Tab Content Fade-In */
.tab-content {
    opacity  : 0;
    transform: translateY(20px);
}

.tab-content.active {
    animation: tabFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes tabFadeIn {
    to {
        opacity  : 1;
        transform: translateY(0);
    }
}

/* Filter Animation */
.mythos-grid {
    position: relative;
    min-height: 400px;
}

.mythos-card,
.filter-item {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.mythos-card.hidden {
    opacity: 0;
    height: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: none;
}

.mythos-card.filter-out {
    opacity: 0;
}

.mythos-card.filter-in {
    animation: filterFadeIn 0.4s ease-out forwards;
}

@keyframes filterFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile Menu Stagger */
.main-nav-mobile.active .nav-links li {
    animation: navItemSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity  : 0;
    transform: translateX(30px);
}

.main-nav-mobile.active .nav-links li:nth-child(1) {
    animation-delay: 0.05s;
}

.main-nav-mobile.active .nav-links li:nth-child(2) {
    animation-delay: 0.1s;
}

.main-nav-mobile.active .nav-links li:nth-child(3) {
    animation-delay: 0.15s;
}

.main-nav-mobile.active .nav-links li:nth-child(4) {
    animation-delay: 0.2s;
}

.main-nav-mobile.active .nav-links li:nth-child(5) {
    animation-delay: 0.25s;
}

@keyframes navItemSlideIn {
    to {
        opacity  : 1;
        transform: translateX(0);
    }
}

/* Menu Open Backdrop */
body.menu-open::before {
    content        : '' !important;
    position       : fixed !important;
    top            : 0 !important;
    left           : 0 !important;
    right          : 0 !important;
    bottom         : 0 !important;
    background     : rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    z-index        : 9998 !important;
    animation      : backdropFadeIn 0.3s ease !important;
    display        : block !important;
    pointer-events : auto !important;
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Menu Backdrop (ID-based for JS control) */
#mobile-menu-backdrop {
    position       : fixed;
    top            : 0;
    left           : 0;
    right          : 0;
    bottom         : 0;
    background     : rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    z-index        : 9998;
    opacity        : 0;
    transition     : opacity 0.3s ease;
    pointer-events : auto;
}

#mobile-menu-backdrop.active {
    opacity: 1;
}

/* Emoji Wiggle on Hover */
.animal-card:hover .animal-icon,
.mythos-card:hover .mythos-icon,
.quick-link-card:hover .quick-link-icon,
.decision-panel:hover .panel-emoji {
    animation: emojiWiggle 0.5s ease;
}

@keyframes emojiWiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-15deg) scale(1.1);
    }

    75% {
        transform: rotate(15deg) scale(1.1);
    }
}

/* Hero Icon Pulse */
.primary-hero .hero-main-icon,
.hero-main-icon {
    animation: emojiPulse 3s ease-in-out infinite;
}

@keyframes emojiPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Form Feedback States */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea,
input[type="text"],
input[type="email"],
textarea {
    transition   : all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border       : 2px solid var(--pastel-mint);
    padding      : 12px 18px;
    border-radius: 15px;
    font-family  : 'Quicksand', sans-serif;
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
input:focus,
textarea:focus {
    outline     : none;
    border-color: var(--cute-mint);
    box-shadow  : 0 0 0 4px rgba(160, 231, 229, 0.2);
    transform   : translateY(-2px);
}

/* Form Loading State */
.wpcf7-form.submitting {
    position      : relative;
    pointer-events: none;
}

.wpcf7-form.submitting::before {
    content        : '';
    position       : absolute;
    top            : 0;
    left           : 0;
    right          : 0;
    bottom         : 0;
    background     : rgba(255, 251, 245, 0.9);
    backdrop-filter: blur(2px);
    z-index        : 10;
    border-radius  : 25px;
}

.wpcf7-form.submitting::after {
    content         : '';
    position        : absolute;
    top             : 50%;
    left            : 50%;
    transform       : translate(-50%, -50%);
    width           : 50px;
    height          : 50px;
    border          : 4px solid var(--pastel-mint);
    border-top-color: var(--cute-mint);
    border-radius   : 50%;
    animation       : formSpinner 0.8s linear infinite;
    z-index         : 11;
}

@keyframes formSpinner {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Form Success Message */
.wpcf7-mail-sent-ok {
    background   : var(--pastel-mint) !important;
    border       : 3px solid var(--cute-mint) !important;
    color        : var(--text-dark) !important;
    padding      : 20px 25px !important;
    border-radius: var(--radius-md) !important;
    animation    : successPop 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-family  : 'Quicksand', sans-serif !important;
    font-weight  : 600 !important;
}

@keyframes successPop {
    0% {
        opacity  : 0;
        transform: scale(0.8) translateY(-10px);
    }

    100% {
        opacity  : 1;
        transform: scale(1) translateY(0);
    }
}

/* Form Error Messages */
.wpcf7-validation-errors,
.wpcf7-mail-sent-ng {
    background   : var(--pastel-coral) !important;
    border       : 3px solid var(--cute-coral) !important;
    color        : var(--text-dark) !important;
    padding      : 20px 25px !important;
    border-radius: var(--radius-md) !important;
    animation    : errorShake 0.4s ease !important;
    font-family  : 'Quicksand', sans-serif !important;
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.wpcf7-not-valid {
    border-color: var(--cute-coral) !important;
    box-shadow  : 0 0 0 4px rgba(255, 181, 181, 0.3) !important;
}

/* Card Hover Optimization */
.card,
.animal-card,
.decision-card,
.comparison-panel,
.qualzucht-card,
.mythos-card,
.quick-link-card {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s ease;
    will-change: transform, box-shadow;
}

/* Scroll-Top Bounce */
.scroll-top {
    opacity   : 0;
    visibility: hidden;
    transform : translateY(20px) scale(0.8);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.4s,
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-top.visible {
    opacity   : 1;
    visibility: visible;
    transform : translateY(0) scale(1);
    animation : scrollTopBounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scrollTopBounce {
    0% {
        transform: translateY(20px) scale(0.8);
    }

    50% {
        transform: translateY(-5px) scale(1.1);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* Quiz Notification Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

