/**
 * CockpitOS CM-Immo Theme - Animations (CM-Immo Style)
 * 
 * Verantwortlichkeit: Globale Animationen und Transitions
 * Cookie-Mood: Smooth, Playful, Modern
 * 
 * @package CockpitOS_CM_Immo_Theme
 * @version 1.2.0
 */

/* ========================================
   Easing Functions (CM-Immo Style)
   ======================================== */

:root {
    /* Cubic Bezier Easing (für smooth Animationen) */
    --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.175, 0.885, 0.32, 1.275);
    --ease-smooth-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-smooth-out: cubic-bezier(0, 0, 0.2, 1);
    
    /* Animation Durations */
    --duration-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
    --duration-slower: 0.8s;
}

/* ========================================
   Hover Scale Animation (CM-Immo Style)
   ======================================== */

.hover-scale {
    transition: transform var(--duration-normal) var(--ease-smooth);
}

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

.hover-scale-sm {
    transition: transform var(--duration-fast) var(--ease-smooth);
}

.hover-scale-sm:hover {
    transform: scale(1.02);
}

.hover-scale-lg {
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.hover-scale-lg:hover {
    transform: scale(1.1);
}

/* ========================================
   Hover Lift Animation (Cookie Cards)
   ======================================== */

.hover-lift {
    transition: transform var(--duration-normal) var(--ease-smooth),
                box-shadow var(--duration-normal) var(--ease-smooth);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(74, 21, 64, 0.2);
}

.hover-lift-sm {
    transition: transform var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth);
}

.hover-lift-sm:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(74, 21, 64, 0.15);
}

/* ========================================
   Slide In Animations (Dropdowns, Modals)
   ======================================== */

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

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

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

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

.animate-slide-in-down {
    animation: slideInDown var(--duration-normal) var(--ease-smooth);
}

.animate-slide-in-up {
    animation: slideInUp var(--duration-normal) var(--ease-smooth);
}

.animate-slide-in-left {
    animation: slideInLeft var(--duration-normal) var(--ease-smooth);
}

.animate-slide-in-right {
    animation: slideInRight var(--duration-normal) var(--ease-smooth);
}

/* ========================================
   Fade Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn var(--duration-normal) ease;
}

.animate-fade-in-scale {
    animation: fadeInScale var(--duration-normal) var(--ease-smooth);
}

/* ========================================
   Pulse Animation (Badges, Notifications)
   ======================================== */

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

.animate-pulse {
    animation: pulse 2s var(--ease-smooth) infinite;
}

/* ========================================
   Bounce Animation (Buttons, CTAs)
   ======================================== */

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce {
    animation: bounce 1s var(--ease-bounce) infinite;
}

/* ========================================
   Rotate Animation (Loading, Icons)
   ======================================== */

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

.animate-rotate {
    animation: rotate 2s linear infinite;
}

/* ========================================
   Shimmer Animation (Loading States)
   ======================================== */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.animate-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   Stagger Animations (Lists, Grids)
   ======================================== */

.stagger-children > * {
    opacity: 0;
    animation: fadeInUp var(--duration-normal) var(--ease-smooth) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

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

/* ========================================
   Hover Glow Effect (CM-Immo Style)
   ======================================== */

.hover-glow {
    transition: box-shadow var(--duration-normal) var(--ease-smooth);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(167, 216, 222, 0.6),
                0 0 40px rgba(167, 216, 222, 0.4);
}

/* ========================================
   Progress Bar Animation
   ======================================== */

@keyframes progressFill {
    from {
        width: 0;
    }
    to {
        width: var(--progress-width, 100%);
    }
}

.animate-progress {
    animation: progressFill 1s var(--ease-smooth) forwards;
}

/* ========================================
   Accessibility: Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hover-lift:hover,
    .hover-lift-sm:hover {
        transform: none;
    }
    
    .hover-scale:hover,
    .hover-scale-sm:hover,
    .hover-scale-lg:hover {
        transform: none;
    }
}
