/* splash.css */

body.loading-active {
    overflow: hidden; /* Prevent scrolling while loader is active */
    height: 100vh; /* Ensure body takes full viewport height */
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Use 100vh for full viewport height, especially on iOS */
    min-height: -webkit-fill-available; /* iOS specific viewport height fix */
    background-color: var(--body-color);
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-out 0.3s, visibility 0.8s ease-out 0.3s; /* Delay fade out slightly */
    padding: 20px; /* Add some padding for text on small screens */
    box-sizing: border-box;
    text-align: center; /* Center text within the flex items */
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Space between text elements and spinner */
}

.splash-title {
    font-size: 2.5rem; /* Large title */
    font-weight: 600;
    color: var(--first-color); /* Your primary color */
    margin: 0;
    line-height: 1.1;
    opacity: 0;
    animation: fadeInSlideUp 0.7s ease-out 0.2s forwards;
}

.splash-subtitle {
    font-size: 1.5rem;
    color: var(--title-color); /* Your theme's title color */
    margin: 0;
    opacity: 0;
    animation: fadeInSlideUp 0.7s ease-out 0.4s forwards;
}

.splash-message {
    font-size: 1rem;
    color: var(--text-color); /* Your theme's text color */
    margin: 10px 0 0 0; /* Add some top margin before spinner */
    opacity: 0;
    animation: fadeInSlideUp 0.7s ease-out 0.6s forwards;
}

.spinner {
    width: 50px; /* Slightly smaller spinner */
    height: 50px;
    border: 6px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--first-color);
    border-radius: 50%;
    animation: spin 1s linear infinite, fadeInElement 0.5s ease-out 0.8s forwards; /* Spinner fades in too */
    opacity: 0; /* Spinner initially hidden */
    margin-top: 20px; /* Space above spinner */
}

/* Dark theme considerations */
body.dark-theme .loading-screen {
    background-color: var(--body-color);
}
body.dark-theme .splash-title {
    color: var(--first-color); /* Keep primary color or adjust if needed */
}
body.dark-theme .splash-subtitle {
    color: var(--title-color); /* Uses dark theme title color */
}
body.dark-theme .splash-message {
    color: var(--text-color); /* Uses dark theme text color */
}
body.dark-theme .spinner {
    border: 6px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--first-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeInElement { /* For spinner fade in */
    to {
        opacity: 1;
    }
}


/* Responsive adjustments for smaller screens */
@media (max-width: 767px) {
    .splash-title {
        font-size: 2rem; /* Adjust font size */
    }
    .splash-subtitle {
        font-size: 1.2rem;
    }
    .splash-message {
        font-size: 0.9rem;
    }
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 5px;
    }
}

@media (max-width: 480px) {
    .splash-title {
        font-size: 1.8rem;
    }
    .splash-subtitle {
        font-size: 1.1rem;
    }
    .splash-message {
        font-size: 0.85rem;
    }
    .loading-content {
        gap: 10px;
    }
}

/* iOS specific font smoothing - optional, test if needed */
@supports (-webkit-touch-callout: none) {
    .loading-screen {
        -webkit-font-smoothing: antialiased; /* Can make text look sharper on iOS */
    }
}