/* skeleton.css - Premium Skeleton Loader Styles */
.skeleton-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--primary-bg, #0f172a);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    padding: 30px 5%;
    box-sizing: border-box;
    overflow-y: auto;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.4s ease;
    opacity: 1;
    visibility: visible;
}

/* Light/Dark mode background adaptation based on theme variables */
body:not([data-theme="dark"]) .skeleton-loader-overlay,
html:not([data-theme="dark"]) .skeleton-loader-overlay {
    background-color: var(--bg-color, #f8fafc) !important;
}

.skeleton-loader-overlay.fade-out {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

/* Shimmer animation and base placeholder block */
.skeleton-shimmer {
    position: relative;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

body:not([data-theme="dark"]) .skeleton-shimmer,
html:not([data-theme="dark"]) .skeleton-shimmer {
    background-color: rgba(15, 23, 42, 0.05) !important;
}

.skeleton-shimmer::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.06) 20%,
        rgba(255, 255, 255, 0.12) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
    content: '';
}

body:not([data-theme="dark"]) .skeleton-shimmer::after,
html:not([data-theme="dark"]) .skeleton-shimmer::after {
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(15, 23, 42, 0.02) 20%,
        rgba(15, 23, 42, 0.06) 60%,
        rgba(255, 255, 255, 0) 100%
    ) !important;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Structural skeleton items matching layout components */
.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    margin-bottom: 30px;
    width: 100%;
    flex-shrink: 0;
}

.skeleton-logo {
    width: 180px;
    height: 32px;
    border-radius: 8px;
}

.skeleton-nav {
    display: flex;
    gap: 24px;
}

.skeleton-nav-item {
    width: 90px;
    height: 24px;
    border-radius: 6px;
}

.skeleton-title {
    width: 300px;
    height: 40px;
    margin-bottom: 30px;
    border-radius: 10px;
    flex-shrink: 0;
}

.skeleton-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 35px;
    flex-shrink: 0;
}

.skeleton-card {
    height: 110px;
    border-radius: 16px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .skeleton-grid {
        grid-template-columns: 1fr;
    }
    .skeleton-sidebar {
        display: none;
    }
}

.skeleton-main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.skeleton-chart-box {
    height: 240px;
    border-radius: 16px;
}

.skeleton-table-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skeleton-table-row {
    height: 52px;
    border-radius: 10px;
}

.skeleton-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.skeleton-sidebar-card {
    height: 150px;
    border-radius: 16px;
}

.skeleton-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skeleton-list-item {
    height: 65px;
    border-radius: 10px;
}

/* Home / Marketplace specific skeletons */
.skeleton-index-hero {
    height: 380px;
    border-radius: 24px;
    margin-bottom: 35px;
    width: 100%;
    flex-shrink: 0;
}

.skeleton-search-bar {
    height: 64px;
    border-radius: 18px;
    margin-bottom: 35px;
    width: 100%;
    flex-shrink: 0;
}

.skeleton-carousel-row {
    display: flex;
    gap: 20px;
    overflow: hidden;
    margin-bottom: 40px;
    flex-shrink: 0;
}

.skeleton-product-card {
    flex: 0 0 240px;
    height: 300px;
    border-radius: 16px;
}
