/**
 * Skill Farm Preloader Styles
 * Matches the unified interface design
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Preloader Container */
.sfp-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0D353E;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sfp-preloader.sfp-loaded {
    opacity: 0;
    visibility: hidden;
}

/* Animated mesh gradient background */
.sfp-mesh-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(at 40% 20%, #1b5059 0px, transparent 50%),
        radial-gradient(at 80% 0%, #164147 0px, transparent 50%),
        radial-gradient(at 0% 50%, #0A2A32 0px, transparent 50%),
        radial-gradient(at 80% 50%, #102B30 0px, transparent 50%),
        radial-gradient(at 0% 100%, #1b5059 0px, transparent 50%),
        radial-gradient(at 80% 100%, #164147 0px, transparent 50%);
    animation: sfpMeshMove 20s ease infinite;
    opacity: 0.7;
}

@keyframes sfpMeshMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Content Wrapper */
.sfp-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 500px;
    padding: 2rem;
}

/* Skill Farm Logo */
.sfp-logo {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #1b5059 0%, #6CFFC4 25%, #1b5059 50%, #6CFFC4 75%, #1b5059 100%);
    background-size: 400% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: sfpShimmer 4s linear infinite;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 30px rgba(108, 255, 196, 0.3));
    opacity: 0;
    transform: translateY(20px);
    animation: sfpShimmer 4s linear infinite, sfpFadeInUp 0.6s ease 0.2s forwards;
}

@keyframes sfpShimmer {
    0% { 
        background-position: 0% center;
    }
    100% { 
        background-position: 400% center;
    }
}

@keyframes sfpFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar Container */
.sfp-progress-container {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background-color: rgba(108, 255, 196, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 0 auto 1.5rem;
    opacity: 0;
    transform: scaleX(0.8);
    animation: sfpFadeInScale 0.4s ease 0.4s forwards;
}

@keyframes sfpFadeInScale {
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Progress Bar */
.sfp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6CFFC4 0%, #4ACC9F 50%, #6CFFC4 100%);
    background-size: 200% auto;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: sfpGradientMove 2s linear infinite;
    box-shadow: 0 0 20px rgba(108, 255, 196, 0.5);
}

@keyframes sfpGradientMove {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Progress Glow Effect */
.sfp-progress-bar::after {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    bottom: -10px;
    left: -10px;
    background: inherit;
    filter: blur(20px);
    opacity: 0.5;
    z-index: -1;
}

/* Powered by Text */
.sfp-powered-by {
    color: #6CFFC4;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0;
    transform: translateY(10px);
    animation: sfpFadeInUp 0.6s ease 0.6s forwards;
}

/* Loading Percentage */
.sfp-percentage {
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 0.75rem;
    color: #6CFFC4;
    font-weight: 500;
    opacity: 0;
    animation: sfpFadeIn 0.3s ease 0.5s forwards;
}

@keyframes sfpFadeIn {
    to {
        opacity: 1;
    }
}

/* Loading Dots Animation */
.sfp-loading-dots {
    display: inline-flex;
    margin-left: 8px;
}

.sfp-loading-dots span {
    width: 6px;
    height: 6px;
    background-color: #6CFFC4;
    border-radius: 50%;
    margin: 0 2px;
    opacity: 0.3;
    animation: sfpDotPulse 1.4s ease-in-out infinite;
}

.sfp-loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.sfp-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.sfp-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes sfpDotPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sfp-logo {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .sfp-powered-by {
        font-size: 1rem;
    }
    
    .sfp-progress-container {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .sfp-logo {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .sfp-powered-by {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    
    .sfp-content {
        padding: 1.5rem;
    }
}

/* High Performance Mode - Reduced animations for slower devices */
@media (prefers-reduced-motion: reduce) {
    .sfp-mesh-gradient,
    .sfp-logo,
    .sfp-progress-bar,
    .sfp-loading-dots span {
        animation: none;
    }
    
    .sfp-logo {
        opacity: 1;
        transform: none;
    }
    
    .sfp-progress-container {
        opacity: 1;
        transform: none;
    }
    
    .sfp-powered-by {
        opacity: 1;
        transform: none;
    }
    
    .sfp-percentage {
        opacity: 1;
    }
}