/* Grid Layout Styles for Tools and Skills Sections */

/* Convert flex-container to flexbox with wrap for center alignment */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 60px;
    margin: 0 auto;
    padding: 0;
    width: 90%;
    align-items: center;
    margin-top: 50px;
}

/* Ensure exactly 5 items per row by setting flex-basis */
.flex-container .flex-item {
    flex: 0 0 calc(20% - 16px); /* 20% width minus gap adjustment */
}

/* Update flex-item for grid layout */
.flex-item {
    display: block;
    width: 150px;
    height: 100px;
    margin: 0;
    padding: 0;
    text-align: center;
}

.flex-item img {
    width: 100px;
    height: 100px;
}

.flex-item p {
    font-weight: bold;
}

/* Responsive Grid Layout */
@media screen and (max-width: 768px) {
    .flex-container {
        row-gap: 40px;
    }
    
    .flex-container .flex-item {
        flex: 0 0 calc(30% - 16px);
    }
    
    .flex-item {
        width: 120px;
    }
    
    .flex-item img {
        width: 80px;
        height: 80px;
    }
}

@media screen and (max-width: 411px) {
    .flex-container {
        row-gap: 35px;
    }
    
    .flex-container .flex-item {
        flex: 0 0 calc(45% - 10px);
    }
    
    .flex-item {
        width: 100px;
    }
    
    .flex-item img {
        width: 70px;
        height: 70px;
    }
}

@media screen and (max-width: 375px) {
    .flex-container {
        row-gap: 30px;
    }
    
    .flex-container .flex-item {
        flex: 0 0 calc(45% - 8px);
    }
    
    .flex-item {
        width: 90px;
    }
    
    .flex-item img {
        width: 60px;
        height: 60px;
    }
}
