/* ==========================================================================
   IBCT Page Preloader — Preloader Animations & Frontend Overlay
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --ibct-spinner-color: #1e88e5;
}

/* ---------- Overlay ---------- */
#ibct-preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    opacity: 1;
    transition: opacity 0.3s ease;
    will-change: opacity, transform;
}

#ibct-preloader-overlay.ibct-preloader-visible {
    opacity: 1;
}

.ibct-preloader-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ibct-custom-preloader-img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

/* ---------- SVG Preloader ---------- */
.ibct-svg-preloader-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    color: var(--ibct-spinner-color);
    will-change: transform, opacity;
}

.ibct-svg-preloader-wrap.ibct-spin {
    animation: ibct-spin 1.2s linear infinite;
}

.ibct-svg-preloader-wrap svg {
    width: 100% !important;
    height: 100% !important;
    fill: currentColor;
    display: block;
    object-fit: contain;
}

/* ---------- Transition Classes ---------- */
.ibct-transition-fade-out {
    opacity: 0 !important;
}

.ibct-transition-slide-up {
    transform: translateY(-100%);
    opacity: 0 !important;
}

.ibct-transition-slide-down {
    transform: translateY(100%);
    opacity: 0 !important;
}

.ibct-transition-slide-left {
    transform: translateX(-100%);
    opacity: 0 !important;
}

.ibct-transition-slide-right {
    transform: translateX(100%);
    opacity: 0 !important;
}

.ibct-preloader-hiding {
    pointer-events: none !important;
    transition-property: opacity, transform !important;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ---------- Base Loader ---------- */
.ibct-loader {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   LOADER 1 — Spinning Arc
   ========================================================================== */
.ibct-loader-1 {
    width: 48px;
    height: 48px;
}
.ibct-loader-1 .ibct-l-inner {
    width: 48px;
    height: 48px;
    border: 3px solid transparent;
    border-top-color: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-spin 0.8s linear infinite;
}

/* ==========================================================================
   LOADER 2 — Pulsing Dot
   ========================================================================== */
.ibct-loader-2 {
    width: 16px;
    height: 16px;
}
.ibct-loader-2 .ibct-l-inner {
    width: 16px;
    height: 16px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-pulse 1s ease-in-out infinite;
}

/* ==========================================================================
   LOADER 3 — Thick Arc
   ========================================================================== */
.ibct-loader-3 {
    width: 48px;
    height: 48px;
}
.ibct-loader-3 .ibct-l-inner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(0, 0, 0, 0.08);
    border-top-color: var(--ibct-spinner-color);
    border-right-color: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-spin 0.7s linear infinite;
}

/* ==========================================================================
   LOADER 4 — Ring Spinner
   ========================================================================== */
.ibct-loader-4 {
    width: 48px;
    height: 48px;
}
.ibct-loader-4 .ibct-l-inner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--ibct-spinner-color);
    border-left-color: var(--ibct-spinner-color);
    border-bottom-color: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-spin 0.9s linear infinite;
}

/* ==========================================================================
   LOADER 5 — Bouncing Dots
   ========================================================================== */
.ibct-loader-5 {
    gap: 6px;
}
.ibct-loader-5 .ibct-l-dot {
    width: 10px;
    height: 10px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-bounce-dot 0.6s ease-in-out infinite alternate;
}
.ibct-loader-5 .ibct-l-dot:nth-child(2) { animation-delay: 0.2s; }
.ibct-loader-5 .ibct-l-dot:nth-child(3) { animation-delay: 0.4s; }

/* ==========================================================================
   LOADER 6 — Progress Bar
   ========================================================================== */
.ibct-loader-6 {
    width: 80px;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    overflow: hidden;
}
.ibct-loader-6 .ibct-l-inner {
    width: 40%;
    height: 100%;
    background: var(--ibct-spinner-color);
    border-radius: 2px;
    animation: ibct-progress 1.2s ease-in-out infinite;
}

/* ==========================================================================
   LOADER 7 — Pulse Bars
   ========================================================================== */
.ibct-loader-7 {
    gap: 4px;
    height: 32px;
    align-items: center;
}
.ibct-loader-7 .ibct-l-bar {
    width: 6px;
    height: 20px;
    background: var(--ibct-spinner-color);
    border-radius: 3px;
    animation: ibct-pulse-bar 0.6s ease-in-out infinite alternate;
}
.ibct-loader-7 .ibct-l-bar:nth-child(2) { animation-delay: 0.2s; }
.ibct-loader-7 .ibct-l-bar:nth-child(3) { animation-delay: 0.4s; }

