/**
 * loadX - Loading State Styles
 * @version 1.0.0
 *
 * CSS animations and styles for loading strategies
 */

/* ============================================================================
   SPINNER WRAPPER
   ============================================================================ */

.lx-spinner-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lx-loading {
    position: relative;
}

/* ============================================================================
   CIRCLE SPINNER
   ============================================================================ */

.lx-spinner-circle {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: lx-spin 0.8s linear infinite;
}

.lx-spinner-circle.lx-spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.lx-spinner-circle.lx-spinner-medium {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.lx-spinner-circle.lx-spinner-large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

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

/* ============================================================================
   DOTS SPINNER
   ============================================================================ */

.lx-spinner-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lx-spinner-dot {
    background-color: #3498db;
    border-radius: 50%;
    animation: lx-bounce 1.4s ease-in-out infinite;
}

.lx-spinner-dots.lx-spinner-small .lx-spinner-dot {
    width: 6px;
    height: 6px;
}

.lx-spinner-dots.lx-spinner-medium .lx-spinner-dot {
    width: 10px;
    height: 10px;
}

.lx-spinner-dots.lx-spinner-large .lx-spinner-dot {
    width: 14px;
    height: 14px;
}

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

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

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

/* ============================================================================
   BARS SPINNER
   ============================================================================ */

.lx-spinner-bars {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lx-spinner-bar {
    background-color: #3498db;
    animation: lx-scale 1.2s ease-in-out infinite;
}

.lx-spinner-bars.lx-spinner-small .lx-spinner-bar {
    width: 3px;
    height: 16px;
}

.lx-spinner-bars.lx-spinner-medium .lx-spinner-bar {
    width: 4px;
    height: 24px;
}

.lx-spinner-bars.lx-spinner-large .lx-spinner-bar {
    width: 6px;
    height: 36px;
}

.lx-spinner-bar:nth-child(1) {
    animation-delay: -0.24s;
}

.lx-spinner-bar:nth-child(2) {
    animation-delay: -0.12s;
}

@keyframes lx-scale {
    0%, 40%, 100% {
        transform: scaleY(0.4);
        opacity: 0.5;
    }
    20% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* ============================================================================
   STATIC LOADING INDICATOR (Reduced Motion)
   ============================================================================ */

.lx-loading-static {
    color: #3498db;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.lx-loading-static.lx-spinner-small {
    font-size: 12px;
}

.lx-loading-static.lx-spinner-large {
    font-size: 16px;
}

/* ============================================================================
   REDUCED MOTION SUPPORT
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .lx-spinner-circle,
    .lx-spinner-dot,
    .lx-spinner-bar {
        animation: none;
    }

    .lx-spinner-circle {
        border-top-color: transparent;
        opacity: 0.6;
    }

    .lx-spinner-dot,
    .lx-spinner-bar {
        opacity: 0.6;
    }
}

/* ============================================================================
   SKELETON LOADER (Phase 2.2)
   ============================================================================ */

.lx-skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: lx-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.lx-skeleton-text {
    height: 12px;
    margin-bottom: 8px;
}

.lx-skeleton-heading {
    height: 24px;
    margin-bottom: 12px;
}

.lx-skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.lx-skeleton-image {
    width: 100%;
    height: 200px;
}

@keyframes lx-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lx-skeleton {
        animation: none;
        background: #e0e0e0;
    }
}

/* ============================================================================
   PROGRESS BAR (Phase 2.3)
   ============================================================================ */

.lx-progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.lx-progress-fill {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.lx-progress-indeterminate .lx-progress-fill {
    width: 30%;
    animation: lx-progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes lx-progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lx-progress-fill {
        transition: none;
    }

    .lx-progress-indeterminate .lx-progress-fill {
        animation: none;
        width: 100%;
        transform: translateX(0);
    }
}

/* ============================================================================
   FADE TRANSITION (Phase 2.4)
   ============================================================================ */

.lx-fade-enter {
    opacity: 0;
}

.lx-fade-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

.lx-fade-exit {
    opacity: 1;
}

.lx-fade-exit-active {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .lx-fade-enter-active,
    .lx-fade-exit-active {
        transition: none;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.ax-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
