/* ========== TIKTOK LOADING ANIMATION ========== */
.tiktok-loader {
    display: inline-flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.tiktok-loader-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.tiktok-loader-dot:nth-child(1) {
    background: #fe2c55;
    animation: tiktok-clockwise 1200ms infinite linear;
}

.tiktok-loader-dot:nth-child(2) {
    background: #00fff7;
    margin-left: -3px;
    animation: tiktok-counter-clockwise 1200ms infinite linear;
}

/* Success state */
.tiktok-loader.success .tiktok-loader-dot {
    animation: none;
    opacity: 0;
    transform: scale(0);
}

.tiktok-loader.success::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #00c851;
    border-radius: 50%;
    opacity: 1;
    animation: successPop 0.4s ease-out;
}

.tiktok-loader.success::before {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
    animation: successPop 0.4s ease-out 0.1s both;
}

@keyframes successPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes tiktok-clockwise {
    0% {
        transform: translateX(0);
        width: 12px;
    }
    25% {
        width: 15px;
    }
    50% {
        transform: translateX(100%);
        width: 12px;
    }
}

@keyframes tiktok-counter-clockwise {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-100%);
    }
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: rgba(50, 50, 50, 0.75);
    padding: 22px 22px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 0 20px;
    max-width: 90%;
}

.loading-content .tiktok-loader-dot {
    width: 20px;
    height: 20px;
}

.loading-content .tiktok-loader-dot:nth-child(1) {
    animation: tiktok-clockwise-large 1200ms infinite linear;
}

.loading-content .tiktok-loader-dot:nth-child(2) {
    margin-left: -5px;
    animation: tiktok-counter-clockwise-large 1200ms infinite linear;
}

/* Success state for loading content */
.loading-content .tiktok-loader.success .tiktok-loader-dot {
    animation: none;
    opacity: 0;
    transform: scale(0);
}

.loading-content .tiktok-loader.success::after {
    width: 24px;
    height: 24px;
}

.loading-content .tiktok-loader.success::before {
    font-size: 14px;
}

@keyframes tiktok-clockwise-large {
    0% {
        transform: translateX(0);
        width: 20px;
    }
    25% {
        width: 25px;
    }
    50% {
        transform: translateX(100%);
        width: 20px;
    }
}

@keyframes tiktok-counter-clockwise-large {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-100%);
    }
}

.loading-text {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    margin-top: 4px;
    text-align: center;
    line-height: 1.4;
}

/* Success icon for loading overlay */
/**
 * Smooth Success Checkmark - SVG Animation
 */
.success-checkmark {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    position: relative;
}

.checkmark {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4CAF50;
    stroke-miterlimit: 10;
    animation: fill 0.6s ease-in-out 0.6s forwards, scale 0.4s ease-in-out 1.4s both;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4CAF50;
    fill: none;
    animation: stroke 0.8s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 2;
    stroke: #FFFFFF;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: stroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) 1.2s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #4CAF50;
    }
}
