/* Styles spécifiques pour la liste des ports */

html, body {
    scroll-behavior: auto;
}

.container {
    height: auto;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
}

/* Empêcher le scroll automatique vers l'input */
.search-box:focus {
    scroll-margin-top: 100vh;
}

.form-container {
    max-width: 900px;
}

.search-container {
    margin: 3rem 0 1rem 0;
    display: flex;
    justify-content: center;
}

.search-box {
    width: 80%;
    padding: 0.8rem;
    border-radius: 0.5rem;
    border: 0.1rem solid #ccc;
    font-size: 1rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.8);
}

.search-box:focus {
    outline: none;
    border-color: #7194a6;
    box-shadow: 0 0 0 0.2rem rgba(113, 148, 166, 0.25);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.filter-btn {
    background-color: rgba(255, 255, 255, 0.5);
    color: #333;
    border: 0.1rem solid rgba(113, 148, 166, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.filter-btn.active {
    background-color: #7194a6;
    color: white;
    border-color: #7194a6;
}

.stats {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #5a6268;
    font-size: 0.85rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 0.5rem;
}

.ports-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    overflow: hidden;
}

.ports-table thead {
    background-color: #7194a6;
    color: white;
}

.ports-table th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-weight: bold;
}

.ports-table td {
    padding: 0.5rem 1rem;
    border-bottom: 0.1rem solid rgba(0, 0, 0, 0.1);
}

.ports-table tbody tr {
    transition: background-color 0.2s;
}

.ports-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.port-number {
    font-weight: bold;
    color: #7194a6;
    font-family: monospace;
    font-size: 1.1rem;
}

.protocol-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    font-weight: bold;
}

.protocol-tcp {
    background-color: #28a745;
    color: white;
}

.protocol-udp {
    background-color: #ffc107;
    color: #333;
}

.protocol-both {
    background-color: #17a2b8;
    color: white;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-size: 1.1rem;
    display: none;
}

.no-results.show {
    display: block;
}

/* Responsive */

/* Tablettes (768px à 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .ports-table th,
    .ports-table td {
        padding: 0.6rem 0.8rem;
    }
}

/* Smartphones (<=767px) */
@media (max-width: 767px) {
    .form-container {
        padding: 5%;
    }

    .category-filters {
        gap: 0.3rem;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .ports-table {
        font-size: 0.85rem;
    }

    .ports-table th,
    .ports-table td {
        padding: 0.5rem;
    }

    /* Masquer la colonne description sur mobile pour la lisibilité */
    .ports-table th:last-child,
    .ports-table td:last-child {
        display: none;
    }

    .port-number {
        font-size: 1rem;
    }

    .protocol-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
}
