/* Animated secondary button with arrow on hover */
.animated-secondary-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    transition: box-shadow 0.3s, background 0.3s;
}
.animated-secondary-btn .secondary-btn-text {
    position: relative;
    z-index: 1;
    transition: margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 0;
}
.animated-secondary-btn .secondary-arrow-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 47px;
    height: 47px;
    margin-left: -8px;
    position: absolute;
    right: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
    }
    .animated-secondary-btn:hover .secondary-arrow-wrapper,
    .animated-secondary-btn:focus .secondary-arrow-wrapper {
        opacity: 1;
        margin-left: 0;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }
.animated-secondary-btn .secondary-arrow {
    transform: translateY(0) translateX(-16px) scale(1) rotate(0deg);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    top: 14px;
    left: 18px;
}
.animated-secondary-btn:hover .secondary-btn-text,
.animated-secondary-btn:focus .secondary-btn-text {
    margin-right: 10px;
}
.animated-secondary-btn:hover .secondary-arrow-wrapper,
.animated-secondary-btn:focus .secondary-arrow-wrapper {
    opacity: 1;
    margin-left: 0;
}
.animated-secondary-btn:hover .secondary-arrow,
.animated-secondary-btn:focus .secondary-arrow {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotate(0deg);
    filter: drop-shadow(0 2px 8px #a78bfa88);
}
/* Animated background fill for secondary button */
.animated-fill-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s;
}
.animated-fill-btn::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ede9fe 0%, #c7d2fe 100%);
    z-index: 0;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.animated-fill-btn:hover::before,
.animated-fill-btn:focus::before {
    width: 100%;
}
.animated-fill-btn span {
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}
.animated-fill-btn:hover span,
.animated-fill-btn:focus span {
    color: #4f46e5;
}
/* Animated underline for secondary button */
.animated-underline-btn {
    position: relative;
    overflow: hidden;
}
.animated-underline-btn .underline-effect {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%);
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 2;
}
.animated-underline-btn:hover .underline-effect,
.animated-underline-btn:focus .underline-effect {
    transform: translateX(-50%) scaleX(1);
}
.animated-btn {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.2s;
    box-shadow: 0 2px 12px rgba(120, 60, 255, 0.08);
}
.animated-btn:hover, .animated-btn:focus {
    /* Keep original color, only add effects */
    box-shadow: 0 6px 24px rgba(120, 60, 255, 0.18);
    /* transform: translateY(-2px) scale(1); */
}
.animated-btn .btn-icon-wrapper {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    transition: margin-left 0.3s;
}
.animated-btn:hover .btn-icon-wrapper {
    margin-left: 15px;
}
.btn-primary:hover .btn-icon-wrapper {
    background-color: #ffffff !important;
}
.header-scrolled .btn-primary .btn-icon-wrapper {
    background-color: #ffffff !important;
}
.header-scrolled .btn-primary .btn-icon-wrapper img {
    filter: brightness(0.5);
}
.btn-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 24px;
    overflow: hidden;
}
.animated-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, filter 0.3s;
}
.arrow-main {
    opacity: 1;
    z-index: 2;
    /* Centered by default, no extra transform */
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}
.arrow-hover {
    opacity: 0;
    z-index: 1;
    transform: translate(calc(-50% - 32px), -50%) scale(1) rotate(0deg);
}
.animated-btn:hover .arrow-main {
    opacity: 0;
    transform: translate(calc(-50% + 32px), -50%) scale(1.15) rotate(0deg);
    pointer-events: none;
}
.animated-btn:hover .arrow-hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15) rotate(0deg);
    filter: drop-shadow(0 2px 8px #a78bfa88);
}
