/* ============================================
   iTechOps Global Loader
   Namespace: #itechops-global-loader, .ito-loader-*
   This file is self-contained and does NOT
   affect any existing styles or elements.
   ============================================ */

/* --- Full-screen overlay --- */
#itechops-global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647; /* Max safe z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* Hidden state */
#itechops-global-loader.ito-loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- Centre container --- */
.ito-loader-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

/* --- Logo wrapper with ring --- */
.ito-loader-logo-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinning ring around the logo */
.ito-loader-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #7ec8e3;
    border-right-color: #f8b4c8;
    border-bottom-color: #b5e6a3;
    border-left-color: #f5c78e;
    animation: ito-ring-spin 1.4s cubic-bezier(0.68, -0.15, 0.27, 1.15) infinite;
}

/* Second ring — counter-rotate for depth */
.ito-loader-ring-inner {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(126, 200, 227, 0.35);
    border-bottom-color: rgba(181, 230, 163, 0.35);
    animation: ito-ring-spin-reverse 1.8s linear infinite;
}

/* Logo image */
.ito-loader-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
    animation: ito-logo-pulse 1.6s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

/* --- Loading dots --- */
.ito-loader-dots {
    display: flex;
    align-items: center;
    gap: 7px;
}

.ito-loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7ec8e3;
    opacity: 0.4;
    animation: ito-dot-bounce 1.2s ease-in-out infinite;
}

.ito-loader-dot:nth-child(1) {
    background: #f5c78e;
    animation-delay: 0s;
}

.ito-loader-dot:nth-child(2) {
    background: #7ec8e3;
    animation-delay: 0.2s;
}

.ito-loader-dot:nth-child(3) {
    background: #f8b4c8;
    animation-delay: 0.4s;
}

.ito-loader-dot:nth-child(4) {
    background: #b5e6a3;
    animation-delay: 0.6s;
}

/* ============================================
   Keyframes
   ============================================ */

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

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

@keyframes ito-logo-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

@keyframes ito-dot-bounce {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 576px) {
    .ito-loader-logo-wrap {
        width: 76px;
        height: 76px;
    }
    .ito-loader-ring {
        width: 96px;
        height: 96px;
        top: -10px;
        left: -10px;
    }
    .ito-loader-ring-inner {
        width: 80px;
        height: 80px;
        top: -2px;
        left: -2px;
    }
    .ito-loader-logo {
        width: 52px;
        height: 52px;
    }
    .ito-loader-dot {
        width: 6px;
        height: 6px;
    }
}
