/* Spinner giống Bootstrap spinner-border */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(0, 0, 0, 0.1);
    border-right-color: #0d6efd; /* Màu primary */
    border-radius: 50%;
    animation: spinner-rotate 0.75s linear infinite;
}

/* Animation xoay */
@keyframes spinner-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Các màu khác nhau */
.spinner-primary {
    border-right-color: #0d6efd;
}

.spinner-success {
    border-right-color: #198754;
}

.spinner-danger {
    border-right-color: #dc3545;
}

.spinner-warning {
    border-right-color: #ffc107;
}

.spinner-info {
    border-right-color: #0dcaf0;
}

/* Kích thước khác nhau */
.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2rem;
}

.spinner-lg {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Ẩn text cho accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================== */
/* SPINNER KIỂU GROW (hiệu ứng phóng to thu nhỏ) */
/* ==================== */
.spinner-grow {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-color: #0d6efd;
    border-radius: 50%;
    opacity: 0;
    animation: spinner-grow 0.75s linear infinite;
}

@keyframes spinner-grow {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* ==================== */
/* SPINNER KIỂU DOTS (3 chấm) */
/* ==================== */
.spinner-dots {
    display: inline-flex;
    gap: 0.5rem;
}

.spinner-dots span {
    width: 0.5rem;
    height: 0.5rem;
    background-color: #0d6efd;
    border-radius: 50%;
    animation: spinner-dots-bounce 1.4s infinite ease-in-out both;
}

.spinner-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.spinner-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

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