/**
 * SmartDect.ro - Animations & Transitions
 * Smooth micro-interactions and motion design
 * 
 * @version 2.0.0
 * @requires design-system.css
 */

/* ============================================
   FADE ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SCALE ANIMATIONS
   ============================================ */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

/* ============================================
   SLIDE ANIMATIONS
   ============================================ */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--primary-glow), 0 0 30px var(--primary-glow);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.4s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* ============================================
   HOVER EFFECTS (FIXED - NO OVERLAP)
   ============================================ */

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base), z-index 0s;
    position: relative;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.hover-scale {
    transition: transform var(--transition-base);
    position: relative;
}

.hover-scale:hover {
    transform: scale(1.01);
    z-index: 10;
}

.hover-scale-sm:hover {
    transform: scale(1.02);
}

.hover-glow {
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
    position: relative;
}

.hover-glow:hover {
    border-color: var(--primary-border);
    z-index: 10;
}

.hover-primary {
    transition: color var(--transition-base);
}

.hover-primary:hover {
    color: var(--primary);
}

.hover-bg-surface {
    transition: background-color var(--transition-base);
}

.hover-bg-surface:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================
   FOCUS STATES
   ============================================ */

.focus-ring:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light), 0 0 0 1px var(--primary);
}

.focus-ring-inset:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--primary);
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */

.page-enter {
    animation: fadeInUp 0.5s ease-out;
}

.page-leave {
    animation: fadeOut 0.3s ease-out;
}

/* Stagger animations for lists */
.stagger-item {
    animation: fadeInUp 0.4s ease-out backwards;
}

.stagger-item:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.3s;
}

/* ============================================
   GLASS MORPHISM TRANSITION
   ============================================ */

.glass-transition {
    transition:
        background var(--transition-base),
        backdrop-filter var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base);
}

.glass-transition:hover {
    background: var(--glass-bg);
    border-color: var(--primary-border);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   NOTIFICATION/TOAST ANIMATIONS
   ============================================ */

@keyframes slideInFromTop {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideOutToTop {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
}

.toast-enter {
    animation: slideInFromTop 0.3s ease-out;
}

.toast-exit {
    animation: slideOutToTop 0.3s ease-out;
}

/* ============================================
   MODAL/OVERLAY ANIMATIONS
   ============================================ */

@keyframes overlayShow {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.overlay-enter {
    animation: overlayShow 0.2s ease-out;
}

.modal-enter {
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   BUTTON CLICK EFFECT
   ============================================ */

.btn-click {
    position: relative;
    overflow: hidden;
}

.btn-click::after {
    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.6s, height 0.6s;
}

.btn-click:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   PROGRESS BAR ANIMATION
   ============================================ */

@keyframes progressFill {
    from {
        width: 0;
    }
}

.progress-bar {
    animation: progressFill 1s ease-out;
}

/* ============================================
   SKELETON LOADING (additional)
   ============================================ */

@keyframes skeletonWave {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.skeleton-wave {
    position: relative;
    overflow: hidden;
}

.skeleton-wave::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: skeletonWave 1.6s linear infinite;
}