/* assets/css/skeleton.css */

/* ===== SKELETON OVERLAY ===== */
/* KEY FIX: display block by default, hide when ready */
.skeleton-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    display: block; /* ✅ VISIBLE BY DEFAULT */
    overflow: hidden;
}

/* Page is ready - hide skeleton */
body.page-ready .skeleton-overlay {
    display: none;
}

/* ===== TOP LOADING BAR ===== */
.skeleton-topbar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #6c63ff, #3b82f6, #06b6d4);
    animation: topBarLoad 2s ease-in-out infinite;
    border-radius: 0 2px 2px 0;
    z-index: 100000;
}

@keyframes topBarLoad {
    0%   { width: 0%; opacity: 1; }
    20%  { width: 30%; }
    50%  { width: 60%; }
    80%  { width: 85%; }
    95%  { width: 95%; opacity: 1; }
    100% { width: 100%; opacity: 0; }
}

/* ===== SHIMMER EFFECT ===== */
.sk {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 6px;
}

.sk::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.7) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
    transform: translateX(-100%);
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* ===== NAV SKELETON ===== */
.sk-nav {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 28px;
    border-bottom: 1px solid #f0f0f0;
}

.sk-logo {
    width: 110px;
    height: 36px;
    border-radius: 8px;
    margin-right: auto;
}

.sk-nav-link {
    width: 64px;
    height: 12px;
    border-radius: 20px;
}

.sk-nav-btn {
    width: 90px;
    height: 34px;
    border-radius: 20px;
}

/* ===== HERO SKELETON ===== */
.sk-hero {
    width: 100%;
    height: 340px;
    border-radius: 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

/* ===== CONTENT CONTAINER ===== */
.sk-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ===== TEXT BLOCKS ===== */
.sk-heading {
    height: 28px;
    width: 45%;
    margin-bottom: 20px;
    border-radius: 8px;
}

.sk-text {
    height: 12px;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 20px;
}

.sk-text.w90 { width: 90%; }
.sk-text.w80 { width: 80%; }
.sk-text.w70 { width: 70%; }
.sk-text.w60 { width: 60%; }
.sk-text.w50 { width: 50%; }
.sk-text.w40 { width: 40%; }

/* ===== CARD GRID ===== */
.sk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.sk-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    background: #fff;
}

.sk-card-img {
    height: 170px;
    width: 100%;
    border-radius: 0;
    background: linear-gradient(135deg, #f3f3f3, #e6e6e6);
}

.sk-card-body {
    padding: 16px;
}

.sk-card-title {
    height: 16px;
    width: 70%;
    margin-bottom: 12px;
    border-radius: 20px;
}

.sk-card-desc {
    height: 10px;
    margin-bottom: 8px;
    border-radius: 20px;
}

.sk-card-desc.short { width: 55%; }

/* ===== AVATAR ROW ===== */
.sk-avatar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.sk-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sk-avatar-text { flex: 1; }

.sk-avatar-name {
    height: 14px;
    width: 120px;
    margin-bottom: 8px;
    border-radius: 20px;
}

.sk-avatar-sub {
    height: 10px;
    width: 80px;
    border-radius: 20px;
}

/* ===== SMOOTH FADE OUT ===== */
.skeleton-overlay.fade-out {
    animation: fadeOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeOut {
    0%   { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sk-nav-link { display: none; }
    .sk-hero { height: 220px; }
    .sk-heading { width: 70%; }
    .sk-grid { grid-template-columns: 1fr; }
}