/* 
 * Custom Animations for Mastermind Educare 
 */

/* 1. Floating Animation for Elements/Cards */
@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(0deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float 5s ease-in-out infinite 1s;
}

/* 2. Soft Pulsing/Glowing Animation for Buttons */
@keyframes softPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(193, 21, 21, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(193, 21, 21, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(193, 21, 21, 0);
    }
}

.btn-pulse {
    animation: softPulse 2.5s infinite;
}

/* 3. Subtle Wiggle/Shake on Hover for specific items */
@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

.hover-wiggle:hover {
    animation: wiggle 0.5s ease-in-out;
}

/* 4. Shining Effect for Buttons & Cards (Continuous or Hover) */
@keyframes shine {
    0% {
        left: -100%;
        top: -100%;
    }

    20% {
        left: 100%;
        top: 100%;
    }

    100% {
        left: 100%;
        top: 100%;
    }
}

.effect-shine {
    position: relative;
    overflow: hidden;
}

.effect-shine::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(45deg);
    top: -100%;
    left: -100%;
    animation: shine 4s infinite cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
    z-index: 10;
}

/* 5. Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* 6. Typing Effect Styles */
.typing-cursor {
    border-right: 3px solid var(--primary, #c11515);
    animation: blink 0.7s infinite;
    display: inline-block;
    height: 0.9em;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* 7. Enhanced Button & Card Animations */
@keyframes sway {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    33% {
        transform: translateY(-3px) rotate(-1deg);
    }

    66% {
        transform: translateY(-1px) rotate(1deg);
    }
}

@keyframes breathingZoom {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

/*
 * IMPORTANT: Combined Animation
 * We use !important to ensure it overrides any static transforms
 * once the reveal animation is complete.
 */
.animate-sway-zoom {
    animation: sway 2s ease-in-out infinite, breathingZoom 2s ease-in-out infinite !important;
    transform-origin: center center;
}

/* Click scaling effect */
.active-click-scale {
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.active-click-scale:active {
    transform: scale(0.92) !important;
}

/* Hero Premium Button Gradient Shade - Robust definition */
.hero-btn-gradient {
    background-color: #c11515 !important;
    background: linear-gradient(135deg, #e11d1d 0%, #a50f0f 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px -5px rgba(193, 21, 21, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3) !important;
    border: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.hero-btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

/* Updated Floating */
.btn-float {
    animation: float 5s ease-in-out infinite, sway 6s ease-in-out infinite;
}

/* 8. Text Gradient Effect for typed text if needed */
.text-typed {
    color: var(--primary, #c11515);
    font-weight: 900;
}
.text-gradient {
    background: linear-gradient(135deg, #e11d1d 0%, #a50f0f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* 9. Consultant Card Gradient Border */
.consultant-card {
    position: relative;
    border: none !important;
    background-clip: padding-box;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    background-color: white;
}

.dark .consultant-card {
    background-color: #1e2736;
}

.consultant-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2.5px; /* Border thickness */
    background: linear-gradient(to bottom, 
        rgba(193, 21, 21, 0.05) 0%, 
        rgba(193, 21, 21, 0.2) 40%, 
        rgba(193, 21, 21, 0.7) 80%, 
        rgba(193, 21, 21, 1) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    border-radius: 1rem;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Soft red shadow/glow at the bottom */
.consultant-card::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 15%;
    right: 15%;
    height: 15px;
    background: rgba(193, 21, 21, 0.4);
    filter: blur(20px);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.4;
    z-index: -1;
    transition: all 0.5s ease;
}

.consultant-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1), 0 10px 20px -10px rgba(193, 21, 21, 0.2);
}

.consultant-card:hover::after {
    opacity: 0.8;
    background: rgba(193, 21, 21, 0.6);
    filter: blur(25px);
}
