/* ===== LOADING SYSTEM STYLES ===== */

/* Elegant Modern Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #667eea 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    visibility: visible;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 60% 80%, rgba(255, 200, 120, 0.3) 0%, transparent 50%);
    animation: backgroundShift 8s ease-in-out infinite;
}

.loading-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05) rotate(2deg);
    }
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.5;
        transform: translateX(-100%);
    }
    50% {
        opacity: 1;
        transform: translateX(100%);
    }
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
}

/* Elegant Loading Animation */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    z-index: 1;
}

.loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid rgba(255, 255, 255, 0.9);
    border-right: 4px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: elegantSpin 1.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    border: 3px solid transparent;
    border-top: 3px solid rgba(255, 255, 255, 0.6);
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: elegantSpin 2.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite reverse;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.loading-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    animation: centerPulse 2.5s ease-in-out infinite;
    box-shadow:
        0 0 30px rgba(255, 255, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.loading-center::before {
    content: '✨';
    font-size: 28px;
    animation: iconFloat 3.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

@keyframes elegantSpin {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotate(180deg) scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

@keyframes centerPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    }
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Elegant Loading Text */
.loading-text {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    opacity: 0.95;
    animation: textFade 3s ease-in-out infinite;
    letter-spacing: 1.5px;
    text-shadow:
        0 2px 15px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 255, 255, 0.3);
    margin-bottom: 8px;
}

.loading-subtext {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    margin-top: 12px;
    animation: textFade 3s ease-in-out infinite 0.8s;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

@keyframes textFade {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

/* Elegant Loading Dots */
.loading-dots {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    justify-content: center;
}

.loading-dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: dotBounce 1.8s ease-in-out infinite;
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.6),
        0 2px 8px rgba(255, 255, 255, 0.3);
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.3s; }
.loading-dot:nth-child(3) { animation-delay: 0.6s; }

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

/* Elegant Progress Bar */
.loading-progress {
    width: 250px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    margin-top: 35px;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(255, 255, 255, 0.1);
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.9) 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.5),
        0 2px 8px rgba(255, 255, 255, 0.3);
}

.loading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%);
    animation: progressShine 2.5s ease-in-out infinite;
    border-radius: 10px;
}

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

/* Magical Floating Particles */
.loading-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.loading-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.4);
}

.loading-particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.loading-particle:nth-child(2) { left: 20%; animation-delay: 1.2s; }
.loading-particle:nth-child(3) { left: 30%; animation-delay: 2.4s; }
.loading-particle:nth-child(4) { left: 40%; animation-delay: 3.6s; }
.loading-particle:nth-child(5) { left: 50%; animation-delay: 4.8s; }
.loading-particle:nth-child(6) { left: 60%; animation-delay: 6s; }
.loading-particle:nth-child(7) { left: 70%; animation-delay: 7.2s; }
.loading-particle:nth-child(8) { left: 80%; animation-delay: 8.4s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(-10vh) scale(1);
    }
    100% {
        transform: translateY(-20vh) scale(0);
        opacity: 0;
    }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .loading-spinner {
        width: 100px;
        height: 100px;
    }

    .loading-center {
        width: 50px;
        height: 50px;
    }

    .loading-center::before {
        font-size: 20px;
    }

    .loading-text {
        font-size: 16px;
        padding: 0 20px;
    }

    .loading-subtext {
        font-size: 13px;
        padding: 0 20px;
    }

    .loading-progress {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .loading-spinner {
        width: 80px;
        height: 80px;
    }

    .loading-center {
        width: 40px;
        height: 40px;
    }

    .loading-center::before {
        font-size: 16px;
    }

    .loading-text {
        font-size: 14px;
    }

    .loading-subtext {
        font-size: 12px;
    }

    .loading-progress {
        width: 120px;
    }
}

/* Hide page content during loading */
body.loading {
    overflow: hidden;
}

body.loading > *:not(.loading-screen):not(.welcome-message) {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Welcome Message Styles */
.welcome-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 
        0 10px 30px rgba(40, 167, 69, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 9999;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 350px;
    backdrop-filter: blur(10px);
}

.welcome-message.show {
    transform: translateX(0);
}

.welcome-message.hide {
    transform: translateX(100%);
    opacity: 0;
}

.welcome-message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.welcome-message-icon {
    font-size: 24px;
    animation: bounceIcon 2s ease-in-out infinite;
}

@keyframes bounceIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.welcome-message-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.welcome-message-text {
    font-size: 14px;
    margin: 0;
    opacity: 0.95;
    line-height: 1.4;
}

.welcome-message-close {
    position: absolute;
    top: 8px;
    left: 8px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.welcome-message-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Page Load Success Message */
.page-load-message {
    background: linear-gradient(135deg, #4682B4 0%, #87CEEB 100%);
}

.page-load-message .welcome-message-icon {
    color: #FFD700;
}

/* Different message types */
.welcome-message.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.welcome-message.info {
    background: linear-gradient(135deg, #4682B4 0%, #87CEEB 100%);
}

.welcome-message.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #333;
}

.welcome-message.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Loading Dots Animation */
.loading-dots {
    display: inline-block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.loading-dots::after {
    content: '';
    animation: dots 2s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-logo {
        width: 100px;
        height: 100px;
        margin-bottom: 25px;
    }
    
    .loading-text {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .loading-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }
    
    .loading-progress {
        width: 250px;
    }
    
    .welcome-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 15px 20px;
    }
    
    .welcome-message-title {
        font-size: 16px;
    }
    
    .welcome-message-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .loading-text {
        font-size: 20px;
    }
    
    .loading-subtitle {
        font-size: 12px;
    }
    
    .loading-progress {
        width: 200px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
}
.logo-img-as{
    width: 100px;
    height: 100px;
    border-radius: 50%;
}