/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

/* Animated background particles */
.preloader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    background-size: 50px 50px;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
    }
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: white;
}

/* Logo/Icon Animation */
.preloader-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: logoFloat 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.preloader-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    animation: logoShine 3s ease-in-out infinite;
}

.preloader-logo i {
    font-size: 40px;
    color: #667eea;
    animation: iconPulse 2s ease-in-out infinite;
    z-index: 1;
    position: relative;
}

/* Loading Text */
.preloader-text {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: textGlow 2s ease-in-out infinite;
    position: relative;
}

.preloader-text::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: white;
    animation: textUnderline 2s ease-in-out infinite;
}

.preloader-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin-bottom: 40px;
    text-align: center;
    animation: subtitleFade 3s ease-in-out infinite;
}

/* Progress Bar */
.preloader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.9s forwards;
}

.preloader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff, #f0f0f0);
    border-radius: 2px;
    width: 0%;
    animation: progressFill 2s ease-out 1.2s forwards;
}

/* Dots Animation */
.preloader-dots {
    display: flex;
    gap: 12px;
    position: relative;
}

.preloader-dots::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%);
    border-radius: 1px;
}

.preloader-dot {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
    opacity: 0.6;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.preloader-dot:nth-child(1) {
    animation-delay: 0s;
}

.preloader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.preloader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.preloader-dot:nth-child(4) {
    animation-delay: 0.6s;
}

.preloader-dot:nth-child(5) {
    animation-delay: 0.8s;
}

/* Animations */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

@keyframes logoShine {
    0%, 100% {
        transform: translateX(-100%) translateY(-100%) rotate(0deg);
    }
    50% {
        transform: translateX(100%) translateY(100%) rotate(180deg);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    50% {
        text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
    }
}

@keyframes textUnderline {
    0%, 100% {
        width: 0;
    }
    50% {
        width: 100px;
    }
}

@keyframes subtitleFade {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .preloader-logo {
        width: 60px;
        height: 60px;
        border-radius: 15px;
    }
    
    .preloader-logo i {
        font-size: 30px;
    }
    
    .preloader-text {
        font-size: 20px;
    }
    
    .preloader-subtitle {
        font-size: 14px;
    }
    
    .preloader-dots {
        gap: 8px;
    }
    
    .preloader-dot {
        width: 10px;
        height: 10px;
    }
    
    .preloader-progress {
        width: 150px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .preloader {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
}

/* Loading states */
.preloader.loading .preloader-dot {
    animation-play-state: running;
}

/* Hide preloader when page is ready */
.preloader.page-ready {
    opacity: 0;
    visibility: hidden;
} 