/* ===== LOADING & SKELETON UTILITIES ===== */

/* Shimmer Animation */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== SKELETON BASE ===== */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-dark {
    background: linear-gradient(90deg, rgba(162, 89, 255, 0.08) 25%, rgba(162, 89, 255, 0.15) 50%, rgba(162, 89, 255, 0.08) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* ===== SKELETON SHAPES ===== */
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.lg {
    height: 20px;
}

.skeleton-text.sm {
    height: 10px;
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-25 { width: 25%; }
.skeleton-text.w-100 { width: 100%; }

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-rect {
    border-radius: 8px;
}

.skeleton-badge {
    height: 24px;
    width: 80px;
    border-radius: 100px;
}

/* ===== SKELETON GRID ===== */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1200px) {
    .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .skeleton-grid { grid-template-columns: 1fr; }
}

/* ===== PROGRESS BAR ===== */
.loading-progress {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-purple, #a259ff), var(--neon-cyan, #00f3ff));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.loading-progress-fill.animated {
    animation: progressFill 8s ease-in-out forwards;
}

/* ===== LOADING DOTS ===== */
.loading-dots-container {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 1rem 0;
}

.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--neon-cyan, #00f3ff);
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

/* ===== SPINNER ===== */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.loading-spinner.sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

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

.loading-spinner.white {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== FADE IN UTILITY ===== */
.fade-in {
    animation: fadeIn 0.4s ease;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease;
}

/* ===== TRANSITION OVERLAY ===== */
.content-loading {
    position: relative;
    pointer-events: none;
}

.content-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    border-radius: inherit;
    z-index: 10;
}

/* ===== BUTTON LOADING STATE ===== */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
