/**
 * BrightAster Website
 *
 * @file loader.css
 * @description Reusable styles for the global loader.
 * @version 2.4 (Final Enhanced Design)
 */

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(6, 6, 6, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loader-container {
    position: relative;
    width: 90px; /* Increased size */
    height: 90px; /* Increased size */
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-circle {
    width: 70px; /* Increased size */
    height: 70px; /* Increased size */
    background: radial-gradient(circle, var(--secondary-color) 0%, var(--bg-color) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    position: relative;
    z-index: 2; /* Keep circle on top */
}

.loader-icon {
    width: 40px; /* Increased size */
    height: 40px; /* Increased size */
}

/* Base style for the spinning arcs */
.loader-ring-arc {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    animation: spin 1.5s linear infinite;
    z-index: 1; /* Rings are behind the circle */
}

/* Arc 1 (Top-Right) */
.loader-ring-arc:nth-child(1) {
    border-top-color: var(--accent-color);
    border-right-color: var(--accent-color);
    clip-path: polygon(50% 0, 100% 0, 100% 50%, 50% 50%);
}

/* Arc 2 (Bottom-Left) */
.loader-ring-arc:nth-child(2) {
    border-bottom-color: var(--accent-secondary-color);
    border-left-color: var(--accent-secondary-color);
    clip-path: polygon(0 50%, 50% 50%, 50% 100%, 0 100%);
}

/* Arc 3 (Top-Left) - Slower animation */
.loader-ring-arc:nth-child(3) {
    border-top-color: var(--accent-secondary-color);
    border-left-color: var(--accent-secondary-color);
    clip-path: polygon(0 0, 50% 0, 50% 50%, 0 50%);
    animation-duration: 2s; /* Slower spin */
}

/* Arc 4 (Bottom-Right) - Slower animation */
.loader-ring-arc:nth-child(4) {
    border-bottom-color: var(--accent-color);
    border-right-color: var(--accent-color);
    clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%);
    animation-duration: 2s; /* Slower spin */
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
