/**
 * Divi Motion Pro - Frontend CSS
 * Animation styles and base classes
 * 
 * @author Abhinandan Deshmukh - CGxperts
 * @website https://cgxperts.com
 * @version 1.0.0
 */

/* Base Animation Classes */
.dmp-gradient-animation,
.dmp-scroll-animation,
.dmp-text-animation,
.dmp-mouse-effects,
.dmp-hover-effects,
.dmp-page-load-animation {
    position: relative;
    overflow: hidden;
}

/* Gradient Animation Styles */
.dmp-gradient-animation {
    background-size: 200% 200%;
    transition: all 0.3s ease;
}

.dmp-gradient-animation.dmp-animated {
    animation-fill-mode: both;
}

.dmp-gradient-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Scroll Animation Base */
.dmp-scroll-animation {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.dmp-scroll-animation.dmp-animated {
    opacity: 1;
    transform: translateY(0);
}

.dmp-scroll-title {
    margin-bottom: 1rem;
    font-weight: 600;
}

.dmp-scroll-content {
    line-height: 1.6;
}

/* Text Animation Styles */
.dmp-text-animation {
    position: relative;
}

.dmp-text-content {
    line-height: 1.4;
}

.dmp-split-char,
.dmp-split-word,
.dmp-split-line {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease;
}

.dmp-split-char.dmp-animated,
.dmp-split-word.dmp-animated,
.dmp-split-line.dmp-animated {
    opacity: 1;
    transform: translateY(0);
}

/* Typewriter Effect */
.dmp-typewriter-cursor {
    display: inline-block;
    background: currentColor;
    width: 2px;
    margin-left: 2px;
    animation: dmp-blink 1s infinite;
}

@keyframes dmp-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Mouse Effects */
.dmp-mouse-effects {
    cursor: none;
}

.dmp-custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s ease;
}

.dmp-cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
}

/* Magnetic Hover Effect */
.dmp-magnetic {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dmp-magnetic:hover {
    transform: scale(1.05);
}

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

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

.dmp-hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.dmp-hover-tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.dmp-hover-tilt:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
}

/* Page Load Animations */
.dmp-page-load-animation {
    opacity: 0;
    animation-fill-mode: forwards;
}

.dmp-page-load-animation.dmp-animate-fadeIn {
    animation: dmpFadeIn 1s ease forwards;
}

.dmp-page-load-animation.dmp-animate-slideUp {
    animation: dmpSlideUp 1s ease forwards;
}

.dmp-page-load-animation.dmp-animate-zoomIn {
    animation: dmpZoomIn 1s ease forwards;
}

