/**
 * Loading Skeletons & Animations
 * Provides smooth loading states for NFT cards and dashboard
 */

/* Skeleton Card */
.skeleton-card {
    background: rgba(124, 58, 237, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(124, 58, 237, 0.2);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Skeleton Elements */
.skeleton {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 1rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 70%;
    margin-bottom: 0.75rem;
}

.skeleton-text {
    height: 1rem;
    width: 50%;
    margin-bottom: 0.5rem;
}

.skeleton-button {
    height: 2.5rem;
    width: 100%;
    margin-top: 1rem;
}

/* Pulse Animation (Alternative) */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(124, 58, 237, 0.2);
    border-top-color: var(--light-purple);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.loading-container .loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Staggered Fade In for Cards */
.nft-card {
    animation: fadeIn 0.4s ease-out forwards;
}

.nft-card:nth-child(1) { animation-delay: 0.05s; }
.nft-card:nth-child(2) { animation-delay: 0.1s; }
.nft-card:nth-child(3) { animation-delay: 0.15s; }
.nft-card:nth-child(4) { animation-delay: 0.2s; }
.nft-card:nth-child(5) { animation-delay: 0.25s; }
.nft-card:nth-child(6) { animation-delay: 0.3s; }
.nft-card:nth-child(7) { animation-delay: 0.35s; }
.nft-card:nth-child(8) { animation-delay: 0.4s; }

/* Skeleton Grid */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
}
