/* bw style */
body {
    background-color: #323232;
    color: white;
    font-family: initial;
    margin: 8px;
    max-width: 100vw;
    overflow-x: hidden;
}

/* questions */
.dco { color: #E9EC54; }
.qco { color: #B387FF; }

/* date link */
.dco a {
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* links no more */
body.disable-links .dco a {
    text-decoration: none;
    pointer-events: none;
    cursor: text;
}

h3 {
    font-weight: bold;
    font-size: 1.17em;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
}

/* search bar */
.search-container {
    padding: 10px;
    margin: 6px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

input[type="text"], select, input[type="submit"], button {
    font-size: 16px; 
}

.search-left, .search-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* highlight word */
.highlight {
    background-color: yellow;
    color: black;
}

/* highlight no more */
body.disable-highlight .highlight {
    background-color: transparent;
    color: inherit;
}

#status-msg {
    font-family: sans-serif;
    color: #ccc;
    margin-top: 20px;
    margin-bottom: 50px;
}

/* modal */
#config-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #00000066;
    z-index: 10000;
}

.modal-content {
    position: absolute;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    aspect-ratio: auto;
    width: 50vw;
    height: auto;
    max-height: 90vh;
    background-color: #dbdbdb;
    color: black;
    font-family: Arial, sans-serif;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-width: none;
}

.close-btn {
    position: absolute;
    color: #454545;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section code {
    color: #eee;
    background-color: #393939;
    border-radius: 3px;
    font-family: monospace;
    padding: 0 4px;
}

.center-bold {
    text-align: center;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.modal-content a { color: blue; }

/* force wrapping */
#results-area,
#results-area * {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word;
}

#search-form {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

/* mobile result toast */
#toast {
    display: none; 
    font-family: Arial, sans-serif;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 90%;
    padding: 10px 20px;
    border-radius: 48px;
    background-color: #00000077;
    color: white;
    text-align: center;
    font-size: 16px;
    transition: opacity 0.3s ease-in-out;
    bottom: 44px;
}

.toast-hidden {
    opacity: 0;
    pointer-events: none; 
}

.toast-visible {
    opacity: 1;
    pointer-events: auto;
}

/* mobile layout */
@media (orientation: portrait), (max-width: 630px) {
    .modal-content {
        width: 90%;
        max-height: 80vh;
        aspect-ratio: auto;
    }

    #search-form {
        display: grid;
        grid-template-columns: 1fr 1.6fr auto;
        gap: 8px;
    }

    .search-left, .search-right { display: contents; }

    /* Row 1 */
    #q {
        grid-column: 1 / 3;
        grid-row: 1;
        width: 100%;
        box-sizing: border-box;
    }

    input[type="submit"] {
        grid-column: 3 / 4;
        grid-row: 1;
        width: 100%;
        height: 100%;
    }

    /* Row 2 */
    .search-left label { display: none; }

    #sort {
        grid-column: 1 / 2;
        grid-row: 2;
        width: 100%;
    }

    #filter {
        grid-column: 2 / 3;
        grid-row: 2;
        width: 100%;
    }

    #config-btn {
        grid-column: 3 / 4;
        grid-row: 2;
        width: 100%;
    }

    #toast { display: block; }
    #count-display { display: none; }
    .hide-mobile { display: none; }
}