/*
*  Twake App Animations CSS
*  Based on Linagora's animation system
*  ===========================
*/


/* Base animation classes */
.animate {
    opacity: 0;
    transition: opacity 1s ease-out, transform 0.5s cubic-bezier(0.53, 0.79, 0.41, 0.93), all 0.35s;
}

.animate.visible {
    opacity: 1;
}

/* Slide animations */
.slide-up {
    transform: translateY(30px);
}

.slide-up.visible,
.slide-up-visible {
    transform: translateY(0);
}

.slide-left {
    transform: translateX(-50px);
}

.slide-left.visible,
.slide-left-visible {
    transform: translateX(0);
}

.slide-right {
    transform: translateX(50px);
}

.slide-right.visible,
.slide-right-visible {
    transform: translateX(0);
}

/* Scale animations */
.scale-in {
    transform: scale(0.8);
}

.scale-in.visible,
.scale-in-visible {
    transform: scale(1);
}

/* Rotate animations */
.rotate-in {
    transform: rotate(-10deg) scale(0.9);
}

.rotate-in.visible,
.rotate-in-visible {
    transform: rotate(0deg) scale(1);
}

/* Fade animations */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
}

/* Stagger animations for children */
.stagger-children .animate-child {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stagger-children .animate-child.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Counter animations */
.counter-animate .counter {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.counter-animate.visible .counter {
    opacity: 1;
    transform: scale(1);
}

/* Progress bar animations */
.progress-animate .progress-bar {
    width: 0%;
    transition: width 1.5s ease-out;
}

/* Typing animations */
.typing-animate {
    visibility: hidden;
}

.typing-animate.typing-started {
    visibility: visible;
}

/* Parallax elements */
.parallax {
    will-change: transform;
}

/* Header scroll animations */
#main-header {
    transition: top 0.35s ease;
}

#main-header.slide-up {
    top: -100%;
}

#main-header.slide-down {
    top: 0;
}

/* Animation delays */
.delay-0 { transition-delay: 0s; }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }
.delay-7 { transition-delay: 0.7s; }
.delay-8 { transition-delay: 0.8s; }
.delay-9 { transition-delay: 0.9s; }

/* Mobile menu animations */
.menu-group-mobile {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.menu-group-mobile.active {
    transform: translateX(0);
}

#mobile-menu-toggle {
    transition: all 0.3s ease;
}

#mobile-menu-toggle.active {
    transform: rotate(90deg);
}

/* Smooth scroll animations */
html {
    scroll-behavior: smooth;
}

/* Hover effects */
.animate-hover {
    transition: all 0.3s ease;
}

.animate-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button animations */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-animate:hover::before {
    left: 100%;
}

/* Card animations */
.card-animate {
    transition: all 0.3s ease;
}

.card-animate:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Image animations */
.img-animate {
    transition: all 0.3s ease;
}

.img-animate:hover {
    transform: scale(1.05);
}

/* Text animations */
.text-animate {
    overflow: hidden;
}

.text-animate .text-line {
    transform: translateY(100%);
    transition: transform 0.6s ease;
}

.text-animate.visible .text-line {
    transform: translateY(0);
}

/* Loading animations */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Bounce animation */
.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Shake animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Flip animations */
.flip-horizontal {
    transform: scaleX(-1);
}

.flip-vertical {
    transform: scaleY(-1);
}

/* Zoom animations */
.zoom-in {
    transform: scale(0);
    transition: transform 0.5s ease;
}

.zoom-in.visible {
    transform: scale(1);
}

.zoom-out {
    transform: scale(1.5);
    transition: transform 0.5s ease;
}

.zoom-out.visible {
    transform: scale(1);
}

/* Slide from corners */
.slide-from-top {
    transform: translateY(-100%);
}

.slide-from-top.visible {
    transform: translateY(0);
}

.slide-from-bottom {
    transform: translateY(100%);
}

.slide-from-bottom.visible {
    transform: translateY(0);
}

.slide-from-left {
    transform: translateX(-100%);
}

.slide-from-left.visible {
    transform: translateX(0);
}

.slide-from-right {
    transform: translateX(100%);
}

.slide-from-right.visible {
    transform: translateX(0);
}

