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

@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);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.4s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.4s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.4s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation-delay: 0.5s; opacity: 0; }

.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.btn:not(:disabled):active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.4);
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(var(--bs-success-rgb), 0.4);
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(var(--bs-danger-rgb), 0.4);
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.4s, opacity 0.5s;
}

.btn:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

.form-control, .form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.form-control:focus, .form-select:focus {
    transform: scale(1.01);
}

.nav-item {
    transition: all 0.2s ease;
}

.nav-item:hover {
    transform: translateX(2px);
}

.nav-link {
    position: relative;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--bs-primary);
    transition: width 0.3s ease;
}

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

.badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.alert {
    animation: fadeInDown 0.3s ease-out;
}

.modal.show .modal-dialog {
    animation: scaleIn 0.2s ease-out;
}

.modal .modal-content {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.dropdown-menu {
    animation: fadeInUp 0.15s ease-out;
    transform-origin: top;
}

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

.progress-bar {
    transition: width 0.6s ease;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--bs-primary);
    border-radius: 50%;
    animation: bounce 0.6s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.1s; }
.loading-dots span:nth-child(3) { animation-delay: 0.2s; }

.success-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bs-success);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.3s ease-out;
}

.success-checkmark::after {
    content: '\2713';
    color: white;
    font-size: 30px;
    font-weight: bold;
}

.count-up {
    transition: all 0.3s ease;
}

.stat-number {
    font-variant-numeric: tabular-nums;
    transition: transform 0.3s ease;
}

.stat-number:hover {
    transform: scale(1.1);
}

.score-ring {
    transition: stroke-dashoffset 1s ease-out;
}

.tooltip {
    animation: fadeIn 0.15s ease-out;
}

.popover {
    animation: scaleIn 0.15s ease-out;
}

.list-group-item {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.list-group-item:hover {
    transform: translateX(4px);
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover {
    transform: scale(1.005);
}

.icon-animated {
    transition: transform 0.2s ease;
}

.icon-animated:hover {
    transform: scale(1.2) rotate(5deg);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-animated {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.page-transition {
    animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
    animation: fadeIn 0.2s ease-out;
}

.accordion-button:not(.collapsed) {
    transition: color 0.2s ease, background-color 0.2s ease;
}

.accordion-collapse {
    transition: max-height 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

[data-theme="dark"] .skeleton-loading {
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
}

[data-theme="dark"] .loading-spinner {
    border-color: #444;
    border-top-color: var(--bs-primary);
}
