/* Main Loader Container */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom right, #ffffff, #f8fafc);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 1;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

    .loader-container.active {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease, visibility 0s;
    }

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 90%;
}

/* Logo Animation Container */
.loader-container .logo-animation-container {
    position: relative;
    width: 12rem;
    height: 12rem;
    margin-bottom: 1rem;
}

/* Logo Container */
.loader-container .logo-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: pulse 2s infinite ease-in-out;
}

.loader-container .loader-logo {
    width: 8rem;
    height: 8rem;
    object-fit: contain;
}

/* Circular Animations */
.circular-animations {
    position: absolute;
    inset: 0;
}

.outer-circle {
    position: absolute;
    inset: 0;
    border: 4px dashed #c4b5fd;
    border-radius: 50%;
    animation: rotate 20s linear infinite;
    opacity: 1;
    animation-delay: 0.3s;
    animation-fill-mode: forwards;
}

.middle-circle {
    position: absolute;
    top: 7.5%;
    left: 7.5%;
    right: 7.5%;
    bottom: 7.5%;
    border: 2px solid #bfdbfe;
    border-radius: 50%;
    animation: rotate-reverse 15s linear infinite;
    opacity: 1;
    animation-delay: 0.4s;
    animation-fill-mode: forwards;
}

.inner-circle {
    position: absolute;
    top: 15%;
    left: 15%;
    right: 15%;
    bottom: 15%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    animation: rotate 8s linear infinite;
    opacity: 1;
    animation-delay: 0.5s;
    animation-fill-mode: forwards;
}

.pulsing-circle {
    position: absolute;
    top: 22.5%;
    left: 22.5%;
    right: 22.5%;
    bottom: 22.5%;
    border-radius: 50%;
    background: linear-gradient(to right, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    animation: pulse-scale 3s ease-in-out infinite;
    opacity: 1;
    animation-delay: 0.6s;
    animation-fill-mode: forwards;
}

.svg-circle-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    animation-delay: 0.7s;
    animation-fill-mode: forwards;
    animation: fade-in 0.5s forwards;
    animation-delay: 0.7s;
}

.svg-circle {
    width: 100%;
    height: 100%;
}

.progress-circle {
    fill: none;
    stroke: cornflowerblue;
    stroke-width: 1.5;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: circle-progress 4s ease-in-out infinite;
}