/* ==========================================================================
   LOADER 8 — Sliding Bars
   ========================================================================== */
.ibct-loader-8 {
    gap: 3px;
    height: 32px;
    align-items: center;
}
.ibct-loader-8 .ibct-l-bar {
    width: 8px;
    height: 28px;
    background: var(--ibct-spinner-color);
    border-radius: 2px;
    animation: ibct-slide-bar 0.7s ease-in-out infinite alternate;
}
.ibct-loader-8 .ibct-l-bar:nth-child(2) {
    animation-delay: 0.35s;
}

/* ==========================================================================
   LOADER 9 — Scaling Bars
   ========================================================================== */
.ibct-loader-9 {
    gap: 3px;
    height: 40px;
    align-items: center;
}
.ibct-loader-9 .ibct-l-bar {
    width: 5px;
    height: 24px;
    background: var(--ibct-spinner-color);
    border-radius: 2px;
    animation: ibct-scale-bar 0.8s ease-in-out infinite;
}
.ibct-loader-9 .ibct-l-bar:nth-child(1) { animation-delay: 0s; }
.ibct-loader-9 .ibct-l-bar:nth-child(2) { animation-delay: 0.15s; }
.ibct-loader-9 .ibct-l-bar:nth-child(3) { animation-delay: 0.3s; }

/* ==========================================================================
   LOADER 10 — Wave
   ========================================================================== */
.ibct-loader-10 {
    width: 60px;
    height: 20px;
}
.ibct-loader-10 .ibct-l-inner {
    width: 60px;
    height: 20px;
    border-bottom: 3px solid var(--ibct-spinner-color);
    animation: ibct-wave 1.2s ease-in-out infinite;
    border-radius: 0 0 50% 50%;
}

/* ==========================================================================
   LOADER 11 — Morphing Dots
   ========================================================================== */
.ibct-loader-11 {
    gap: 8px;
}
.ibct-loader-11 .ibct-l-dot {
    width: 12px;
    height: 12px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-morph 1s ease-in-out infinite;
}
.ibct-loader-11 .ibct-l-dot:nth-child(2) { animation-delay: 0.15s; }
.ibct-loader-11 .ibct-l-dot:nth-child(3) { animation-delay: 0.3s; }

/* ==========================================================================
   LOADER 12 — Equalizer
   ========================================================================== */
.ibct-loader-12 {
    gap: 3px;
    height: 32px;
    align-items: flex-end;
}
.ibct-loader-12 .ibct-l-bar {
    width: 5px;
    height: 16px;
    background: var(--ibct-spinner-color);
    border-radius: 2px;
    animation: ibct-equalizer 0.9s ease-in-out infinite;
}
.ibct-loader-12 .ibct-l-bar:nth-child(1) { animation-delay: 0s; }
.ibct-loader-12 .ibct-l-bar:nth-child(2) { animation-delay: 0.15s; }
.ibct-loader-12 .ibct-l-bar:nth-child(3) { animation-delay: 0.3s; }
.ibct-loader-12 .ibct-l-bar:nth-child(4) { animation-delay: 0.45s; }

/* ==========================================================================
   LOADER 13 — Tall Bars
   ========================================================================== */
.ibct-loader-13 {
    gap: 2px;
    height: 40px;
    align-items: center;
}
.ibct-loader-13 .ibct-l-bar {
    width: 4px;
    height: 20px;
    background: var(--ibct-spinner-color);
    border-radius: 2px;
    animation: ibct-tall-bar 1s ease-in-out infinite;
}
.ibct-loader-13 .ibct-l-bar:nth-child(1) { animation-delay: 0s; }
.ibct-loader-13 .ibct-l-bar:nth-child(2) { animation-delay: 0.1s; }
.ibct-loader-13 .ibct-l-bar:nth-child(3) { animation-delay: 0.2s; }
.ibct-loader-13 .ibct-l-bar:nth-child(4) { animation-delay: 0.3s; }
.ibct-loader-13 .ibct-l-bar:nth-child(5) { animation-delay: 0.4s; }

/* ==========================================================================
   LOADER 14 — Dotted Ring
   ========================================================================== */
.ibct-loader-14 {
    width: 48px;
    height: 48px;
}
.ibct-loader-14 .ibct-l-inner {
    width: 48px;
    height: 48px;
    border: 3px dotted var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-spin 1.5s linear infinite;
}

/* ==========================================================================
   LOADER 15 — Grid Dots (3×3)
   ========================================================================== */
