/* PRO FACTORY - User Experience Micro-Interactions */

/* Global Smooth Transitions */
* {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

/* Ripple Effect for Buttons */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Card Hover Animations */
.card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

/* Navigation Link Animations */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: #007bff !important;
    transform: translateY(-1px);
}

/* Progress Bar Animations */
.progress-bar {
    transition: width 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 50px 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Form Input Focus Effects */
.form-control {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
    transform: scale(1.02);
}

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

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

/* Video Player Hover Effects */
video {
    transition: all 0.3s ease;
    cursor: pointer;
}

video:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
}

/* Badge Pulse Animation */
.badge {
    animation: pulse 2s infinite;
}

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

/* Upload Area Drag & Drop Animation */
.upload-area {
    transition: all 0.3s ease;
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
}

.upload-area.drag-over {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.02);
}

.upload-area:hover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

/* Statistics Counter Animation */
.stat-counter {
    font-size: 2.5rem;
    font-weight: bold;
    opacity: 0;
    transform: translateY(20px);
    animation: countUp 1s ease-out forwards;
}

@keyframes countUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification Toast Slide-in */
.toast {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

/* Tab Switch Animation */
.tab-content {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tab-pane.active {
    opacity: 1;
    transform: translateY(0);
}

/* Dropdown Menu Slide */
.dropdown-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Search Input Expand Animation */
.search-input {
    width: 200px;
    transition: width 0.3s ease;
}

.search-input:focus {
    width: 300px;
}

/* Chart Container Fade-in */
.chart-container {
    opacity: 0;
    transform: scale(0.9);
    animation: chartFadeIn 0.8s ease-out forwards;
}

@keyframes chartFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Heat Map Point Pulse */
.heatmap-point {
    animation: heatPulse 2s ease-in-out infinite;
}

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

/* Success State Animation */
.success-checkmark {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkmark 0.8s ease-out forwards;
}

@keyframes checkmark {
    to {
        stroke-dashoffset: 0;
    }
}

/* Error Shake Animation */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Tooltip Fade Animation */
.tooltip {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.tooltip.show {
    opacity: 1;
    transform: scale(1);
}

/* Page Transition Effects */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    animation: pageLoad 0.6s ease-out forwards;
}

@keyframes pageLoad {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Interactive Icon Hover */
.icon-interactive {
    transition: all 0.3s ease;
}

.icon-interactive:hover {
    transform: scale(1.2) rotate(10deg);
    color: #007bff;
}

/* Video Upload Progress Ring */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.3s ease;
}

/* Mobile Responsive Micro-Interactions */
@media (max-width: 768px) {
    .card:hover {
        transform: translateY(-2px);
    }
    
    .btn:hover {
        transform: translateY(-1px);
    }
    
    .fab {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
}

/* Dark Theme Variants */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    }
    
    .upload-area {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .upload-area.drag-over {
        background: rgba(0, 123, 255, 0.2);
    }
}