/* ============================================
   SUBTLE ANIMATIONS - Mannsay Mental Health
   Modern, calming micro-interactions
   ============================================ */

/* ============================================
   BASE ANIMATION UTILITIES
   ============================================ */

:root {
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    --duration-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
}

/* ============================================
   NAVBAR ANIMATIONS
   ============================================ */

/* Smooth navbar appearance on scroll */
.navbar {
    transition: all 0.4s var(--ease-smooth);
}

/* Nav link hover animation */
.navbar-nav .nav-link {
    position: relative;
    transition: all 0.3s var(--ease-smooth);
}

/* Nav link underline handled by modern-enhancements.css */

/* Logo subtle pulse on hover */
.navbar-brand:hover .img-1 {
    animation: logoPulse 0.6s var(--ease-smooth);
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

/* Primary button ripple effect */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-smooth);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s var(--ease-smooth), height 0.6s var(--ease-smooth);
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

/* Button lift effect */
.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Arrow icon slide on hover */
.btn i,
.tile-link i,
.hero-btn-primary i {
    transition: transform 0.3s var(--ease-smooth);
}

.btn:hover i,
.tile-link:hover i,
.hero-btn-primary:hover i {
    transform: translateX(5px);
}

/* ============================================
   CARD & SECTION ANIMATIONS
   ============================================ */

/* Service tiles stagger animation */
.service-tile {
    transition: all 0.4s var(--ease-smooth);
}

.service-tile:hover {
    transform: translateY(-12px);
}

/* Icon rotation on hover */
.tile-icon,
.feature-icon {
    transition: all 0.4s var(--ease-smooth);
}

.service-tile:hover .tile-icon,
.feature-item:hover .feature-icon .p-3 {
    transform: scale(1.1) rotate(5deg);
}

/* Feature item hover animation */
.feature-item {
    transition: all 0.4s var(--ease-smooth);
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(20, 184, 166, 0.15);
}

/* Team card hover effects */
.team-item {
    transition: all 0.4s var(--ease-smooth);
}

.team-item:hover {
    transform: translateY(-10px);
}

.team-item .team-img img {
    transition: transform 0.5s var(--ease-smooth);
}

.team-item:hover .team-img img {
    transform: scale(1.05);
}

/* Team social icons slide up */
.team-icon {
    transition: all 0.4s var(--ease-smooth);
}

.team-item:hover .team-icon a {
    animation: bounceIn 0.5s var(--ease-bounce) forwards;
}

.team-item:hover .team-icon a:nth-child(1) {
    animation-delay: 0s;
}

.team-item:hover .team-icon a:nth-child(2) {
    animation-delay: 0.1s;
}

.team-item:hover .team-icon a:nth-child(3) {
    animation-delay: 0.2s;
}

.team-item:hover .team-icon a:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   HERO SECTION ANIMATIONS
   ============================================ */

/* Floating animation for trust items */
.trust-item {
    transition: all 0.3s var(--ease-smooth);
}

.trust-item:hover {
    transform: translateY(-3px);
}

.trust-item:hover i {
    animation: iconBounce 0.5s var(--ease-bounce);
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Social float buttons animation */
.hero-social-float a {
    transition: all 0.3s var(--ease-smooth);
}

.hero-social-float a:hover {
    transform: translateY(-5px) scale(1.1);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

/* Staggered fade in for grid items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   TOPBAR ANIMATIONS
   ============================================ */

/* Topbar link hover */
.container-fluid.bg-dark a {
    transition: all 0.3s var(--ease-smooth);
}

.container-fluid.bg-dark a:hover {
    transform: translateX(3px);
}

/* Social buttons in topbar */
.container-fluid.bg-dark .btn-square {
    transition: all 0.3s var(--ease-smooth);
}

.container-fluid.bg-dark .btn-square:hover {
    transform: translateY(-3px) rotate(5deg);
}

/* ============================================
   FORM ANIMATIONS
   ============================================ */

/* Form input focus animation */
.form-control,
.form-select {
    transition: all 0.3s var(--ease-smooth);
}

.form-control:focus,
.form-select:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(20, 184, 166, 0.15);
}

/* ============================================
   MENTAL TEST SECTION ANIMATIONS
   ============================================ */

/* Option card selection animation */
.mental-test .option-card {
    transition: all 0.3s var(--ease-smooth);
}

.mental-test .option-card:hover {
    transform: translateX(8px);
    border-left: 4px solid #14B8A6;
}

.mental-test .option-card.selected {
    animation: selectPop 0.3s var(--ease-bounce);
}

@keyframes selectPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* Progress bar smooth animation */
.mental-test .progress-fill {
    transition: width 0.5s var(--ease-smooth);
}

/* ============================================
   APPOINTMENT SECTION ANIMATIONS
   ============================================ */

/* Form container subtle breathing */
.appointment-form {
    transition: all 0.4s var(--ease-smooth);
}

.appointment-form:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Video play button pulse */
.video .btn-play::before {
    animation: playPulse 2s infinite var(--ease-smooth);
}

@keyframes playPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.7;
    }
}

/* ============================================
   FOOTER ANIMATIONS
   ============================================ */

/* Footer link underline animation */
.footer a {
    position: relative;
    transition: all 0.3s var(--ease-smooth);
}

.footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #14B8A6;
    transition: width 0.3s var(--ease-smooth);
}

.footer a:hover::after {
    width: 100%;
}

/* Back to top button animation */
.back-to-top {
    transition: all 0.4s var(--ease-smooth);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(20, 184, 166, 0.4);
}

/* ============================================
   SUBTLE LOADING SHIMMER
   ============================================ */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================
   ICON ANIMATIONS
   ============================================ */

/* Check icons pulse */
.fa-check {
    transition: all 0.3s var(--ease-smooth);
}

.mb-4:hover .fa-check,
p:hover .fa-check {
    animation: checkPulse 0.4s var(--ease-bounce);
}

@keyframes checkPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* ============================================
   SECTION TITLE ANIMATIONS
   ============================================ */

/* Subtle glow for section titles */
.section-title h1 {
    transition: all 0.4s var(--ease-smooth);
}

.section-title h1:hover {
    text-shadow: 0 0 30px rgba(20, 184, 166, 0.2);
}

/* Sub-title line animation */
.sub-style .sub-title {
    transition: all 0.4s var(--ease-smooth);
}

.sub-style:hover .sub-title {
    letter-spacing: 1px;
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */

/* Elements that animate on scroll (using Intersection Observer) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s var(--ease-smooth);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SMOOTH UNDERLINE FOR LINKS
   ============================================ */

a.smooth-underline {
    position: relative;
    text-decoration: none;
}

a.smooth-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s var(--ease-smooth);
}

a.smooth-underline:hover::after {
    width: 100%;
}

/* ============================================
   SUBTLE BREATHING ANIMATION
   ============================================ */

@keyframes subtleBreath {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

.breathing-element {
    animation: subtleBreath 4s var(--ease-smooth) infinite;
}

/* ============================================
   FLOATING BADGE ANIMATION
   ============================================ */

.holistic-badge {
    animation: floatBadge 3s var(--ease-smooth) infinite;
}

@keyframes floatBadge {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ============================================
   SPINNER ENHANCEMENT
   ============================================ */

#spinner .spinner-border {
    animation: spin 1s linear infinite, pulse 2s var(--ease-smooth) infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}