.ibct-loader-15 {
    display: grid;
    grid-template-columns: repeat(3, 10px);
    gap: 6px;
}
.ibct-loader-15 .ibct-l-dot {
    width: 10px;
    height: 10px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-grid-dot 1.2s ease-in-out infinite;
}
.ibct-loader-15 .ibct-l-dot:nth-child(1) { animation-delay: 0s; }
.ibct-loader-15 .ibct-l-dot:nth-child(2) { animation-delay: 0.1s; }
.ibct-loader-15 .ibct-l-dot:nth-child(3) { animation-delay: 0.2s; }
.ibct-loader-15 .ibct-l-dot:nth-child(4) { animation-delay: 0.3s; }
.ibct-loader-15 .ibct-l-dot:nth-child(5) { animation-delay: 0.4s; }
.ibct-loader-15 .ibct-l-dot:nth-child(6) { animation-delay: 0.5s; }
.ibct-loader-15 .ibct-l-dot:nth-child(7) { animation-delay: 0.6s; }
.ibct-loader-15 .ibct-l-dot:nth-child(8) { animation-delay: 0.7s; }
.ibct-loader-15 .ibct-l-dot:nth-child(9) { animation-delay: 0.8s; }

/* ==========================================================================
   LOADER 16 — Ring Pulse
   ========================================================================== */
.ibct-loader-16 {
    width: 48px;
    height: 48px;
}
.ibct-loader-16 .ibct-l-inner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-ring-pulse 1.2s ease-in-out infinite;
}

/* ==========================================================================
   LOADER 17 — Target (concentric rings)
   ========================================================================== */
.ibct-loader-17 {
    width: 48px;
    height: 48px;
}
.ibct-loader-17 .ibct-l-inner {
    position: absolute;
    border: 2px solid var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-target 1.5s ease-in-out infinite;
}
.ibct-loader-17 .ibct-l-inner:first-child {
    width: 48px;
    height: 48px;
}
.ibct-loader-17 .ibct-l-inner-2 {
    width: 28px;
    height: 28px;
    animation-delay: 0.3s;
}

/* ==========================================================================
   LOADER 18 — Orbit Ring
   ========================================================================== */
.ibct-loader-18 {
    width: 48px;
    height: 48px;
}
.ibct-loader-18 .ibct-l-inner {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    position: absolute;
}
.ibct-loader-18 .ibct-l-dot {
    width: 10px;
    height: 10px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: 50%;
    margin-left: -5px;
    animation: ibct-orbit 1s linear infinite;
    transform-origin: 5px 29px;
}

/* ==========================================================================
   LOADER 19 — Dot Trail
   ========================================================================== */
.ibct-loader-19 {
    gap: 6px;
}
.ibct-loader-19 .ibct-l-dot {
    width: 10px;
    height: 10px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-dot-trail 1s ease-in-out infinite;
}
.ibct-loader-19 .ibct-l-dot:nth-child(1) { animation-delay: 0s; }
.ibct-loader-19 .ibct-l-dot:nth-child(2) { animation-delay: 0.15s; }
.ibct-loader-19 .ibct-l-dot:nth-child(3) { animation-delay: 0.3s; }
.ibct-loader-19 .ibct-l-dot:nth-child(4) { animation-delay: 0.45s; }

/* ==========================================================================
   LOADER 20 — Large Pulse Dot
   ========================================================================== */
.ibct-loader-20 {
    width: 30px;
    height: 30px;
}
.ibct-loader-20 .ibct-l-inner {
    width: 30px;
    height: 30px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-large-pulse 1.2s ease-in-out infinite;
}

/* ==========================================================================
   LOADER 21 — Dual Dots
   ========================================================================== */
.ibct-loader-21 {
    width: 48px;
    height: 20px;
    justify-content: space-between;
}
.ibct-loader-21 .ibct-l-dot {
    width: 14px;
    height: 14px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    animation: ibct-dual-dot 0.8s ease-in-out infinite alternate;
}
.ibct-loader-21 .ibct-l-dot:nth-child(2) {
    animation-delay: 0.4s;
}

/* ==========================================================================
   LOADER 22 — Large Orbit
   ========================================================================== */
.ibct-loader-22 {
    width: 48px;
    height: 48px;
}
.ibct-loader-22 .ibct-l-inner {
    width: 48px;
    height: 48px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    position: absolute;
    animation: ibct-spin-slow 3s linear infinite;
}
.ibct-loader-22 .ibct-l-dot {
    width: 14px;
    height: 14px;
    background: var(--ibct-spinner-color);
    border-radius: 50%;
    position: absolute;
    top: -7px;
    left: 50%;
    margin-left: -7px;
    animation: ibct-orbit-large 1.5s linear infinite;
    transform-origin: 7px 31px;
}

