/* Modern Loading Overlay - Follows Standard UI/UX Practices */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.3s ease-in-out;
}

/* Spinner Container */
#loader::before {
    content: '';
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-radius: 50%;
    border-top-color: #363986;
    border-right-color: #4A90E2;
    animation: spin 0.8s cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
}

/* Optional Loading Text */
#loader::after {
    content: 'Loading...';
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #363986;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.5px;
}

/* Smooth Spin Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

/* Fade-in Animation for Content */
.animate-bottom {
    animation: fadeInUp 0.5s ease-out;
}

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

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

/* Responsive Design */
@media screen and (max-width: 768px) {
    #loader::before {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }

    #loader::after {
        font-size: 13px;
        margin-top: 16px;
    }
}

@media screen and (max-height: 600px) {
    #loader::before {
        width: 45px;
        height: 45px;
    }

    #loader::after {
        font-size: 12px;
    }
}

/* Accessibility - Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    #loader::before {
        animation: pulse 1.5s ease-in-out infinite;
    }

    .animate-bottom {
        animation: fadeIn 0.3s ease-out;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

#myDiv {
    display: none;
    text-align: center;
}
