/* Skeleton Loading Styles */
.skeleton-loader {
    position: relative;
    overflow: hidden;
    background: #e9ecef;
    border-radius: 4px;
}

.skeleton-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: skeleton-shimmer 1.5s infinite;
}

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

/* Related Course Skeleton */
.skeleton-related-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.skeleton-related-item:last-child {
    border-bottom: none;
}

.skeleton-title {
    height: 16px;
    width: 85%;
    margin-bottom: 8px;
}

.skeleton-title-sm {
    height: 14px;
    width: 60%;
    margin-bottom: 6px;
}

.skeleton-rating {
    height: 14px;
    width: 120px;
}

/* Review Skeleton */
.skeleton-review {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.skeleton-review:last-child {
    border-bottom: none;
}

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

.skeleton-review-body {
    flex: 1;
}

.skeleton-name {
    height: 14px;
    width: 100px;
    margin-bottom: 8px;
}

.skeleton-stars {
    height: 14px;
    width: 90px;
    margin-bottom: 10px;
}

.skeleton-text {
    height: 12px;
    width: 100%;
    margin-bottom: 6px;
}

.skeleton-text-short {
    height: 12px;
    width: 70%;
}

/* ===== Course Card Grid Skeleton ===== */
.skeleton-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.skeleton-card-thumb {
    width: 100%;
    padding-top: 56.25%;
    position: relative;
}

.skeleton-card-thumb .skeleton-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.skeleton-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-card-badge {
    height: 12px;
    width: 80px;
    border-radius: 10px;
}

.skeleton-card-title {
    height: 18px;
    width: 90%;
}

.skeleton-card-title-2 {
    height: 18px;
    width: 65%;
}

.skeleton-card-rating {
    height: 14px;
    width: 130px;
}

.skeleton-card-desc {
    height: 12px;
    width: 100%;
}

.skeleton-card-desc-2 {
    height: 12px;
    width: 80%;
}

.skeleton-card-btn {
    height: 14px;
    width: 90px;
    margin-top: auto;
    border-radius: 3px;
}

/* Search page result card skeleton */
.skeleton-result-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.skeleton-result-thumb {
    height: 200px;
    position: relative;
}

.skeleton-result-thumb .skeleton-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.skeleton-result-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Grid wrapper for skeleton cards matching course-grid */
.skeleton-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* Fade out skeleton when page is loaded */
.skeleton-grid-placeholder {
    transition: opacity 0.3s ease;
}

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

/* ===== My Courses Card Skeleton ===== */
.skeleton-my-course-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    overflow: hidden;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.skeleton-my-course-thumb {
    height: 200px;
    position: relative;
}

.skeleton-my-course-thumb .skeleton-loader {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 0;
}

.skeleton-my-course-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== Cart Item Skeleton ===== */
.skeleton-cart-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e1e5eb;
    display: flex;
    align-items: center;
    gap: 20px;
}

.skeleton-cart-img {
    width: 120px;
    height: 80px;
    border-radius: 4px;
    flex-shrink: 0;
}

.skeleton-cart-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-cart-price {
    width: 60px;
    height: 20px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ===== Blog Category Row Skeleton ===== */
.skeleton-blog-row {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    overflow: hidden;
    margin-bottom: 40px;
    display: flex;
    min-height: 220px;
}

.skeleton-blog-left {
    flex: 7;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skeleton-blog-right {
    flex: 5;
    padding: 40px;
    background: #f9faff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== Order History Skeleton ===== */
.skeleton-order-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    background: #fff;
}

.skeleton-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 14px 20px;
    border-bottom: 1px solid #e8e8e8;
}

.skeleton-order-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-order-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* ===== Home Page Section Skeletons ===== */
.skeleton-home-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.skeleton-home-cat-item {
    flex: 1 1 calc(33.33% - 15px);
    min-width: 150px;
    height: 160px;
    border-radius: 12px;
}

.skeleton-trending-item {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid #f2f2f2;
    align-items: center;
}

.skeleton-trending-thumb {
    width: 90px;
    height: 65px;
    border-radius: 8px;
    flex-shrink: 0;
}

.skeleton-trending-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 768px) {
    .skeleton-blog-row {
        flex-direction: column;
    }
    .skeleton-cart-item {
        flex-wrap: wrap;
    }
    .skeleton-home-cat-item {
        flex: 1 1 calc(50% - 15px);
    }
}
