/**
 * SCORM Uploader Custom Styles
 * Additional animations and custom styles for SCORM uploader UI
 */

/* Upload Area Animations */
@keyframes dragOver {
    0% {
        transform: scale(1);
        border-color: #d1d5db;
    }
    50% {
        transform: scale(1.02);
        border-color: #6366f1;
    }
    100% {
        transform: scale(1);
        border-color: #6366f1;
    }
}

.drop-zone-dragover {
    animation: dragOver 0.3s ease-in-out;
    background-color: #eef2ff !important;
    border-color: #6366f1 !important;
}

/* Table Centering and Styling */
#filesTableBody tr:hover {
    background-color: #f9fafb;
    transition: background-color 0.2s ease;
}

#filesTableBody td {
    vertical-align: middle;
}

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.modal-backdrop {
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    animation: modalSlideUp 0.3s ease-out;
}

/* Status Badge Transitions */
@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.status-parsing {
    animation: statusPulse 2s ease-in-out infinite;
}

/* Floating Gamification Widget Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.gamification-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

.gamification-badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

/* Quiz Popup Animations */
@keyframes quizSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.quiz-modal-enter {
    animation: quizSlideIn 0.3s ease-out;
}

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

.quiz-option-selected {
    animation: optionSelect 0.2s ease-out;
}

/* Points Awarded Animation */
@keyframes pointsPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.points-earned-animation {
    animation: pointsPop 0.5s ease-out;
}

@keyframes pointsFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(1.5);
        opacity: 0;
    }
}

.points-float-up {
    animation: pointsFloat 1s ease-out forwards;
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
}

.progress-bar-animate {
    animation: progressFill 1s ease-out;
}

@keyframes progressShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.parsing-progress-shimmer {
    background: linear-gradient(
        90deg,
        #6366f1 0%,
        #8b5cf6 50%,
        #ec4899 100%
    );
    background-size: 200% 100%;
    animation: progressShimmer 2s linear infinite;
}

/* Success Checkmark Animation */
@keyframes checkmarkDraw {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark-animate {
    stroke-dasharray: 100;
    animation: checkmarkDraw 0.5s ease-out forwards;
}

/* Notification Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.notification-enter {
    animation: slideInRight 0.3s ease-out;
}

.notification-exit {
    animation: slideOutRight 0.3s ease-out;
}

/* Loading Spinner Variations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

.spinner-slow {
    animation: spin 2s linear infinite;
}

/* Gradient Background Animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Focus Ring Animation */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    100% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

.focus-ring-animate:focus {
    animation: focusRing 0.5s ease-out;
}

/* Smooth Transitions */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .gamification-badge {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
    }
}

/* Button Hover Effects */
.btn-hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn-hover-lift:active {
    transform: translateY(0);
}

/* File Upload Drop Zone */
#dropZone {
    transition: all 0.3s ease;
}

#dropZone:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Status Badge Improvements */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

/* Table Row Animations */
@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#filesTableBody tr {
    animation: rowFadeIn 0.3s ease-out;
}

/* Loading Spinner Enhancements */
@keyframes spinWithPulse {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.spinner-enhanced {
    animation: spinWithPulse 2s ease-in-out infinite;
}

/* Print Styles */
@media print {
    .gamification-badge,
    .quiz-modal,
    .user-info-modal,
    #uploadModal,
    #parsingModal {
        display: none !important;
    }
}

/* Responsive Table Improvements */
@media (max-width: 768px) {
    #filesTableBody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        padding: 1rem;
    }
    
    #filesTableBody td {
        display: block;
        text-align: right;
        padding: 0.5rem 0;
        border: none;
    }
    
    #filesTableBody td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: #6b7280;
    }
}