/* ==========================================================================
   LOADER 23 — Gear
   ========================================================================== */
.ibct-loader-23 {
    width: 44px;
    height: 44px;
}
.ibct-loader-23 .ibct-l-inner {
    width: 44px;
    height: 44px;
    position: relative;
    animation: ibct-spin 2s linear infinite;
}
.ibct-loader-23 .ibct-l-inner::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 32px;
    height: 32px;
    border: 4px solid var(--ibct-spinner-color);
    border-radius: 50%;
}
.ibct-loader-23 .ibct-l-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 10px;
    background: var(--ibct-spinner-color);
    border-radius: 2px;
    box-shadow:
        /* Gear teeth at 45° intervals */
        15px 4px 0 0 var(--ibct-spinner-color),
        19px 15px 0 0 var(--ibct-spinner-color),
        15px 26px 0 0 var(--ibct-spinner-color),
        0px 30px 0 0 var(--ibct-spinner-color),
        -15px 26px 0 0 var(--ibct-spinner-color),
        -19px 15px 0 0 var(--ibct-spinner-color),
        -15px 4px 0 0 var(--ibct-spinner-color);
}

/* ==========================================================================
   LOADER 24 — Grid Blocks (3×3)
   ========================================================================== */
.ibct-loader-24 {
    display: grid;
    grid-template-columns: repeat(3, 12px);
    gap: 4px;
}
.ibct-loader-24 .ibct-l-block {
    width: 12px;
    height: 12px;
    background: var(--ibct-spinner-color);
    border-radius: 2px;
    animation: ibct-grid-block 1.2s ease-in-out infinite;
}
.ibct-loader-24 .ibct-l-block:nth-child(1) { animation-delay: 0s; }
.ibct-loader-24 .ibct-l-block:nth-child(2) { animation-delay: 0.1s; }
.ibct-loader-24 .ibct-l-block:nth-child(3) { animation-delay: 0.2s; }
.ibct-loader-24 .ibct-l-block:nth-child(4) { animation-delay: 0.3s; }
.ibct-loader-24 .ibct-l-block:nth-child(5) { animation-delay: 0.4s; }
.ibct-loader-24 .ibct-l-block:nth-child(6) { animation-delay: 0.5s; }
.ibct-loader-24 .ibct-l-block:nth-child(7) { animation-delay: 0.6s; }
.ibct-loader-24 .ibct-l-block:nth-child(8) { animation-delay: 0.7s; }
.ibct-loader-24 .ibct-l-block:nth-child(9) { animation-delay: 0.8s; }


/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

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

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

@keyframes ibct-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.4; }
}

@keyframes ibct-bounce-dot {
    0% { transform: translateY(0); }
    100% { transform: translateY(-14px); }
}

@keyframes ibct-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

@keyframes ibct-pulse-bar {
    0% { transform: scaleY(0.6); }
    100% { transform: scaleY(1.4); }
}

@keyframes ibct-slide-bar {
    0% { transform: scaleY(0.4); }
    100% { transform: scaleY(1.2); }
}

@keyframes ibct-scale-bar {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.5); }
}

@keyframes ibct-wave {
    0%, 100% { transform: scaleX(1) scaleY(1); }
    50% { transform: scaleX(0.8) scaleY(0.5); }
}

@keyframes ibct-morph {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.3); opacity: 0.3; }
}

@keyframes ibct-equalizer {
    0%, 100% { height: 8px; }
    50% { height: 28px; }
}

@keyframes ibct-tall-bar {
    0%, 100% { height: 12px; }
    50% { height: 36px; }
}

@keyframes ibct-grid-dot {
    0%, 100% { opacity: 0.3; transform: scale(0.6); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes ibct-ring-pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

@keyframes ibct-target {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.6); opacity: 0.4; }
}

@keyframes ibct-orbit {
    to { transform: rotate(360deg); }
}

@keyframes ibct-orbit-large {
    to { transform: rotate(360deg); }
}

@keyframes ibct-dot-trail {
    0%, 100% { opacity: 0.2; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes ibct-large-pulse {
    0%, 100% { transform: scale(0.6); opacity: 0.5; }
    50% { transform: scale(1); opacity: 1; }
}

@keyframes ibct-dual-dot {
    0% { transform: translateX(0); }
    100% { transform: translateX(16px); }
}

@keyframes ibct-grid-block {
    0%, 100% { opacity: 0.2; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1); }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .ibct-loader * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
