/* Modern Page Loading Overlay - Nafas Store */
/* Professional loading screen with smooth animations */

.page-loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: linear-gradient(135deg, #0E7B95 0%, #004D40 100%);
    z-index: 99999 !important; /* High z-index but below modals (999999) */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    overflow: hidden;
}

body.page-loaded .page-loading-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-out, visibility 0s linear 0.3s;
    z-index: -1 !important; /* Move below everything when page is loaded */
}

/* Loading Progress Bar */
.loading-progress-bar {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #F4B400, #FFD700);
    animation: loadingProgress 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(244, 180, 0, 0.5);
}

@keyframes loadingProgress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Loading Logo - Main Focus */
.loading-logo {
    width: 250px;
    height: 250px;
    margin-bottom: 20px;
    object-fit: contain;
    animation: logoBreathing 2s ease-in-out infinite, logoFadeIn 0.4s ease-out;
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.4));
}

@keyframes logoBreathing {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.4));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 20px 50px rgba(244, 180, 0, 0.3)) 
                drop-shadow(0 0 30px rgba(244, 180, 0, 0.2));
    }
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading Spinner - Subtle beneath logo */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #F4B400;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: -10px;
    margin-bottom: 20px;
}

@keyframes spin {
    to { 
        transform: rotate(360deg);
    }
}

/* Loading Text */
.loading-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
    font-family: 'Cairo', sans-serif;
    animation: textFade 1.5s ease-in-out infinite;
}

@keyframes textFade {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.5;
    }
}

/* Content fade-in transitions */
#mainContent {
    opacity: 0;
    visibility: hidden;
}

body.page-loaded #mainContent {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-out;
}

.navbar-compact {
    opacity: 0;
    visibility: hidden;
}

body.page-loaded .navbar-compact {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-out;
}

footer {
    opacity: 0;
    visibility: hidden;
}

body.page-loaded footer {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-out;
}

/* ========================================
   LINK CLICK FEEDBACK STYLES
   ======================================== */

/* Smooth transitions for all links */
a {
    transition: opacity 0.15s ease, transform 0.15s ease !important;
}

/* Prevent double-click during navigation */
body[style*="cursor: wait"] * {
    pointer-events: none !important;
}

body[style*="cursor: wait"] {
    pointer-events: auto !important;
}

/* Loading cursor for navigating state */
body.navigating {
    cursor: wait !important;
}

body.navigating * {
    cursor: wait !important;
}
