/* Smooth Page Transitions */
html {
    scroll-behavior: smooth;
}

/* Apply page load animation to main content only, not sidebar */
main {
    animation: pageLoad 0.4s ease-in-out;
}

/* 
   EXCLUSION: NO ANIMATIONS OR TRANSITIONS FOR SIDEBAR
   This ensures that the sidebar remains static when navigating between pages.
*/
aside, aside *, .flex.min-h-screen {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

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

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

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

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

/* Smooth transitions for all interactive elements EXCEPT inside sidebar */
button, a, input, select, textarea {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover, a:hover {
    transform: translateY(-2px);
}

button:active, a:active {
    transform: translateY(0);
}

/* Smooth transitions for cards and containers */
.card, div[class*="rounded"], div[class*="shadow"] {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth transitions for alerts and modals */
.alert, [class*="modal"], [class*="dialog"] {
    animation: fadeIn 0.3s ease-in-out;
}

/* Smooth transitions for tables */
table tbody tr {
    transition: background-color 0.2s ease-in-out;
}

table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

/* Smooth transitions for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth transitions for form inputs */
input:focus, select:focus, textarea:focus {
    transition: all 0.2s ease-in-out;
    transform: scale(1.01);
}

/* Smooth page navigation indicators (only for non-sidebar links) */
main a[href]:not(aside a)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease-in-out;
}

main a[href]:not(aside a):hover::after {
    width: 100%;
}

/* Utility classes */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.transition-fast {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.transition-slow {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

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

.animate-slideInUp {
    animation: slideInUp 0.4s ease-in-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.4s ease-in-out;
}
