/* GlobeIQ LMS Page Animations */

/* Fade in animation for pages */
.page-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Button hover animations */
.btn-hover-scale {
    transition: transform 0.2s ease-in-out;
}

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

/* Progress bar animations */
.progress-bar-animated {
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Achievement popup animation */
.achievement-popup {
    animation: slideInFromRight 0.5s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide out animation for achievement popup */
.achievement-popup-exit {
    animation: slideOutToRight 0.3s ease-in;
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Drag and drop visual feedback */
.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    border-style: dashed;
}

/* Block selection animation */
.block-selected {
    animation: blockGlow 0.3s ease-in-out;
}

@keyframes blockGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Sidebar tab transition */
.tab-transition {
    transition: all 0.2s ease-in-out;
}

/* Modal backdrop animation */
.modal-backdrop {
    animation: backdropFadeIn 0.2s ease-out;
}

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

/* Modal content animation */
.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

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

/* Loading spinner for assets */
.asset-loading {
    animation: spin 1s linear infinite;
}

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

/* Smooth height transitions for collapsible content */
.collapsible {
    transition: max-height 0.3s ease-in-out;
    overflow: hidden;
}

/* Success/Error message animations */
.message-fade-in {
    animation: messageFadeIn 0.3s ease-out;
}

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

/* Lesson builder specific animations */
.lesson-canvas-transition {
    transition: all 0.3s ease-in-out;
}

.dropin-drag-preview {
    animation: dragFloat 0.5s ease-in-out infinite alternate;
}

@keyframes dragFloat {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-2px);
    }
}

/* Dark mode safe animations */
@media (prefers-color-scheme: dark) {
    .card-hover:hover {
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    }
}

/* Toast notification animations */
.animate-fade-in-out {
    animation: fadeInOut 4s ease-in-out;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    15%, 85% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Lazy loading states */
.lazy-loading {
    background-color: #f3f4f6;
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: shimmer 2s infinite linear;
}

.dark .lazy-loading {
    background-color: #374151;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.lazy-loaded {
    animation: fadeIn 0.3s ease-in-out;
}

/* Touch feedback animations */
.touch-manipulation {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Mobile-specific animations */
@media (max-width: 768px) {
    .mobile-fade-in {
        animation: mobileSlideUp 0.3s ease-out;
    }
    
    @keyframes mobileSlideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}