/* Splash Screen Styles */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color, #F5F7FA);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

#splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-logo-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    animation: pulse-logo 2s infinite ease-in-out;
}

.splash-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.splash-loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--primary-color, #1565C0);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes pulse-logo {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modern runtime spinner */
#loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    backdrop-filter: blur(2px);
}

[data-theme="dark"] #loading-spinner {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Ensure it uses flex when showSpinner sets display: block */
#loading-spinner[style*="display: block"] {
    display: flex !important;
}

#loading-spinner::after {
    content: "";
    width: 48px;
    height: 48px;
    border: 4px solid var(--primary-color, #1565C0);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

/* Dark mode overrides for explicit colors if needed */
[data-theme="dark"] #splash-screen {
    background-color: var(--bg-color, #121212);
}