/* ========================= Skeleton Loader Styles ========================= */

/* Base skeleton animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Skeleton element base */
.skeleton {
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

/* Skeleton shapes */
.skeleton-text {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 4px;
}

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

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

.skeleton-title {
    height: 24px;
    width: 50%;
    margin-bottom: 12px;
    border-radius: 6px;
}

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

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

.skeleton-btn {
    height: 44px;
    border-radius: 8px;
}

/* ========================= Auth Page Skeleton ========================= */
.auth-skeleton {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    padding: 20px;
}

.auth-skeleton__card {
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
}

.auth-skeleton__logo {
    width: 120px;
    height: 40px;
    margin: 0 auto 24px;
}

.auth-skeleton__avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.auth-skeleton__heading {
    height: 28px;
    width: 60%;
    margin: 0 auto 10px;
}

.auth-skeleton__subheading {
    height: 14px;
    width: 75%;
    margin: 0 auto 32px;
}

.auth-skeleton__label {
    height: 12px;
    width: 30%;
    margin-bottom: 8px;
}

.auth-skeleton__input {
    height: 48px;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 10px;
}

.auth-skeleton__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.auth-skeleton__check {
    height: 12px;
    width: 100px;
}

.auth-skeleton__link {
    height: 12px;
    width: 110px;
}

.auth-skeleton__button {
    height: 48px;
    width: 100%;
    margin-bottom: 24px;
    border-radius: 10px;
}

.auth-skeleton__footer {
    height: 12px;
    width: 65%;
    margin: 0 auto;
}

/* ========================= Main Layout Skeleton ========================= */
.page-skeleton {
    padding: 0;
}

.page-skeleton__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-skeleton__title {
    height: 28px;
    width: 200px;
}

.page-skeleton__action {
    height: 38px;
    width: 120px;
    border-radius: 8px;
}

/* Stat cards skeleton */
.page-skeleton__stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.page-skeleton__stat-card {
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
}

.page-skeleton__stat-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    border-radius: 10px;
}

.page-skeleton__stat-value {
    height: 24px;
    width: 60%;
    margin-bottom: 8px;
}

.page-skeleton__stat-label {
    height: 12px;
    width: 80%;
}

/* Table skeleton */
.page-skeleton__table {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.page-skeleton__table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.page-skeleton__table-header-cell {
    height: 12px;
    border-radius: 4px;
}

.page-skeleton__table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f8f8f8;
}

.page-skeleton__table-cell {
    height: 14px;
    border-radius: 4px;
}

.page-skeleton__table-cell:first-child {
    width: 80%;
}

.page-skeleton__table-cell:nth-child(2) {
    width: 60%;
}

.page-skeleton__table-cell:nth-child(3) {
    width: 70%;
}

.page-skeleton__table-cell:nth-child(4) {
    width: 50%;
}

.page-skeleton__table-cell:last-child {
    width: 40%;
}

/* Content cards skeleton */
.page-skeleton__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.page-skeleton__card {
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
}

.page-skeleton__card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.page-skeleton__card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.page-skeleton__card-info {
    flex: 1;
}

.page-skeleton__card-title {
    height: 16px;
    width: 70%;
    margin-bottom: 8px;
}

.page-skeleton__card-sub {
    height: 12px;
    width: 50%;
}

.page-skeleton__card-body {
    height: 40px;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 8px;
}

.page-skeleton__card-footer {
    display: flex;
    gap: 10px;
}

.page-skeleton__card-btn {
    height: 34px;
    flex: 1;
    border-radius: 6px;
}

/* Banner skeleton (for PageBanner section) */
.page-skeleton__banner {
    padding: 24px;
    margin-bottom: 24px;
}

.page-skeleton__banner-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.page-skeleton__banner-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

.page-skeleton__banner-name {
    height: 20px;
    width: 160px;
    margin-bottom: 8px;
}

.page-skeleton__banner-email {
    height: 14px;
    width: 200px;
}

.page-skeleton__banner-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.page-skeleton__banner-btn {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

/* Visibility & transition */
.skeleton-wrapper {
    transition: opacity 0.3s ease;
}

.skeleton-wrapper.skeleton-hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.skeleton-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skeleton-content.skeleton-visible {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .page-skeleton__stats {
        grid-template-columns: 1fr;
    }

    .page-skeleton__cards {
        grid-template-columns: 1fr;
    }

    .page-skeleton__table-header,
    .page-skeleton__table-row {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .page-skeleton__table-header-cell:nth-child(n+4),
    .page-skeleton__table-cell:nth-child(n+4) {
        display: none;
    }

    .page-skeleton__banner-actions {
        display: none;
    }
}
