/* ===== SKELETON LOADERS - SHIMMER EFFECT ===== */

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

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--color-white) 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #fffdfd 25%, #3a3a3a 50%, #2a2a2a 75%);
    }
}

/* ===== INLINE SKELETONS (Shown on Load) ===== */

/* 1. Map Skeleton */
.skeleton-inline-map {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 120px;
    /* Approximate distance between nodes */
    padding-top: 96px;
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.skeleton-node {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    /* Subtle white */
}

/* Zig-zag simulation for map nodes */
.skeleton-node:nth-child(odd) {
    transform: translateX(-48px);
}

.skeleton-node:nth-child(even) {
    transform: translateX(48px);
}


/* 2. Rank Skeleton */
.skeleton-inline-rank {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    /* Keep skeleton behind nav bar during transitions */
    position: relative;
    z-index: 1;
}

.skeleton-podium-inline {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin: 2rem 0;
    height: 200px;
}

.skeleton-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.skeleton-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.skeleton-avatar-sm {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.skeleton-base-1 {
    width: 80px;
    height: 120px;
    border-radius: 8px 8px 0 0;
}

.skeleton-base-2 {
    width: 60px;
    height: 80px;
    border-radius: 8px 8px 0 0;
}

.skeleton-base-3 {
    width: 60px;
    height: 60px;
    border-radius: 8px 8px 0 0;
}

.skeleton-rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-rank-row {
    height: 60px;
    border-radius: 12px;
    width: 100%;
}

/* 3. Clan Skeleton */
.skeleton-inline-clan {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.skeleton-inline-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 2rem;
}

.skeleton-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.skeleton-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.skeleton-stat-box {
    height: 100px;
    border-radius: 16px;
}

/* 4. General Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s var(--sc-motion-apple, cubic-bezier(0.4, 0, 0.2, 1)) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== ADMIN SKELETON LOADERS ===== */

/* Admin Table Skeleton */
.skeleton-inline-admin {
    width: 100%;
    padding: 1rem;
}

.skeleton-admin-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.skeleton-metric-card {
    height: 100px;
    border-radius: 20px;
}

.skeleton-admin-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.skeleton-filter-box {
    height: 40px;
    border-radius: var(--sc-ui-radius, 12px);
    flex: 1;
    max-width: 200px;
}

.skeleton-admin-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-table-header {
    height: 48px;
    border-radius: 12px;
    opacity: 0.5;
}

.skeleton-table-row {
    height: 72px;
    border-radius: 16px;
}

/* Admin Calendar Skeleton */
.skeleton-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.skeleton-view-toggle {
    height: 44px;
    width: 160px;
    border-radius: 12px;
}

.skeleton-nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skeleton-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.skeleton-month-label {
    width: 140px;
    height: 24px;
    border-radius: 8px;
}

.skeleton-dropdown {
    width: 180px;
    height: 44px;
    border-radius: 12px;
}

.skeleton-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.skeleton-calendar-cell {
    height: 100px;
    border-radius: 12px;
}

/* Smooth content reveal */
.admin-content-loaded {
    animation: contentReveal 0.3s var(--sc-motion-apple, cubic-bezier(0.4, 0, 0.2, 1)) forwards;
}

@keyframes contentReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Instant header/nav - No flash */
.top-header,
.bottom-nav-container,
.admin-tabs {
    opacity: 1 !important;
    visibility: visible !important;
}