.challenges-container {
    max-width: 1200px;  /* Set maximum width */
    width: 100%;  /* Take full width */
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;  /* Include padding in width calculation */
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));  /* Responsive columns */
    gap: 2rem;
    padding: 1rem;
    justify-content: center;
    box-sizing: border-box;
}

.challenge-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    height: 200px;
    overflow: hidden;
    
    /* Add flexbox for vertical layout */
    display: flex;
    flex-direction: column;
    position: relative;  /* For absolute positioning of points */
}

.challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    outline: 2px solid #ff6500;
}

.challenge-card.completed {
    border-left: 4px solid #00bf63;
    background: linear-gradient(to right, rgba(0, 191, 99, 0.1), transparent);
}

.challenge-complete {
    position: absolute;
    bottom: 1rem;  /* Changed from top to bottom */
    right: 1rem;   /* Changed from left to right */
    color: #00bf63;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.challenge-complete i {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.challenge-card.completed:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 191, 99, 0.2);
}

.challenge-points {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;  /* Ensure points are above other elements */
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 16px;
    font-weight: 500;
    color: #2c662d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.challenge-points i {
    font-size: 0.875rem;
    color: #ffd700;  /* Gold color for the star icon */
}

.challenge-card h3 {
    height: 30%;
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    padding-right: 4rem;  /* Make space for points display */
}

.challenge-card p {
    height: 50%;
    margin: 0.5rem 0;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    font-size: 1rem;
}

.challenge-tags {
    height: 20%;
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    padding-right: 2.5rem;  /* Add padding to prevent overlap with checkmark */
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.875rem;
    white-space: nowrap;
    background: #f0f0f0;  /* Default light gray background */
    color: #666;         /* Default text color */
}

.tag.beginner { background: #e0f7e0; color: #2c662d; }
.tag.intermediate { background: #fff3e0; color: #966600; }
.tag.advanced { background: #ffe0e0; color: #662c2c; }
.tag.cuda { background: #76b900; color: #1a1a1a; }

.challenges-controls {
    
    display: flex;
    justify-content: flex-end;
}

.sort-select {
    
    border-radius: 8px;
    border: 1px solid #eee;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
}

.sort-select:hover {
    border-color: #ddd;
}