/**
 * Styles frontend du preloader
 */

#dsp-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#dsp-preloader.dsp-hiding {
    opacity: 0;
    pointer-events: none;
}

#dsp-preloader.dsp-hidden {
    display: none;
}

#dsp-preloader .dsp-loader-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#dsp-preloader .dsp-text {
    margin-top: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-weight: 500;
    text-align: center;
}

/* Style Spinner */
.dsp-loader-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: dsp-spin 1s linear infinite;
}

.dsp-spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: dsp-spin 1s linear infinite;
}

@keyframes dsp-spin {
    to { transform: rotate(360deg); }
}

/* Style Dots */
.dsp-loader-dots {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.dsp-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: currentColor;
    animation: dsp-dot-bounce 1.4s ease-in-out infinite;
}

.dsp-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dsp-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.dsp-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dsp-dot-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Style Bars */
.dsp-loader-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 100%;
}

.dsp-bar {
    width: 8px;
    height: 100%;
    background-color: currentColor;
    animation: dsp-bar-stretch 1.2s ease-in-out infinite;
    border-radius: 2px;
}

.dsp-bar:nth-child(1) {
    animation-delay: -1.1s;
}

.dsp-bar:nth-child(2) {
    animation-delay: -1.0s;
}

.dsp-bar:nth-child(3) {
    animation-delay: -0.9s;
}

.dsp-bar:nth-child(4) {
    animation-delay: -0.8s;
}

@keyframes dsp-bar-stretch {
    0%, 40%, 100% {
        transform: scaleY(0.4);
        opacity: 0.7;
    }
    20% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Style Circle */
.dsp-circle {
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: dsp-circle-rotate 1s linear infinite;
}

@keyframes dsp-circle-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Style Pulse */
.dsp-pulse {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: currentColor;
    animation: dsp-pulse-scale 1.5s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes dsp-pulse-scale {
    0%, 100% {
        transform: scale(0);
        opacity: 0.6;
    }
    50% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Style Wave */
.dsp-loader-wave {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 100%;
}

.dsp-wave {
    width: 6px;
    height: 100%;
    background-color: currentColor;
    border-radius: 3px;
    animation: dsp-wave-animation 1.2s ease-in-out infinite;
}

.dsp-wave:nth-child(1) {
    animation-delay: -1.1s;
}

.dsp-wave:nth-child(2) {
    animation-delay: -1.0s;
}

.dsp-wave:nth-child(3) {
    animation-delay: -0.9s;
}

.dsp-wave:nth-child(4) {
    animation-delay: -0.8s;
}

.dsp-wave:nth-child(5) {
    animation-delay: -0.7s;
}

@keyframes dsp-wave-animation {
    0%, 40%, 100% {
        transform: scaleY(0.4);
        opacity: 0.7;
    }
    20% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Style Square */
.dsp-loader-square {
    display: flex;
    gap: 4px;
}

.dsp-square {
    width: 20px;
    height: 20px;
    background-color: currentColor;
    animation: dsp-square-bounce 1.4s ease-in-out infinite;
    border-radius: 2px;
}

.dsp-square:nth-child(1) {
    animation-delay: -0.32s;
}

.dsp-square:nth-child(2) {
    animation-delay: -0.16s;
}

.dsp-square:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dsp-square-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Style Ring */
.dsp-ring {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    position: relative;
    animation: dsp-ring-rotate 1s linear infinite;
}

.dsp-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    opacity: 0.5;
    animation: dsp-ring-rotate 1.5s linear infinite reverse;
}

@keyframes dsp-ring-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Adjustments for different styles */
.dsp-loader-dots,
.dsp-loader-bars,
.dsp-loader-wave,
.dsp-loader-square {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Preview mode */
.dsp-preview-mode {
    position: relative;
    height: 400px;
}

