/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFE4B5 0%, #FFDAB9 50%, #FFFACD 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    pointer-events: auto;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Loading Animation Container */
.loading-container {
    text-align: center;
    position: relative;
}

/* Main Loading Spinner */
.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 140, 105, 0.2);
    border-top: 4px solid #FF8C69;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
    position: relative;
}

/* Confetti Animation Around Spinner */
.loading-spinner::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid transparent;
    border-top: 2px solid #E9869E;
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px solid transparent;
    border-top: 1px solid #C8A2C6;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Floating Confetti */
.loading-confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    animation: float 3s ease-in-out infinite;
}

.loading-confetti:nth-child(1) {
    top: 20%;
    left: 20%;
    background: #E9869E;
    border-radius: 50%;
    animation-delay: 0s;
}

.loading-confetti:nth-child(2) {
    top: 30%;
    right: 25%;
    background: #C8A2C6;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation-delay: 0.5s;
}

.loading-confetti:nth-child(3) {
    bottom: 25%;
    left: 30%;
    background: #EFCC4B;
    transform: rotate(45deg);
    animation-delay: 1s;
}

.loading-confetti:nth-child(4) {
    bottom: 20%;
    right: 20%;
    background: #96d7d0;
    border-radius: 50%;
    animation-delay: 1.5s;
}

.loading-confetti:nth-child(5) {
    top: 50%;
    left: 10%;
    background: #C2D4E0;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation-delay: 2s;
}

.loading-confetti:nth-child(6) {
    top: 60%;
    right: 10%;
    background: #e05678;
    transform: rotate(45deg);
    animation-delay: 2.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* Loading Text */
.loading-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-subtext {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #4A5568;
    opacity: 0.8;
    animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Progress Bar */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 140, 105, 0.2);
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
    position: relative;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FF8C69 0%, #E9869E 50%, #C8A2C6 100%);
    border-radius: 2px;
    width: 0%;
    animation: progress 2s ease-in-out infinite;
    position: relative;
}

.loading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .loading-spinner {
        width: 60px;
        height: 60px;
        border-width: 3px;
        margin-bottom: 20px;
    }
    
    .loading-text {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .loading-subtext {
        font-size: 0.8rem;
    }
    
    .loading-progress {
        width: 150px;
        height: 3px;
    }
    
    .loading-confetti {
        width: 6px;
        height: 6px;
    }
}

/* Hide loading screen when page is loaded */
.loading-screen.hidden {
    display: none;
}

/* Page content should be visible after loading */
body.loaded {
    opacity: 1 !important;
    visibility: visible !important;
    overflow: auto !important;
}

/* Smooth transition for page content */
.page-content {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

.page-content.loaded {
    opacity: 1;
}
