/* This file is reserved for overriding and extending the template styles. */

/* ---- Universal full-page loading overlay ---- */
/* Hidden by default via inline style="display: none;" on the element. */
/* When the inline display:none is cleared (jQuery .show() / .hide() or
   directly setting style.display = 'flex'), the rules below render the
   centred card. The overlay covers the entire viewport with a translucent
   blurred backdrop and intercepts all pointer events so the user cannot
   click anything underneath while a long generation is running. */
#loading-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 14, 26, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 9999;
    /* Default to flex so jQuery .show() (which only clears the inline
       display: none from the partial) reveals the centred card. The partial
       starts hidden via style="display: none;". */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 1rem;
    pointer-events: auto;
    overflow: hidden;
    text-align: center;
    color: #f8fafc;
}

#loading-overlay.is-visible {
    display: flex !important;
}

#loading-overlay .loading-overlay__card {
    background: rgba(17, 24, 39, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 1rem;
    padding: 2.25rem 2rem;
    max-width: 28rem;
    width: 100%;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: inherit;
}

#loading-overlay .loader-container {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
}

#loading-overlay .loading-overlay__title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.5rem;
    color: inherit;
}

#loading-overlay .loading-overlay__sub,
#loading-overlay .loading-overlay-sub {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    color: rgba(248, 250, 252, 0.72);
}

/* Light theme: keep the same structure but invert backdrop + card colours so
   the overlay reads naturally against a bright app shell. */
html[data-color^="light"] #loading-overlay {
    background: rgba(247, 250, 252, 0.85);
    color: #102a43;
}

html[data-color^="light"] #loading-overlay .loading-overlay__card {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
}

html[data-color^="light"] #loading-overlay .loading-overlay__sub,
html[data-color^="light"] #loading-overlay .loading-overlay-sub {
    color: rgba(15, 23, 42, 0.6);
}

.loader-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    z-index: 9999;
}

.loader-image {
    width: 100%;
    height: 100%;
    animation: growShrink 2s infinite;
}

.splashes {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.splash {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 123, 255, 0.5);
    border-radius: 50%;
    animation: splash 1s infinite;
}

.splash:nth-child(1) {
    top: -30px;
    left: 0;
    animation-delay: 0.2s;
}

.splash:nth-child(2) {
    top: 0;
    left: -30px;
    animation-delay: 0.4s;
}

.splash:nth-child(3) {
    top: 0;
    left: 30px;
    animation-delay: 0.6s;
}

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

@keyframes splash {
    0%, 100% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}