/**
 * Skeleton Loader Styles & Component
 * Modern loading animations for JR Solutions
 */

/* Base Skeleton Styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Dark mode skeleton */
.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

/* Skeleton Text */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.small {
    height: 12px;
    width: 60%;
}

.skeleton-text.medium {
    height: 14px;
    width: 80%;
}

.skeleton-text.large {
    height: 20px;
    width: 70%;
}

/* Skeleton Product Card */
.skeleton-product-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.skeleton-image {
    width: 100%;
    height: 150px;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.skeleton-badge {
    width: 60px;
    height: 24px;
    border-radius: 9999px;
    margin-bottom: 12px;
}

.skeleton-title {
    height: 24px;
    width: 80%;
    margin-bottom: 8px;
}

.skeleton-description {
    height: 14px;
    width: 100%;
    margin-bottom: 6px;
}

.skeleton-price {
    height: 28px;
    width: 100px;
    margin-top: 12px;
}

.skeleton-button {
    height: 48px;
    width: 48px;
    border-radius: 12px;
    margin-top: 12px;
}

/* Skeleton Cart Item */
.skeleton-cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.skeleton-cart-image {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    flex-shrink: 0;
}

.skeleton-cart-info {
    flex: 1;
}

/* Skeleton Order Row */
.skeleton-order-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Skeleton Hero */
.skeleton-hero {
    height: 400px;
    border-radius: 2rem;
    margin-bottom: 2rem;
}

/* Pulse Animation Alternative */
.skeleton-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Page Loading Overlay */
.page-loader {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}