.table {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    /* hide the first column */

    gap: 8px;
}

.row div {
    padding: 16px;
    word-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.05);
}

.table ul {
    list-style: inside;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.table a {
    text-decoration: underline;
}

.row.odd div:nth-child(1n) {
    background-color: rgba(0, 0, 0, 0.1);
}

.tunnelname {
    font-weight: bold;
    font-size: 14px;
}

.row.header {
    /* position: sticky;
		padding: 24px 0 12px 0;
		top: 55;
		z-index: 10; */
    width: 100%;
    margin-top: 16px;
    top: 96px;
}

.row.header p {
    font-weight: bold;
    font-size: 16px;
}

.row.even div:first-child {
    background-color: #9bbd32;
}

.row.odd div:first-child {
    background-color: #9bbd32;
}

#searchInput {
    border: 1px solid rgba(0, 0, 0, 0.4);
    height: 2.75rem;
    padding: 0 1rem;
    min-width: 300px;
    border-radius: 24px;
    outline: transparent;
}

#searchInput:focus {
    outline: 1px solid blue;
}

.highlight {
    background-color: yellow;
}

.current {
    background-color: orange;
}

#navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    width: 100%;
    position: sticky;
    top: 50px;
    left: 0;
    z-index: 10;
    background-color: white;
    padding: 1rem 0;
    gap: 1rem;
}

.search-section {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: start;
    gap: 1rem;
}

.search-nav {
    cursor: pointer;
    font-size: 18px;
}

.matches {
    display: none;
    gap: 1rem;
}

.search-nav-wrapper {
    display: none;
    gap: 0.5rem;
}

.search-container {
    display: flex;
    align-items: center;
    position: relative;
}

#clear-search {
    position: absolute;
    right: 1rem;
    cursor: pointer;
    display: none;
}

#dialog {
    display: none;
}

#dialog[open] {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 100;
    backdrop-filter: blur(5px);
}

/* Disable scroll if dialog is visible */
body:has(#dialog[open]) {
    overflow: hidden;
}

.dialog-inner {
    margin: auto auto;
    transform: translateY(50%);
    width: 600px;
    background-color: white;
    min-height: 300px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 36px;
    gap: 8px;
    line-height: 1.5em;
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 80%;
}

.dialog-inner i {
    position: absolute;
    top: 24px;
    right: 24px;
    cursor: pointer;
    font-size: 18px;
}

.dialog-inner h3 {
    font-size: 18px;
    line-height: 1.2em;
}

.dialog-inner button {
    font-size: 16px;
    padding: 8px 16px;
    background-color: #9bbd32;
    border-radius: 16px;
    color: white;
    margin-top: 16px;
}

.top-search-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.info {
    cursor: pointer;
    background-color: #9bbd32;
    width: 22px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.page-top {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-top p {
    max-width: 80ch;
}

.row.header {
    position: sticky;
    padding: 8px 0;
}

@media screen and (max-width: 768px) {
    .table {
        max-width: 100%;
        overflow-x: scroll;
        /* height: 400px; */
    }

    .table .row {
        min-width: 200px;
        display: flex;
    }

    .table .row div {
        flex: 1;
        min-width: 200px;
    }

    .row.header p {
        min-width: 200px;
    }

    .navigation-bar {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .search-section {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .search-container {
        width: 100%;
    }

    #matchCount {
        width: unset !important;
    }

    #searchInput {
        width: 100%;
        min-width: unset;
    }
}

h1 {
    line-height: 1.2em;
}

@media only screen and (max-width: 768px) {
    .row.header {
        top: 0;
    }
}
