/* Splash screen container */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #FFFFFF; /* White background to match design */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    /* Ensure splash covers everything including status bars */
    inset: 0;
}

/* Splash screen icon container */
.splash-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Center content accounting for safe areas */
    padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px);
}

/* App icon styling */
.splash-icon {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: pulse 2s ease-in-out infinite;
    /* Prevent image drag and selection */
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

/* Loading animation */
.splash-loading {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.splash-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d32f2f; /* Red dots to match staff theme */
    animation: loading 1.4s ease-in-out infinite both;
}

.splash-dot:nth-child(1) { animation-delay: -0.32s; }
.splash-dot:nth-child(2) { animation-delay: -0.16s; }
.splash-dot:nth-child(3) { animation-delay: 0s; }

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes loading {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Hide splash when app is loaded */
#splash-screen.hide {
    opacity: 0;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .splash-icon {
        width: 100px;
        height: 100px;
        border-radius: 20px;
    }

    .splash-loading {
        margin-top: 28px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .splash-icon {
        width: 80px;
        height: 80px;
        border-radius: 16px;
    }

    .splash-loading {
        margin-top: 24px;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 480px) {
    .splash-icon {
        width: 80px;
        height: 80px;
    }

    .splash-loading {
        margin-top: 20px;
    }
}

/* Prevent body scroll when splash is visible */
body.splash-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}
