/* Modern full-page spinner (shared) */
.modern-spinner-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.05) 0%, rgba(255,255,255,0.98) 25%, rgba(255,255,255,0.98) 75%, rgba(16, 163, 127, 0.05) 100%);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modern-spinner-overlay.active { display: flex; }

.modern-loading-container {
    text-align: center;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    animation: fadeInUp 0.6s ease-out;
}

.modern-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(16, 163, 127, 0.30);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulseRing 2s cubic-bezier(0.25, 0, 0, 1) infinite;
    will-change: transform, opacity;
}

.pulse-ring-2 { animation-delay: 0.33s; border-color: rgba(16, 163, 127, 0.20); }
.pulse-ring-3 { animation-delay: 0.66s; border-color: rgba(16, 163, 127, 0.10); }

.center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10a37f, #0d8f6a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(16, 163, 127, 0.35);
    animation: rotateCenter 3s linear infinite;
    will-change: transform;
}

/* Fallback animation - يضمن العمل حتى لو تم إعادة رسم العنصر */
.center-logo.loading-spin {
    animation: rotateCenter 3s linear infinite !important;
}

/* إجبار الحركة عند إضافة class */
.modern-spinner-overlay.active .center-logo {
    animation: rotateCenter 3s linear infinite !important;
}

.center-logo i { font-size: 1.6rem; }

.modern-spinner-message {
    margin-top: 12px;
    color: #374151;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    min-height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    gap: 0;
    direction: rtl;
}

/* النص الثابت */
.spinner-text {
    display: inline-block;
    margin-left: 0;
    margin-right: 0;
    transition: none;
    white-space: nowrap;
}

/* النقاط المتحركة */
.spinner-dots {
    display: inline-block;
    font-weight: 700;
    color: #10a37f;
    animation: dotsPulse 0.5s ease-in-out;
    transition: all 0.2s ease;
    letter-spacing: 0.05em;
    margin-right: 0;
    padding-right: 0;
    margin-inline-start: 0;
}

/* تأثير نبضة خفيف للنقاط */
@keyframes dotsPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes pulseRing {
    0% { transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

@keyframes rotateCenter {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(24px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .modern-spinner { width: 100px; height: 100px; }
    .pulse-ring { width: 100px; height: 100px; }
    .center-logo { width: 50px; height: 50px; }
    .center-logo i { font-size: 1.4rem; }
}


