/**
 * WP Preloader v2.1.0 – Frontend & Admin Styles
 */

/* =============================================
   PRELOADER OVERLAY
   ============================================= */
#wpp-preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a2e;
    transition: opacity var(--wpp-fade-duration, 600ms) ease,
                visibility var(--wpp-fade-duration, 600ms) ease,
                transform var(--wpp-fade-duration, 600ms) ease;
}

#wpp-preloader.wpp-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Exit: slide up */
#wpp-preloader.wpp-exit-slide-up.wpp-hidden {
    transform: translateY(-100%);
    opacity: 1;
}

/* Exit: zoom out */
#wpp-preloader.wpp-exit-zoom-out.wpp-hidden {
    transform: scale(1.2);
    opacity: 0;
}

/* Exit: fade (default) */
#wpp-preloader.wpp-exit-fade.wpp-hidden {
    opacity: 0;
}

/* ── INNER ── */
#wpp-preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* ── LOGO ── */
#wpp-logo { margin-bottom: 4px; }
#wpp-logo img { display: block; height: auto; }

/* ── LOADING TEXT ── */
#wpp-loading-text {
    color: var(--wpp-text-color, #ffffff);
    font-size: var(--wpp-text-size, 16px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    letter-spacing: 0.08em;
    opacity: 0.75;
    animation: wpp-text-pulse 2s ease-in-out infinite;
}

@keyframes wpp-text-pulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1.0; }
}

/* ── PROGRESS BAR ── */
#wpp-progress-bar {
    position: absolute;
    left: 0; right: 0;
    height: var(--wpp-progress-height, 3px);
    background: rgba(255,255,255,0.1);
    z-index: 2;
}
#wpp-progress-bar.wpp-progress-top    { top: 0; }
#wpp-progress-bar.wpp-progress-bottom { bottom: 0; }

#wpp-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--wpp-progress-color, #6366f1);
    border-radius: 0 2px 2px 0;
    animation: wpp-progress-run 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--wpp-progress-color, #6366f1);
}

@keyframes wpp-progress-run {
    0%   { width: 0%;   opacity: 1; }
    70%  { width: 85%;  opacity: 1; }
    90%  { width: 95%;  opacity: 0.8; }
    100% { width: 100%; opacity: 0; }
}

/* ── CUSTOM IMAGE ── */
#wpp-custom-image { max-width: 100%; height: auto; }

/* =============================================
   SPINNER BASE
   ============================================= */
.wpp-spinner {
    --wpp-spinner-color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* CIRCLE */
.wpp-spinner--circle { width: 56px; height: 56px; }
.wpp-spinner--circle span {
    display: block; width: 56px; height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.15);
    border-top-color: var(--wpp-spinner-color);
    animation: wpp-circle-spin 0.85s linear infinite;
}
@keyframes wpp-circle-spin { to { transform: rotate(360deg); } }

/* RING */
.wpp-spinner--ring { width: 56px; height: 56px; position: relative; }
.wpp-spinner--ring span {
    display: block; position: absolute;
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--wpp-spinner-color);
    border-bottom-color: var(--wpp-spinner-color);
    animation: wpp-ring-spin 1.1s ease-in-out infinite;
}
@keyframes wpp-ring-spin { to { transform: rotate(360deg); } }

/* DOTS */
.wpp-spinner--dots { gap: 10px; }
.wpp-spinner--dots span {
    display: block; width: 14px; height: 14px;
    border-radius: 50%;
    background-color: var(--wpp-spinner-color);
    animation: wpp-dots-bounce 1.2s ease-in-out infinite;
}
.wpp-spinner--dots span:nth-child(1) { animation-delay: -0.32s; }
.wpp-spinner--dots span:nth-child(2) { animation-delay: -0.16s; }
.wpp-spinner--dots span:nth-child(3) { animation-delay: 0s; }
@keyframes wpp-dots-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1.0); opacity: 1.0; }
}

/* BARS */
.wpp-spinner--bars { gap: 5px; height: 48px; align-items: flex-end; }
.wpp-spinner--bars span {
    display: block; width: 8px; height: 32px;
    background-color: var(--wpp-spinner-color);
    border-radius: 4px;
    animation: wpp-bars-wave 1.1s ease-in-out infinite;
}
.wpp-spinner--bars span:nth-child(1) { animation-delay: -0.4s; }
.wpp-spinner--bars span:nth-child(2) { animation-delay: -0.2s; }
.wpp-spinner--bars span:nth-child(3) { animation-delay:  0.0s; }
.wpp-spinner--bars span:nth-child(4) { animation-delay:  0.2s; }
@keyframes wpp-bars-wave {
    0%, 40%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    20%           { transform: scaleY(1.0); opacity: 1.0; }
}

