/* Course Progress Cards Styles - Grid-based layout */
.course-progress-container {
    margin: 2rem 0;
    width: 100%;
}

/* Use CSS Grid with fixed number of columns based on screen size */
.course-progress-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default to 3 columns for desktop */
    gap: 1rem; /* Consistent gap between all cards */
    padding: 0.5rem 0;
}

/* Base card styling */
.course-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover:not(.course-card-disabled):not(.course-card-skeleton) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Disabled card styling */
.course-card-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none; /* Disable click events */
}

.course-card-columns {
    display: flex;
    align-items: center;
}

.course-icon-column {
    flex: 0 0 auto;
    margin-right: 1rem;
}

.course-icon {
    width: 48px;
    height: 48px;
    position: relative;
    background-color: var(--light-bg);
    border-radius: 6px;
    overflow: hidden;
}

.course-icon-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--darker-bg);
    z-index: 1;
}

.course-icon svg {
    position: relative;
    z-index: 2;
    width: 24px;
    height: 24px;
    margin: 12px;
    fill: var(--svg-color);
}

.course-info-column {
    flex: 1;
}

.course-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--black);
}

.course-completion {
    font-size: 0.875rem;
    color: var(--gray-text);
}

.course-status-column {
    margin-left: auto;
}

.icon-chevron, .icon-check {
    width: 24px;
    height: 24px;
}

.icon-chevron {
    fill: var(--black);
}

.icon-check {
    fill: var(--green);
}

/* Skeleton card styles */
.course-card-skeleton {
    cursor: default;
    pointer-events: none; /* Disable click events */
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

.skeleton-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-bg);
}

.skeleton-icon-inner {
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.skeleton-title {
    height: 16px;
    width: 70%;
    background-color: var(--gray-bg);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-text {
    height: 12px;
    width: 50%;
    background-color: var(--gray-bg);
    border-radius: 4px;
}

.skeleton-chevron {
    width: 24px;
    height: 24px;
    background-color: var(--gray-bg);
    border-radius: 50%;
}

/* Tablet: 2 columns */
@media (max-width: 900px) and (min-width: 601px) {
    .course-progress-cards {
        grid-template-columns: repeat(2, 1fr); /* 2 equal columns for tablets */
    }
}

/* Mobile: Horizontal scrolling */
@media (max-width: 600px) {
    .course-progress-container {
        padding-right: 0; /* Remove right padding from container to allow cards to extend to edge */
        overflow: hidden; /* Change from 'visible' to 'hidden' to prevent overflow */
        width: 100%; /* Ensure the container doesn't exceed its parent width */
    }
    
    .course-progress-cards {
        display: flex; /* Switch to flexbox for horizontal scrolling */
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x proximity; /* Use proximity for smoother scrolling */
        scrollbar-width: none; /* Firefox */
        padding: 0.5rem 0;
        padding-right: 1.5rem; /* Add right padding to container */
        margin-right: 0; /* Remove negative margin that was causing overflow */
        -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
    }
    
    .course-progress-cards::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .course-card {
        flex: 0 0 70%; /* Reduced to show more of next card */
        min-width: 200px;
        scroll-snap-align: start;
        margin-right: 1rem; /* Space between cards */
    }
    
    .course-card:last-child {
        margin-right: 0; /* Remove extra margin on last card */
    }
}