/* Smooth Animations for Better UX */

/* Fade in animation for cards */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Slide in animation for sidebar */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.sidebar.active {
    animation: slideIn 0.3s ease-out;
}

/* Pulse animation for loading states */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.btn:disabled {
    animation: pulse 1.5s infinite;
}

/* Bounce animation for notifications */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.notification {
    animation: bounce 1s ease-out;
}

/* Shake animation for error states */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

.error {
    animation: shake 0.5s ease-in-out;
}

/* Scale animation for buttons */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.btn {
    animation: scaleIn 0.2s ease-out;
}

/* Rotate animation for loading spinner */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Stagger animation for table rows */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

tbody tr {
    animation: slideInUp 0.3s ease-out;
}

tbody tr:nth-child(1) { animation-delay: 0.1s; }
tbody tr:nth-child(2) { animation-delay: 0.2s; }
tbody tr:nth-child(3) { animation-delay: 0.3s; }
tbody tr:nth-child(4) { animation-delay: 0.4s; }
tbody tr:nth-child(5) { animation-delay: 0.5s; }

/* Hover animations */
.form-control:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Mobile-specific animations */
@media (max-width: 768px) {
    button.mobile-menu-toggle {
        transition: transform 0.3s ease;
    }
    
    button.mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    .sidebar ul li a {
        transition: all 0.3s ease;
    }
    
    .sidebar ul li a:active {
        transform: scale(0.98);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card,
    .btn,
    .sidebar.active,
    .notification,
    .error,
    .loading-spinner,
    tbody tr {
        animation: none !important;
    }
    
    .form-control:focus,
    .btn:hover {
        transform: none !important;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Success animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success {
    animation: successPulse 0.5s ease-out;
}

/* Form validation animations */
.form-control.error {
    border-color: #e74c3c;
    animation: shake 0.5s ease-in-out;
}

.form-control.success {
    border-color: #2ecc71;
    animation: successPulse 0.5s ease-out;
}

/* Table hover effects */
tbody tr {
    transition: all 0.3s ease;
}

tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Status badge animations */
.status {
    transition: all 0.3s ease;
}

.status:hover {
    transform: scale(1.1);
}

/* Mobile menu toggle animation - only for mobile */
@media (max-width: 768px) {
    button.mobile-menu-toggle {
        transition: all 0.3s ease;
    }

    button.mobile-menu-toggle:hover {
        background-color: rgba(255,255,255,0.2);
        transform: scale(1.1);
    }
}

/* Sidebar overlay animation */
.sidebar-overlay {
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    /* backdrop-filter: blur(3px); - removed to prevent screen blur */
}

/* Responsive animations */
@media (max-width: 480px) {
    .btn:hover {
        transform: none;
    }
    
    tbody tr:hover {
        transform: none;
    }
    
    .status:hover {
        transform: none;
    }
} 