/* Mobile animations - Disable all animations on mobile */
@media (max-width: 768px) {
    /* Disable all animations and transitions */
    .animate,
    .animate-child,
    .fade-in,
    .slide-up,
    .slide-left,
    .slide-right,
    .scale-in,
    .rotate-in,
    .stagger-children .animate-child,
    .counter-animate .counter,
    .progress-animate .progress-bar,
    .typing-animate,
    .parallax,
    .animate-hover,
    .btn-animate,
    .card-animate,
    .img-animate,
    .text-animate .text-line,
    .loading-spinner,
    .pulse,
    .bounce,
    .shake,
    .zoom-in,
    .zoom-out,
    .slide-from-top,
    .slide-from-bottom,
    .slide-from-left,
    .slide-from-right {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
        visibility: visible !important;
    }
    
    /* Force visible state for all animated elements */
    .animate.visible,
    .animate-child.visible,
    .fade-in.visible,
    .slide-up.visible,
    .slide-left.visible,
    .slide-right.visible,
    .scale-in.visible,
    .rotate-in.visible,
    .slide-up-visible,
    .slide-left-visible,
    .slide-right-visible,
    .scale-in-visible,
    .rotate-in-visible {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Disable hover effects on mobile */
    .animate-hover:hover,
    .btn-animate:hover,
    .card-animate:hover,
    .img-animate:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* Disable button shine effect */
    .btn-animate::before {
        display: none !important;
    }
    
    /* Disable smooth scroll on mobile */
    html {
        scroll-behavior: auto !important;
    }
    
    /* Disable header scroll animations */
    #main-header {
        transition: none !important;
        top: 0 !important;
    }
    
    #main-header.slide-up,
    #main-header.slide-down {
        top: 0 !important;
    }
    
    /* Disable mobile menu animations */
    .menu-group-mobile {
        transform: none !important;
        transition: none !important;
    }
    
    .menu-group-mobile.active {
        transform: none !important;
    }
    
    #mobile-menu-toggle {
        transition: none !important;
    }
    
    #mobile-menu-toggle.active {
        transform: none !important;
    }
    
    /* Disable progress bar animations */
    .progress-animate .progress-bar {
        width: 100% !important;
        transition: none !important;
    }
    
    /* Disable typing animations */
    .typing-animate {
        visibility: visible !important;
    }
    
    .typing-animate.typing-started {
        visibility: visible !important;
    }
    
    /* Disable parallax */
    .parallax {
        will-change: auto !important;
        transform: none !important;
    }
    
    /* Disable counter animations */
    .counter-animate.visible .counter {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Disable stagger animations */
    .stagger-children .animate-child {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .stagger-children .animate-child.visible {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Responsive animations for tablets (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .animate {
        transition-duration: 0.8s;
    }
    
    .slide-up,
    .slide-left,
    .slide-right {
        transform: translateY(20px);
    }
    
    .scale-in {
        transform: scale(0.9);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animate,
    .animate-child,
    .fade-in,
    .slide-up,
    .slide-left,
    .slide-right,
    .scale-in,
    .rotate-in {
        transition: none;
        animation: none;
    }
    
    .animate.visible,
    .animate-child.visible,
    .fade-in.visible,
    .slide-up.visible,
    .slide-left.visible,
    .slide-right.visible,
    .scale-in.visible,
    .rotate-in.visible {
        opacity: 1;
        transform: none;
    }
}

/* Print styles */
@media print {
    .animate,
    .animate-child,
    .fade-in,
    .slide-up,
    .slide-left,
    .slide-right,
    .scale-in,
    .rotate-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
}


/* Extra animations */

/* Zoom In */
@keyframes zoomIn {
    from {
      transform: scale(0.5);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }
  
/* Zoom Out */
@keyframes zoomOut {
    from {
      transform: scale(1);
      opacity: 1;
    }
    to {
      transform: scale(0.5);
      opacity: 0;
    }
}
  
/* Fade In */
@keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
}
  
/* Fade Out */
@keyframes fadeOut {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
  }
  
/* Slide In */
@keyframes slideIn {
    from {
      transform: translateX(-100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
}
  
/* Slide Out */
@keyframes slideOut {
    from {
      transform: translateX(0);
      opacity: 1;
    }
    to {
      transform: translateX(100%);
      opacity: 0;
    }
}

/* Slide Up */
@keyframes slideUp {
  from {
    transform: translateY(30%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(30%);
    }
}