/**
 * Resources Page Redesign - Compact 4 Column Grid (Gray Theme)
 * Version: 5.1.0 - Gray Color Scheme
 */

#resourcesGrid.resources-list,
.resources-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.25rem !important;
    padding: 3rem 0 !important;
    width: 100% !important;
}

.resource-item {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
    width: 100% !important;
}

.resource-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(100, 116, 139, 0.2);
}

.resource-thumbnail {
    width: 100% !important;
    height: 160px !important;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-file-icon {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.95);
}

.resource-file-type {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resource-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1rem;
}

.resource-category {
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.resource-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
}

.resource-description {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-height: 36px;
}

.resource-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 11px;
    color: #94a3b8;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.resource-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.resource-meta i {
    font-size: 10px;
}

/* Responsive */
@media (min-width: 1400px) {
    #resourcesGrid.resources-list,
    .resources-list {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    #resourcesGrid.resources-list,
    .resources-list {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    #resourcesGrid.resources-list,
    .resources-list {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    #resourcesGrid.resources-list,
    .resources-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .resource-thumbnail {
        height: 140px !important;
    }
}

@media (max-width: 599px) {
    #resourcesGrid.resources-list,
    .resources-list {
        grid-template-columns: 1fr !important;
    }
    
    .resource-thumbnail {
        height: 180px !important;
    }
}

/* Animation */
.resource-item {
    animation: fadeInUp 0.4s ease-out backwards;
}

.resource-item:nth-child(1) { animation-delay: 0.05s; }
.resource-item:nth-child(2) { animation-delay: 0.1s; }
.resource-item:nth-child(3) { animation-delay: 0.15s; }
.resource-item:nth-child(4) { animation-delay: 0.2s; }
.resource-item:nth-child(5) { animation-delay: 0.25s; }
.resource-item:nth-child(6) { animation-delay: 0.3s; }
.resource-item:nth-child(7) { animation-delay: 0.35s; }
.resource-item:nth-child(8) { animation-delay: 0.4s; }
.resource-item:nth-child(9) { animation-delay: 0.45s; }
.resource-item:nth-child(10) { animation-delay: 0.5s; }
.resource-item:nth-child(11) { animation-delay: 0.55s; }
.resource-item:nth-child(12) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
