/*
=====================================================
PRELOADER STYLES (v2)
=====================================================
*/

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary-black, #121212);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

#preloader.fade-out {
    opacity: 0;
}

/* This is the content that shows when ONLINE */
#preloader-content {
    text-align: center;
}

/* This is the content that shows when OFFLINE */
#offline-message {
    display: none; /* Hidden by default */
    text-align: center;
    color: var(--color-text-secondary);
}

/* This class hides the loader and shows the offline message */
#preloader.is-offline #preloader-content {
    display: none;
}
#preloader.is-offline #offline-message {
    display: block;
}

#offline-message i {
    font-size: 3rem;
    color: var(--color-primary-red);
    margin-bottom: 15px;
}
#offline-message h2 {
    font-size: 1.5rem;
    color: var(--color-text-primary);
}

/* MODIFIED: This now spins */
#preloader img {
    width: 150px;
    height: auto;
    animation: spin 1s linear infinite; /* Was 'pulse' */
}

/* NEW: "Loading..." text */
#preloader-text {
    margin-top: 20px;
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    font-weight: 300;
}

/* NEW: Animated "..." dots */
#preloader-text::after {
    content: '.';
    animation: dots 1.5s linear infinite;
}

/* By default, hide the main content until it's ready */
#page-content-wrapper {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}
#page-content-wrapper.visible {
    opacity: 1;
}

/* NEW: Spin animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* NEW: Dots animation */
@keyframes dots {
    0%   { content: "."; }
    33%  { content: ".."; }
    66%  { content: "..."; }
    100% { content: "."; }
}