/* Animation Keyframes */
@keyframes dmpFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes dmpSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dmpSlideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dmpSlideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes dmpSlideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes dmpZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes dmpZoomOut {
    from {
        opacity: 0;
        transform: scale(1.2);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes dmpRotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

@keyframes dmpBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes dmpFlipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        opacity: 1;
        transform: perspective(400px) rotateX(10deg);
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

@keyframes dmpFlipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        opacity: 1;
        transform: perspective(400px) rotateY(10deg);
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* Gradient Animation Variations */
.dmp-gradient-shift {
    background: linear-gradient(-45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    background-size: 400% 400%;
    animation: dmpGradientShift 4s ease infinite;
}

@keyframes dmpGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.dmp-gradient-wave {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    background-size: 200% 200%;
    animation: dmpGradientWave 3s ease-in-out infinite;
}

@keyframes dmpGradientWave {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.dmp-gradient-pulse {
    animation: dmpGradientPulse 2s ease-in-out infinite;
}

@keyframes dmpGradientPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

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

.dmp-parallax-slow {
    transform: translateY(0);
}

.dmp-parallax-fast {
    transform: translateY(0);
}

/* Scroll Trigger Animations */
.dmp-scroll-fadeIn {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dmp-scroll-fadeIn.dmp-in-view {
    opacity: 1;
    transform: translateY(0);
}

.dmp-scroll-slideUp {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dmp-scroll-slideUp.dmp-in-view {
    opacity: 1;
    transform: translateY(0);
}

.dmp-scroll-zoomIn {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dmp-scroll-zoomIn.dmp-in-view {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Animation Support */
.dmp-stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.dmp-stagger-item.dmp-animate {
    opacity: 1;
    transform: translateY(0);
}

.dmp-stagger-item:nth-child(1) { transition-delay: 0.1s; }
.dmp-stagger-item:nth-child(2) { transition-delay: 0.2s; }
.dmp-stagger-item:nth-child(3) { transition-delay: 0.3s; }
.dmp-stagger-item:nth-child(4) { transition-delay: 0.4s; }
.dmp-stagger-item:nth-child(5) { transition-delay: 0.5s; }
.dmp-stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* Text Reveal Effects */
.dmp-text-reveal {
    position: relative;
    overflow: hidden;
}

.dmp-text-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: currentColor;
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.18, 1);
}

.dmp-text-reveal.dmp-animate::before {
    transform: translateX(100%);
}

/* Micro Interactions */
.dmp-button-ripple {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dmp-button-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.dmp-button-ripple:hover::before {
    width: 300%;
    height: 300%;
}

.dmp-glow-effect {
    transition: all 0.3s ease;
    position: relative;
}

.dmp-glow-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    filter: blur(10px);
    transition: opacity 0.3s ease;
}

.dmp-glow-effect:hover::before {
    opacity: 1;
}

/* Loading Animations */
.dmp-loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: dmpSpin 1s ease-in-out infinite;
}

@keyframes dmpSpin {
    to { transform: rotate(360deg); }
}

.dmp-pulse-loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 50%;
    animation: dmpPulse 1.5s ease-in-out infinite;
}

@keyframes dmpPulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dmp-gradient-content {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .dmp-scroll-animation,
    .dmp-text-animation {
        padding: 1rem;
    }
    
    .dmp-custom-cursor {
        display: none;
    }
    
    .dmp-hover-effects:hover {
        transform: none;
    }
    
    .dmp-parallax {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .dmp-split-char,
    .dmp-split-word {
        font-size: 0.9em;
    }
    
    .dmp-gradient-animation {
        min-height: 200px;
    }
    
    .dmp-text-content {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .dmp-gradient-animation,
    .dmp-scroll-animation,
    .dmp-text-animation,
    .dmp-hover-effects,
    .dmp-parallax {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    
    .dmp-typewriter-cursor {
        animation: none;
        opacity: 1;
    }
    
    .dmp-split-char,
    .dmp-split-word,
    .dmp-split-line {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .dmp-gradient-animation {
        background: #000 !important;
        color: #fff !important;
    }
    
    .dmp-custom-cursor {
        background: #fff !important;
        mix-blend-mode: normal !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .dmp-text-animation {
        color: #fff;
    }
    
    .dmp-custom-cursor {
        background: #fff;
    }
    
    .dmp-hover-glow:hover {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

/* Print Styles */
@media print {
    .dmp-gradient-animation,
    .dmp-scroll-animation,
    .dmp-text-animation,
    .dmp-hover-effects {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
    
    .dmp-custom-cursor,
    .dmp-cursor-trail {
        display: none !important;
    }
}

/* Performance Optimizations */
.dmp-will-change {
    will-change: transform, opacity;
}

.dmp-gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Utility Classes */
.dmp-hidden {
    opacity: 0;
    visibility: hidden;
}

.dmp-visible {
    opacity: 1;
    visibility: visible;
}

.dmp-no-scroll {
    overflow: hidden;
}

.dmp-smooth-scroll {
    scroll-behavior: smooth;
}

/* Liquid Motion Styles */
.dmp-liquid-motion {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.dmp-liquid-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.dmp-liquid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.dmp-liquid-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dmp-liquid-title {
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dmp-liquid-text {
    line-height: 1.6;
    opacity: 0.9;
}

/* Liquid Effect Variations */
.dmp-liquid-motion[data-effect-type="blob"] {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: dmpLiquidMorph 8s ease-in-out infinite;
}

.dmp-liquid-motion[data-effect-type="wave"] {
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 70%);
}

.dmp-liquid-motion[data-effect-type="bubble"] {
    background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.dmp-liquid-motion[data-effect-type="flow"] {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
}

.dmp-liquid-motion[data-glow="on"] {
    box-shadow: 
        0 0 30px rgba(78, 205, 196, 0.3),
        0 0 60px rgba(255, 107, 107, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.dmp-liquid-motion[data-use-3d="on"] {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.dmp-liquid-motion[data-use-3d="on"] .dmp-liquid-content {
    transform: translateZ(50px);
}

/* Performance optimizations */
.dmp-liquid-motion[data-performance="performance"] .dmp-liquid-canvas {
    image-rendering: pixelated;
    transform: scale(0.8);
    transform-origin: center;
}

.dmp-liquid-motion[data-performance="high"] .dmp-liquid-canvas {
    image-rendering: crisp-edges;
}

/* Animation keyframes for liquid morphing */
@keyframes dmpLiquidMorph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* Hover effects for liquid motion */
.dmp-liquid-motion[data-trigger="hover"]:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

.dmp-liquid-motion[data-trigger="hover"]:hover .dmp-liquid-content {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

/* Click effects */
.dmp-liquid-motion[data-trigger="click"]:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Mouse proximity effects */
.dmp-liquid-motion[data-trigger="mouse_proximity"] {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dmp-liquid-motion[data-trigger="mouse_proximity"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Blur effects */
.dmp-liquid-motion[data-blur="1"] .dmp-liquid-canvas { filter: blur(1px); }
.dmp-liquid-motion[data-blur="2"] .dmp-liquid-canvas { filter: blur(2px); }
.dmp-liquid-motion[data-blur="3"] .dmp-liquid-canvas { filter: blur(3px); }
.dmp-liquid-motion[data-blur="4"] .dmp-liquid-canvas { filter: blur(4px); }
.dmp-liquid-motion[data-blur="5"] .dmp-liquid-canvas { filter: blur(5px); }

/* Mobile optimizations */
@media (max-width: 768px) {
    .dmp-liquid-motion {
        border-radius: 8px;
    }
    
    .dmp-liquid-content {
        padding: 1.5rem;
    }
    
    .dmp-liquid-title {
        font-size: 1.5rem;
    }
    
    .dmp-liquid-text {
        font-size: 0.9rem;
    }
    
    /* Reduce performance on mobile */
    .dmp-liquid-motion .dmp-liquid-canvas {
        image-rendering: pixelated;
        transform: scale(0.7);
    }
}

@media (max-width: 480px) {
    .dmp-liquid-content {
        padding: 1rem;
    }
    
    .dmp-liquid-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .dmp-liquid-text {
        font-size: 0.85rem;
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .dmp-liquid-motion {
        animation: none !important;
    }
    
    .dmp-liquid-motion .dmp-liquid-canvas {
        display: none;
    }
    
    .dmp-liquid-motion {
        background: linear-gradient(135deg, #4ecdc4, #ff6b6b) !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dmp-liquid-motion {
        border: 2px solid currentColor;
    }
    
    .dmp-liquid-content {
        background: rgba(0, 0, 0, 0.8);
        border-radius: 8px;
    }
}