/* 
 * Bactizad Formulator - Clean Splash Screen
 * Optimized, minimal design with smooth animations
 * 
 * @author Bactizad Development Team
 * @version 3.6.0
 */

/* Main Splash Container */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.splash-screen.visible {
    opacity: 1;
}

/* Content Container */
.splash-container {
    width: 100%;
    max-width: 500px;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

/* Main Content */
.splash-content {
    animation: fadeInUp 0.6s ease-out;
}

/* Logo */
.splash-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: logoFadeIn 0.8s ease-out;
}

/* Title */
.splash-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Subtitle */
.splash-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 3rem 0;
    font-weight: 400;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Progress Section */
.splash-progress {
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer */
.splash-footer {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    animation: fadeIn 0.6s ease-out 0.8s both;
}

.separator {
    color: rgba(255, 255, 255, 0.5);
}

.version {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hide splash screen */
.splash-screen.hiding {
    opacity: 0;
    pointer-events: none;
}

.splash-screen.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .splash-container {
        padding: 2rem 1.5rem;
    }
    
    .splash-logo {
        width: 70px;
        height: 70px;
    }
    
    .splash-title {
        font-size: 2rem;
    }
    
    .splash-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .splash-container {
        padding: 2rem 1rem;
    }
    
    .splash-logo {
        width: 60px;
        height: 60px;
    }
    
    .splash-title {
        font-size: 1.75rem;
    }
    
    .splash-subtitle {
        font-size: 0.85rem;
    }
    
    .splash-footer {
        font-size: 0.8rem;
    }
}

/* Data unavailable state — app disabled until refresh */
.splash-data-unavailable {
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
}

.splash-data-unavailable .splash-logo {
    margin-bottom: 1.25rem;
}

.splash-error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.75rem 0;
}

.splash-error-message {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

.splash-error-detail {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 1rem 0;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    line-height: 1.4;
    word-break: break-word;
}

.splash-error-checklist {
    text-align: left;
    list-style: none;
    padding: 0 1.5rem;
    margin: 0 0 1.5rem 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.6;
}

.splash-error-checklist li {
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.splash-error-checklist li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: rgba(255, 255, 255, 0.7);
}

.splash-error-checklist code {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

#splashRefreshBtn {
    margin-top: 0.5rem;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    background: #ffffff;
    color: #4f46e5;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#splashRefreshBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#splashRefreshBtn:active {
    transform: translateY(0);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .splash-screen *,
    .splash-screen *::before,
    .splash-screen *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
