/**
 * Consistent Loading Spinner Styles
 * Used across the entire application for loading states
 */

/* Base Spinner */
.tk-spinner {
    display: inline-block;
    border-radius: 50%;
    border-style: solid;
    border-color: #f3f3f3;
    border-top-color: #ee450f;
    animation: tk-spin 0.8s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

/* Inline Spinner (for buttons) */
.tk-spinner-inline {
    margin-right: 8px;
}

/* Sizes */
.tk-spinner-xs {
    width: 12px;
    height: 12px;
    border-width: 2px;
}

.tk-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.tk-spinner-md {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.tk-spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.tk-spinner-xl {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

/* Colors */
.tk-spinner-primary {
    border-color: #f3f3f3;
    border-top-color: #ee450f;
}

.tk-spinner-white {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
}

.tk-spinner-dark {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #353648;
}

.tk-spinner-gray {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #999999;
}

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

/* Legacy fa-spin support - map to new animation */
.fa-spin {
    animation: tk-spin 0.8s linear infinite;
}

/* Preloader Container Styles */
.preloader-outer {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsla(0, 0%, 100%, 0.7);
}

.tk-preloader {
    width: 60px;
    height: 60px;
    display: flex;
    border-radius: 50%;
    background: #fff;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.08), 0px 20px 32px rgba(0, 0, 0, 0.12);
}

.tk-preloader .tk-spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
}

/* Section Preloader */
.tk-section-preloader-outer {
    position: relative;
}

.tk-section-preloader-outer .preloader-outer {
    position: absolute;
    background: hsla(0, 0%, 100%, 0.8);
}

/* Button Loading State */
.tk-btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.tk-btn-loading .tk-spinner {
    margin-right: 8px;
}

/* Hide text when loading for icon-only buttons */
.tk-btn-loading-icon-only .tk-btn-text {
    visibility: hidden;
}

.tk-btn-loading-icon-only .tk-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}
