#loading {
    position: fixed;
    z-index: 50000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95);
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    transform: translateZ(0);
}

.dark #loading {
    background-color: #171717;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* Logo loader animation container */
.logo-loader {
    position: relative;
    width: 240px;
    height: 170px;
    overflow: hidden;
    flex-shrink: 0;
}

#loading img {
    max-width: 240px !important;
    max-height: 170px !important;
}

/* Grayscale/faded background logo */
.logo-loader-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.25);
}

.dark .logo-loader-bg {
    filter: brightness(0) invert(1) opacity(0.15);
}

/* Full color foreground logo with reveal animation */
.logo-loader-fg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    clip-path: inset(0 100% 0 0);
    animation: logo-reveal 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.dark .logo-loader-fg {
    filter: brightness(0) invert(1);
}

@keyframes logo-reveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    50% {
        clip-path: inset(0 0 0 0);
    }
    100% {
        clip-path: inset(0 0 0 100%);
    }
}

/* Progress bar under the logo */
.logo-loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
    position: relative;
}

.dark .logo-loader-progress {
    background: rgba(255, 255, 255, 0.1);
}

.logo-loader-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0b7aaf 0%, #aac63b 50%, #1d1550 100%);
    border-radius: 2px;
    animation: progress-fill 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.dark .logo-loader-progress-bar {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.3) 100%);
}

@keyframes progress-fill {
    0% {
        width: 0;
        left: 0;
    }
    50% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 0;
        left: 100%;
    }
}

/* Shimmer effect overlay */
.logo-loader-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer-sweep 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}

.dark .logo-loader-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

@keyframes shimmer-sweep {
    0% {
        left: -50%;
    }
    100% {
        left: 150%;
    }
}

/* Hide ApexCharts download menu for swimlane chart */
#swimlaneChart .apexcharts-menu,
#swimlaneChart .apexcharts-menu-icon {
    display: none !important;
}
