/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Spinner */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #5865f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Loading Text */
.loading-text {
    color: white;
    font-size: 16px;
    margin-top: 16px;
    font-family: 'Alliance No.1', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Bitso themed spinner (alternative) */
.loading-spinner-bitso {
    width: 60px;
    height: 60px;
    position: relative;
}

.loading-spinner-bitso::before,
.loading-spinner-bitso::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.loading-spinner-bitso::before {
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, transparent, #00d4aa);
    animation: spin 1s linear infinite;
}

.loading-spinner-bitso::after {
    width: 80%;
    height: 80%;
    background: rgba(0, 0, 0, 0.9);
    top: 10%;
    left: 10%;
}

/* Dots loading animation */
.loading-dots {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: #5865f2;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Success checkmark animation */
.loading-success {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.3s ease;
}

.loading-success svg {
    width: 30px;
    height: 30px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.loading-success svg path {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: drawCheck 0.4s ease 0.2s forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* Error X animation */
.loading-error {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: shake 0.5s ease;
}

.loading-error svg {
    width: 30px;
    height: 30px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    fill: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
