<style>
    body {
        max-width: 100%;
    }
    
    .bans-table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
        font-family: Arial, sans-serif;
    }
    
    .mod-name {
        color: purple;
        font-weight: bold;
    }
    
    .system-name {
        color: inherit;
        font-weight: normal;
    }
    
    .tooltip {
        position: relative;
        display: inline-block;
        width: 100%;
    }
    
    .tooltip .tooltiptext {
        display: none;
        background-color: #fff;
        color: #000;
        text-align: justify;
        border-radius: 0px;
        padding: 5px;
        position: absolute;
        z-index: 1;
        top: 100%; 
        left: 0;
        opacity: 0;
        border: 1px solid #000;
        width: 100%;
        white-space: pre-wrap;
    }
    
    .tooltip:hover .tooltiptext {
        display: block;
        opacity: 1;
    }
    
    .reason-cell {
        max-width: 300px;
        word-wrap: break-word;
    }
    
    .length-cell {
        max-width: 150px;
        word-wrap: break-word;
    }
</style>
<div class="bans-container">
    {% if bans %}
        <table class="modlog">
            <thead>
                <tr>
                    <th>IP Address</th>
                    <th>Reason</th>
                    <th>Board</th>
                    <th>Length</th>
                    <th>Staff</th>
                </tr>
            </thead>
            <tbody>
                {% for ban in bans %}
                    <tr>
                        <td>{{ ban.ip }}</td>
                        <td class="reason-cell">
                            {% if ban.show_tooltip %}
                                <span class="tooltip">
                                    {{ ban.reason }}
                                    <span class="tooltiptext">{{ ban.tooltip_content }}</span>
                                </span>
                            {% else %}
                                {{ ban.reason }}
                            {% endif %}
                        </td>
                        <td class="board-cell">{{ ban.board }}</td>
                        <td class="length-cell">{{ ban.expires }}</td>
                        <td>
                            {% if ban.is_nigger %}
                                <span class="system-name">{{ ban.mod }}</span>
                            {% else %}
                                <span class="mod-name">{{ ban.mod }}</span>
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% endif %}
</div>