/* Challenge Grid */
.challenges-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.challenge-card {
    background: #FFFFFF;
    border: 1px solid #F1F5F9;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.15s ease;
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.challenge-card:nth-child(1) { animation-delay: 0.1s; }
.challenge-card:nth-child(2) { animation-delay: 0.15s; }
.challenge-card:nth-child(3) { animation-delay: 0.2s; }
.challenge-card:nth-child(4) { animation-delay: 0.25s; }
.challenge-card:nth-child(5) { animation-delay: 0.3s; }
.challenge-card:nth-child(6) { animation-delay: 0.35s; }
.challenge-card:nth-child(n+7) { animation-delay: 0.4s; }

.challenge-card:hover {
    border-color: #E2E8F0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.challenge-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #F8FAFC 0%, #E5E7EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.challenge-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.challenge-card:hover .challenge-image img {
    transform: scale(1.05);
}

.challenge-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.challenge-image-icon {
    font-size: 44px;
    color: #94A3B8;
}

.verified-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.verified-badge i {
    font-size: 13px;
}

.challenge-content {
    padding: 20px;
    min-width: 0;
}

.challenge-prize {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #0F172A;
    color: #FFFFFF;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.challenge-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Description + Expand */
.challenge-desc {
    margin-top: 8px;
    color: #4B5563;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.challenge-desc.truncated::after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: #FFFFFF;
    padding-left: 4px;
    color: #6366F1;
    font-weight: 600;
}

.challenge-card.expanded .challenge-desc {
    -webkit-line-clamp: unset;
    cursor: default;
}

.challenge-card.expanded .challenge-desc::after {
    content: '';
}

.challenge-platforms {
    display: flex;
    gap: 8px;
    margin: 12px 0 16px;
    align-items: center;
    flex-wrap: wrap;
}

.platform-icon {
    width: 32px;
    height: 32px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #6B7280;
    transition: all 0.2s ease;
}

.platform-icon:hover {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
}

.platform-more {
    width: 32px;
    height: 32px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.platform-more:hover {
    background: #6366F1;
    color: #FFFFFF;
    border-color: #6366F1;
    transform: scale(1.1);
}

.challenge-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #F3F4F6;
}

.challenge-countdown {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.challenge-countdown i {
    font-size: 14px;
}

.challenge-participants {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.challenge-participants i {
    font-size: 14px;
}

.countdown-urgent {
    color: #DC2626;
    font-weight: 600;
}

/* No results block */
#noResults {
    display: none;
    text-align: center;
    color: #6B7280;
    margin-top: 24px;
}

#noResults .btn-secondary {
    background: transparent;
    border: 1px solid #E5E7EB;
    color: #111827;
}

#noResults .btn-primary {
    background: #6366F1;
    color: #fff;
}

#noResults[style*="display:block"] { 
    animation: popIn 220ms ease; 
}

@media (max-width: 768px) {
    .challenges-section {
        padding: 0 20px;
    }

    .challenges-grid {
        grid-template-columns: 1fr;
    }
}