/* Orbiting Dots */
.orbiting-dot {
    position: absolute;
    top: 0;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    margin-left: -3px;
    border-radius: 50%;
    background: linear-gradient(to right, #8b5cf6, #3b82f6);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
    transform-origin: center 6rem;
    opacity: 1;
    animation-fill-mode: forwards;
}

.dot-1 {
    animation: orbit 5s linear infinite, dot-pulse 2s ease-in-out infinite, fade-in 0.5s forwards;
    animation-delay: 0s, 0s, 0.8s;
}

.dot-2 {
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    margin-left: -3.5px;
    animation: orbit 5s linear infinite, dot-pulse 2s ease-in-out infinite, fade-in 0.5s forwards;
    animation-delay: 1.5s, 0.75s, 0.9s;
}

.dot-3 {
    width: 8px;
    height: 8px;
    margin-top: -4px;
    margin-left: -4px;
    animation: orbit 5s linear infinite, dot-pulse 2s ease-in-out infinite, fade-in 0.5s forwards;
    animation-delay: 3s, 1.5s, 1s;
}

/* Particles */
.particles-container {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.particle {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    background: linear-gradient(to right, #c4b5fd, #93c5fd);
    opacity: 1;
}

/* Generate 15 particles with different animations */
.p1 {
    width: 4px;
    height: 4px;
    animation: particle-move 2.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

.p2 {
    width: 5px;
    height: 5px;
    animation: particle-move 3.2s ease-in-out infinite;
    animation-delay: 0.5s;
}

.p3 {
    width: 3px;
    height: 3px;
    animation: particle-move 2.8s ease-in-out infinite;
    animation-delay: 0.8s;
}

.p4 {
    width: 6px;
    height: 6px;
    animation: particle-move 3.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.p5 {
    width: 4px;
    height: 4px;
    animation: particle-move 2.7s ease-in-out infinite;
    animation-delay: 1.2s;
}

.p6, .p7, .p8, .p9, .p10, .p11, .p12, .p13, .p14, .p15 {
    width: 4px;
    height: 4px;
    animation: particle-move 3s ease-in-out infinite;
}

.p6 {
    animation-delay: 0.4s;
}

.p7 {
    animation-delay: 0.7s;
}

.p8 {
    animation-delay: 1.0s;
}

.p9 {
    animation-delay: 1.3s;
}

.p10 {
    animation-delay: 1.6s;
}

.p11 {
    animation-delay: 1.9s;
}

.p12 {
    animation-delay: 0.1s;
}

.p13 {
    animation-delay: 0.6s;
}

.p14 {
    animation-delay: 1.1s;
}

.p15 {
    animation-delay: 1.5s;
}

/* Company Name Container */
.company-name-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
}

/* Arabic Name */
.arabic-name-container {
    position: relative;
    height: 3rem;
    margin-bottom: 0.5rem;
    direction: rtl;
}

.arabic-letters {
    display: flex;
    justify-content: center;
}

.ar-letter {
    display: inline-block;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: #8b5cf6;
    transform: translateY(40px);
    opacity: 1;
    filter: blur(8px);
    animation: letter-appear 0.5s ease-out forwards;
}

.ar-letter-1 {
    animation-delay: 0.7s;
}

.ar-letter-2 {
    animation-delay: 0.8s;
}

.ar-letter-3 {
    animation-delay: 0.9s;
}

.ar-letter-4 {
    animation-delay: 1.0s;
}

.ar-letter-5 {
    animation-delay: 1.1s;
}

.ar-letter-6 {
    animation-delay: 1.2s;
}

.arabic-underline {
    height: 2px;
    background: linear-gradient(to right, rgba(139, 92, 246, 0), #8b5cf6, rgba(139, 92, 246, 0));
    border-radius: 9999px;
    margin-top: 4px;
    width: 0%;
    opacity: 1;
    animation: underline-appear 2s ease-in-out infinite;
    animation-delay: 1.2s;
}

/* English Name */
.english-name-container {
    position: relative;
}

.english-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(139, 92, 246, 0), rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0));
    border-radius: 0.5rem;
    filter: blur(16px);
    animation: glow-pulse 3s ease-in-out infinite alternate;
}

.english-letters {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.en-letter {
    display: inline-block;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: linear-gradient(to right, #8b5cf6, #3b82f6, #06b6d4);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
    transform: translateY(-40px) scale(1.2);
    opacity: 1;
    animation: en-letter-appear 0.5s ease-out forwards, gradient-shift 3s linear infinite alternate, letter-scale 2s ease-in-out infinite alternate;
}

.en-letter-1 {
    animation-delay: 0.8s, 1.0s, 1.5s;
}

.en-letter-2 {
    animation-delay: 0.87s, 1.1s, 1.6s;
}

.en-letter-3 {
    animation-delay: 0.94s, 1.2s, 1.7s;
}

.en-letter-4 {
    animation-delay: 1.01s, 1.3s, 1.8s;
}

.en-letter-5 {
    animation-delay: 1.08s, 1.4s, 1.9s;
}

.en-letter-6 {
    animation-delay: 1.15s, 1.5s, 2.0s;
}

.en-letter-7 {
    animation-delay: 1.22s, 1.6s, 2.1s;
}

.english-underline {
    height: 2px;
    background: linear-gradient(to right, rgba(139, 92, 246, 0), #3b82f6, rgba(139, 92, 246, 0));
    border-radius: 9999px;
    margin-top: 4px;
    width: 0%;
    animation: en-underline-animate 4s ease-in-out infinite alternate;
    animation-delay: 1.5s;
}

/* Loading Message */
.loading-message-container {
    margin-top: 2rem;
}

.loading-message {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
    opacity: 1;
    transform: translateY(5px);
    animation: message-fade 0.5s ease-out forwards;
    animation-delay: 0.3s;
}

/* Animations */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotate-reverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulse-scale {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

@keyframes circle-progress {
    0% {
        stroke-dashoffset: 283;
    }

    50% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: 283;
    }
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(0) rotate(0deg);
    }

    100% {
        transform: rotate(360deg) translateX(0) rotate(-360deg);
    }
}

@keyframes dot-pulse {
    0% {
        transform: rotate(0deg) translateX(0) rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) translateX(0) rotate(-180deg) scale(1.3);
    }

    100% {
        transform: rotate(360deg) translateX(0) rotate(-360deg) scale(1);
    }
}

@keyframes particle-move {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }

    25% {
        opacity: 0.7;
    }

    75% {
        opacity: 0.7;
    }

    100% {
        transform: translate( calc(var(--x, 1) * 60px), calc(var(--y, 1) * 60px) );
        opacity: 0;
    }
}

@keyframes letter-appear {
    0% {
        transform: translateY(40px);
        opacity: 0;
        filter: blur(8px);
    }

    100% {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes underline-appear {
    0% {
        width: 0%;
        opacity: 0;
        transform: translateX(-20%);
    }

    25% {
        width: 100%;
        opacity: 1;
        transform: translateX(0%);
    }

    50% {
        width: 100%;
        opacity: 1;
        transform: translateX(0%);
    }

    100% {
        width: 0%;
        opacity: 0;
        transform: translateX(20%);
    }
}

@keyframes en-letter-appear {
    0% {
        transform: translateY(-40px) scale(1.2);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 100% center;
    }
}

@keyframes letter-scale {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.2);
    }
}

@keyframes glow-pulse {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 0;
    }
}

@keyframes en-underline-animate {
    0% {
        width: 0%;
        transform: translateX(-20%);
    }

    25% {
        width: 120%;
        transform: translateX(10%);
    }

    50% {
        width: 120%;
        transform: translateX(-10%);
    }

    75% {
        width: 120%;
        transform: translateX(0%);
    }

    100% {
        width: 0%;
        transform: translateX(20%);
    }
}

@keyframes message-fade {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Set random directions for particles */
.p1 {
    --x: 0.8;
    --y: -0.6;
}

.p2 {
    --x: -0.9;
    --y: -0.4;
}

.p3 {
    --x: 0.5;
    --y: 0.8;
}

.p4 {
    --x: -0.3;
    --y: 0.7;
}

.p5 {
    --x: -0.8;
    --y: -0.8;
}

.p6 {
    --x: 0.7;
    --y: 0.3;
}

.p7 {
    --x: -0.5;
    --y: -0.5;
}

.p8 {
    --x: 0.3;
    --y: -0.8;
}

.p9 {
    --x: -0.7;
    --y: 0.5;
}

.p10 {
    --x: 0.6;
    --y: 0.6;
}

.p11 {
    --x: -0.4;
    --y: 0.9;
}

.p12 {
    --x: 0.9;
    --y: -0.3;
}

.p13 {
    --x: -0.6;
    --y: -0.7;
}

.p14 {
    --x: 0.4;
    --y: 0.4;
}

.p15 {
    --x: -0.2;
    --y: -0.9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-animation-container {
        width: 10rem;
        height: 10rem;
    }

    .loader-logo {
        width: 6rem;
        height: 6rem;
    }

    .ar-letter {
        font-size: 1.5rem;
    }

    .en-letter {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .logo-animation-container {
        width: 8rem;
        height: 8rem;
    }

    .loader-logo {
        width: 5rem;
        height: 5rem;
    }

    .ar-letter {
        font-size: 1.25rem;
    }

    .en-letter {
        font-size: 1.5rem;
    }
}
