/* ========================================
   UI Animations & Enhancements
   ======================================== */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Staggered animation for table rows */
.table tbody tr {
    animation: fadeIn 0.3s ease-out forwards;
    opacity: 0;
    /* Start hidden */
}

.table tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

.table tbody tr:nth-child(2) {
    animation-delay: 0.1s;
}

.table tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

.table tbody tr:nth-child(4) {
    animation-delay: 0.2s;
}

.table tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

.table tbody tr:nth-child(6) {
    animation-delay: 0.3s;
}

.table tbody tr:nth-child(7) {
    animation-delay: 0.35s;
}

.table tbody tr:nth-child(8) {
    animation-delay: 0.4s;
}

.table tbody tr:nth-child(9) {
    animation-delay: 0.45s;
}

.table tbody tr:nth-child(10) {
    animation-delay: 0.5s;
}

/* Card Hover Effects */
.pm-card,
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pm-card:hover,
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(26, 26, 46, 0.8);
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    color: transparent !important;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2d2d42 25%, #3a3a4e 50%, #2d2d42 75%);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
}

[data-theme="dark"] .toast {
    background: #252538;
    color: #e0e0e0;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form Focus Effects */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(54, 40, 143, 0.15);
    transform: translateY(-1px);
}

/* Collapsible Section Animations */
.collapse {
    transition: height 0.35s ease;
}

.collapsing {
    transition: height 0.35s ease;
}

/* Chevron Icon Rotation for Collapsible Headers */
[data-bs-toggle="collapse"] .transition-icon {
    transition: transform 0.3s ease;
}

[data-bs-toggle="collapse"][aria-expanded="true"] .transition-icon {
    transform: rotate(180deg);
}

/* Clickable header cursor */
[data-bs-toggle="collapse"] {
    cursor: pointer;
    user-select: none;
}

[data-bs-toggle="collapse"]:hover {
    background-color: rgba(54, 40, 143, 0.02);
}

[data-theme="dark"] [data-bs-toggle="collapse"]:hover {
    background-color: rgba(255, 255, 255, 0.05);
}