/* PULSE */
.wpp-spinner--pulse { position: relative; width: 56px; height: 56px; }
.wpp-spinner--pulse span {
    display: block; position: absolute; inset: 0;
    border-radius: 50%;
    background-color: var(--wpp-spinner-color);
    opacity: 0.6;
    animation: wpp-pulse-ripple 1.6s ease-out infinite;
}
.wpp-spinner--pulse span:nth-child(2) { animation-delay: -0.8s; }
@keyframes wpp-pulse-ripple {
    0%   { transform: scale(0);   opacity: 0.7; }
    100% { transform: scale(1.4); opacity: 0;   }
}

/* BOUNCE — NEW */
.wpp-spinner--bounce { width: 56px; height: 56px; position: relative; }
.wpp-spinner--bounce span {
    display: block; width: 24px; height: 24px;
    border-radius: 50%;
    background-color: var(--wpp-spinner-color);
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    animation: wpp-bounce-ball 1.1s cubic-bezier(0.45,0.05,0.55,0.95) infinite alternate;
    box-shadow: 0 0 10px var(--wpp-spinner-color);
}
@keyframes wpp-bounce-ball {
    0%   { top: 0;    transform: translateX(-50%) scale(1,1); }
    100% { top: 34px; transform: translateX(-50%) scale(1.2,0.85); }
}
.wpp-spinner--bounce::after {
    content: '';
    display: block; width: 24px; height: 6px;
    border-radius: 50%; background: rgba(0,0,0,0.2);
    position: absolute; bottom: 0; left: 50%;
    animation: wpp-bounce-shadow 1.1s cubic-bezier(0.45,0.05,0.55,0.95) infinite alternate;
}
@keyframes wpp-bounce-shadow {
    0%   { transform: translateX(-50%) scale(0.5); opacity: 0.2; }
    100% { transform: translateX(-50%) scale(1);   opacity: 0.5; }
}

/* SPIRAL — NEW */
.wpp-spinner--spiral { width: 56px; height: 56px; position: relative; }
.wpp-spinner--spiral span {
    display: block; width: 56px; height: 56px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--wpp-spinner-color);
    position: absolute; top: 0; left: 0;
    animation: wpp-spiral-spin 1.0s linear infinite;
}
.wpp-spinner--spiral::after {
    content: '';
    display: block; width: 36px; height: 36px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--wpp-spinner-color);
    position: absolute; top: 6px; left: 6px;
    animation: wpp-spiral-spin 0.6s linear infinite reverse;
    opacity: 0.6;
}
@keyframes wpp-spiral-spin { to { transform: rotate(360deg); } }

/* FLIP — NEW */
.wpp-spinner--flip { width: 40px; height: 40px; perspective: 120px; }
.wpp-spinner--flip span {
    display: block; width: 100%; height: 100%;
    background-color: var(--wpp-spinner-color);
    border-radius: 4px;
    animation: wpp-flip-card 1.2s ease-in-out infinite;
}
@keyframes wpp-flip-card {
    0%   { transform: perspective(120px) rotateX(0deg) rotateY(0deg); }
    50%  { transform: perspective(120px) rotateX(-180deg) rotateY(0deg); }
    100% { transform: perspective(120px) rotateX(-180deg) rotateY(-180deg); }
}

/* CLOCK — NEW */
.wpp-spinner--clock {
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 3px solid var(--wpp-spinner-color);
    position: relative;
}
.wpp-spinner--clock span:nth-child(1) {
    display: block; width: 2px; height: 18px;
    background: var(--wpp-spinner-color);
    position: absolute; top: 8px; left: 50%;
    transform-origin: bottom center; margin-left: -1px;
    border-radius: 2px;
    animation: wpp-clock-hand 6s linear infinite;
}
.wpp-spinner--clock span:nth-child(2) {
    display: block; width: 2px; height: 22px;
    background: var(--wpp-spinner-color);
    position: absolute; top: 5px; left: 50%;
    transform-origin: bottom center; margin-left: -1px;
    border-radius: 2px;
    animation: wpp-clock-hand 1.5s linear infinite;
    opacity: 0.7;
}
@keyframes wpp-clock-hand { to { transform: rotate(360deg); } }

/* HEARTBEAT — NEW */
.wpp-spinner--heartbeat {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
}
.wpp-spinner--heartbeat span {
    display: block; font-size: 40px; line-height: 1;
    animation: wpp-heartbeat 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px var(--wpp-spinner-color));
}
.wpp-spinner--heartbeat span::before {
    content: '\2665';
    color: var(--wpp-spinner-color);
}
@keyframes wpp-heartbeat {
    0%  { transform: scale(1.0); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1.0); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1.0); }
}

/* ADMIN PREVIEW */
#wpp-preview-spinner { /* inherits .wpp-spinner */ }
