/* Skeleton Loading Styles - For Better Perceived Performance & SEO */
/* Prevents Cumulative Layout Shift (CLS) and improves Core Web Vitals */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark mode skeleton support - DISABLED to always use light theme */

/* Skeleton variants */
.skeleton-text {
    height: 0.8em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 0.6em;
    margin-bottom: 0.4em;
    border-radius: 4px;
}

.skeleton-text-lg {
    height: 1.2em;
    margin-bottom: 0.6em;
    border-radius: 4px;
}

.skeleton-title {
    height: 1.5em;
    margin-bottom: 0.75em;
    border-radius: 4px;
    width: 70%;
}

.skeleton-paragraph {
    margin-bottom: 1em;
}

.skeleton-paragraph .skeleton-text:last-child {
    width: 80%;
}

.skeleton-paragraph .skeleton-text:not(:last-child) {
    width: 100%;
}

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

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

.skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}

.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

.skeleton-badge {
    height: 24px;
    width: 80px;
    border-radius: 12px;
    display: inline-block;
}

/* Blog Card Skeleton */
.blog-card-skeleton {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.blog-card-skeleton .skeleton-image {
    margin: 16px;
    aspect-ratio: 16 / 9;
}

.blog-card-skeleton .skeleton-content {
    padding: 16px;
}

.blog-card-skeleton .skeleton-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

/* Course Card Skeleton */
.course-card-skeleton {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Stats Card Skeleton */
.stats-card-skeleton {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Activity Item Skeleton */
.activity-item-skeleton {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Pagination Skeleton */
.pagination-skeleton {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
}

.pagination-skeleton .skeleton-page {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

/* Accessibility - hide from screen readers */
.skeleton {
    aria-hidden: "true";
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background-color: #f0f0f0;
    }
}

/* RTL Support */
[dir="rtl"] .skeleton {
    background: linear-gradient(
        270deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
}

[dir="rtl"] @keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark mode skeleton support - DISABLED to always use light theme */

/* Skeleton variants */
.skeleton-text {
    height: 0.8em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 0.6em;
    margin-bottom: 0.4em;
    border-radius: 4px;
}

.skeleton-text-lg {
    height: 1.2em;
    margin-bottom: 0.6em;
    border-radius: 4px;
}

.skeleton-title {
    height: 1.5em;
    margin-bottom: 0.75em;
    border-radius: 4px;
    width: 70%;
}

.skeleton-paragraph {
    margin-bottom: 1em;
}

.skeleton-paragraph .skeleton-text:last-child {
    width: 80%;
}

.skeleton-paragraph .skeleton-text:not(:last-child) {
    width: 100%;
}

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

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

.skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}

.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

.skeleton-badge {
    height: 24px;
    width: 80px;
    border-radius: 12px;
    display: inline-block;
}

/* Blog Card Skeleton */
.blog-card-skeleton {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.blog-card-skeleton .skeleton-image {
    margin: 16px;
    aspect-ratio: 16 / 9;
}

.blog-card-skeleton .skeleton-content {
    padding: 16px;
}

.blog-card-skeleton .skeleton-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

/* Pagination Skeleton */
.pagination-skeleton {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
}

.pagination-skeleton .skeleton-page {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

/* Accessibility - hide from screen readers */
.skeleton {
    aria-hidden: "true";
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background-color: #f0f0f0;
    }
}

/* RTL Support */
[dir="rtl"] .skeleton {
    background: linear-gradient(
        270deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
}

[dir="rtl"] @keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Student Dashboard Skeleton Responsive */
@media (max-width: 1199px) {
    [data-skeleton="dashboard-content"] [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    [data-skeleton="dashboard-content"] [style*="grid-column: span 1; grid-row: span 2"] {
        grid-column: span 2 !important;
        grid-row: span 1 !important;
    }
}

@media (max-width: 767px) {
    [data-skeleton="dashboard-content"] [style*="grid-template-columns: repeat(3"],
    [data-skeleton="dashboard-content"] [style*="grid-template-columns: repeat(2"] {
        grid-template-columns: 1fr !important;
    }

    [data-skeleton="dashboard-content"] [style*="grid-column: span"] {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .sidebar-skeleton {
        display: none !important;
    }
}

/* AI Feature Grid Skeleton */
.ai-feature-skeleton {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Progress Course Skeleton */
.progress-course-skeleton {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
}

/* Quiz Result Skeleton */
.quiz-result-skeleton {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}
