/* Knox Wire Harness Custom Loading Animation */

.knox-loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.5rem;
}

/* Wire Harness inspired loading animation */
.knox-loader {
    position: relative;
    width: 80px;
    height: 80px;
}

/* Three rotating wires/cables */
.knox-wire {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-radius: 50%;
    animation: wireRotate 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.knox-wire:nth-child(1) {
    border-top-color: #54B4DB;
    animation-delay: -0.45s;
}

.knox-wire:nth-child(2) {
    border-top-color: #24548B;
    animation-delay: -0.3s;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
}

.knox-wire:nth-child(3) {
    border-top-color: #A1B4B6;
    animation-delay: -0.15s;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
}

@keyframes wireRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Pulsing center dot (connector point) */
.knox-connector {
    position: absolute;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #54B4DB, #24548B);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: connectorPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(84, 180, 219, 0.5);
}

@keyframes connectorPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.7;
    }
}

/* Loading text with gradient */
.knox-loading-text {
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(90deg, #54B4DB, #24548B, #54B4DB);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 2s ease-in-out infinite;
    letter-spacing: 0.5px;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

/* Alternative: Simpler spinner that matches existing theme */
.spinner-themed {
    border: 4px solid rgba(84, 180, 219, 0.2);
    border-top-color: #54B4DB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .knox-wire:nth-child(1) {
        border-top-color: #6fbde8;
    }
    
    .knox-wire:nth-child(2) {
        border-top-color: #54B4DB;
    }
    
    .knox-connector {
        background: linear-gradient(135deg, #6fbde8, #54B4DB);
        box-shadow: 0 0 16px rgba(111, 189, 232, 0.6);
    }
    
    .knox-loading-text {
        background: linear-gradient(90deg, #6fbde8, #54B4DB, #6fbde8);
        background-size: 200% auto;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .spinner-themed {
        border: 4px solid rgba(111, 189, 232, 0.2);
        border-top-color: #6fbde8;
    }
}

/* Page-level loading overlay (full screen) */
.knox-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(237, 240, 240, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

@media (prefers-color-scheme: dark) {
    .knox-loading-overlay {
        background: rgba(26, 32, 44, 0.95);
    }
}

/* Small inline loader for buttons */
.knox-loader-sm {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(84, 180, 219, 0.3);
    border-top-color: #54B4DB;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@media (prefers-color-scheme: dark) {
    .knox-loader-sm {
        border: 3px solid rgba(111, 189, 232, 0.3);
        border-top-color: #6fbde8;
    }
}
