.loading-spinner {
    display: inline-block;
}

.loading-spinner.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    background: rgba(6, 13, 26, 0.65);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.spinner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px -26px rgba(15, 34, 61, 0.75);
    border: 1px solid rgba(47, 92, 155, 0.25);
}

.loading-text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Size variations */
.loading-small .spinner-border {
    width: 1rem;
    height: 1rem;
}

.loading-small .loading-text {
    font-size: 0.8rem;
}

.loading-medium .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

.loading-large .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

.loading-large .loading-text {
    font-size: 1.1rem;
}

.spinner-border-lg {
    width: 3rem !important;
    height: 3rem !important;
}

/* Animation improvements */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Overlay entrance animation */
.loading-spinner.overlay {
    animation: fadeInOverlay 0.2s ease-out;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(2px);
    }
}

.spinner-content {
    animation: slideInContent 0.3s ease-out;
}

@keyframes slideInContent {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .loading-spinner.overlay {
        background: rgba(0, 0, 0, 0.85);
    }

    .spinner-content {
        background: var(--navy-900);
        color: #ffffff;
        border-color: rgba(91, 125, 176, 0.45);
    }

    .loading-text {
        color: rgba(255, 255, 255, 0.75);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .spinner-border {
        animation: none;
        border-left-color: transparent;
    }

    .loading-spinner.overlay,
    .spinner-content {
        animation: none;
    }
}
