/* General Layout */
body {
    margin: 0;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 0.8em;
}

@media (min-width: 902px) {
    .container {
        display: flex;
    }
}

.sidebar {
    flex: 1;
    margin: 0 2%; /* Use percentage values for margin */
}

@media (min-width: 902px) {
    .main {
        flex: 4;
        padding: 1em; /* Use em units for padding */
    }
}

/* Textbox for number of results */
#result-box {
    text-align: center;
    padding-left: 1em; 
    padding-top: 0.5em; 
    padding-bottom: 0.4em; 
    font-size: 0.8em;
    border-bottom: 0.3em solid #7C92A6; 
    position: sticky;
    top: 0;
    left: 0;
    z-index: 2;
}

#result-box p {
    margin: 0.4em 0;
}

#add-box {
    font-size: 0.9em;
    text-align: center;
    margin: 2% 2%;
    padding: 0.4em;
    border: 0;
    position: sticky;
    bottom: 0;
    left: 0;
    z-index: 2;
}

button:focus {
    outline: none;
}

@media (min-height: 902px) and (min-width: 902px) {
    #add-box {
        margin-top: 3em; 
    }
    .stickyside {
        margin-top: 1.5em;
    }
}

/* Sticky behavior on normal/large screens */
@media (min-width: 902px) {
    #add-box {
        position: sticky;
        top: calc(100vh - 12em) !important;
    }
    #result-box {
        position: sticky;
        top: 0;
    }
    .stickyside {
        position: sticky;
        top: 4.25em; 
    }
}

/* Form */
.listwrapper {
    list-style-type: none;
    padding: 0;
}

.fieldsetcontainer {
    padding: 0.5em; 
}

fieldset {
    border-radius: 1em; 
    border: 0.075em solid #7C92A6; 
}

form fieldset p {
    margin: 0.05em;
}

fieldset td {
    padding: 0.15em;
}

/* Form */
#advanced-box {
    padding: 0.15em 0;
}

.form-row {
    display: flex;
    justify-content: flex-end;
    padding: 0.5em;
}

.text-only {
    justify-content: flex-start;
    padding: 0.1em 0.3em; 
}

.text-only > span {
    font-size: 1.2em;
}

.top-search {
    padding: 0.1em 0.3em 0.3em 0.3em; 
}

.form-row > label {
    padding: 0.5em 1em 0.5em 0;
    flex: 1;
}

.form-row > input {
    font-size: 0.8em;
    background-color: rgb(255, 255, 255);
    height: 3em;
    border: 0.05em solid #7C92A6;
    padding: 0 0.4em;
    border-radius: 0.4em;
    flex: 2;
}

.form-row > input:focus {
    background-color: rgb(255, 255, 255);
    border: 0.05em solid #7C92A6; 
    outline: none;
}

.bigbutton {
    background: #7C92A6;
    font-size: 1.4em;
    padding: 0.2em 1em; 
    color: white;
    border: 0;
    border-radius: 0.3em; 
    width: 50%;
    margin-top: 0.5em;
    margin-left: 0.5em; 
}

.bigbutton:hover {
    background: #6d8092;
}

.top-search > button {
    margin-top: 0.5em; 
}

.resetbutton {
    background-color: #F58F89;
    margin-left: 0;
}

.resetbutton:hover {
    background-color: #dd817c;
}

.linkButton:hover {
    background-color: #6d8092;
}

.linkButton {
    background: #7C92A6;
    color: white;
    text-decoration: none;
    margin-left: 0.5em; 
    margin-top: 0.2em; 
    margin-bottom: 0.2em; 
    padding: 0.3em 1em; 
    display: inline-block;
    font-weight: bold;
    border-radius: 0.3em;
}

#sortrelevance {
    text-align: right;
}

.fieldset_table td {
    border: none;
}

button#add {
    font-size: 0.8em;
    height: 3em;
}

button#add span {
    font-size: 1.6em;
}

#addArticleForm .form-row {
    padding: 0.05em 0.25em;
    justify-content: left;
}

/* Table */
table {
    border-collapse: collapse;
    word-break: break-word;
}

/* column size */
th {
    word-break: keep-all;
}

@media (min-width: 451px) {
    th a {
        font-size: 1.1em;   
    }
    table {
        font-size: 1em;
    }
    table .colAuthor {
        max-width: 10%;
    }
    td {
        padding: 0.375em 0.25em; 
    }

    a.externalUrl {
        padding: 0.2em 0.4em; 
    }

    .colUrl {
        /* min-width needed for compatibility with firefox, width for compatibility with chrome */
        width: 30pt;
        min-width: 30pt;
    }
    .colYear {
        width: 2.8125em; 
    }
}

/* For very small screens */
@media (max-width: 450px) {
    a.externalUrl {
        padding: 0.0625em; 
    }
    th a {
        font-size: 0.9em;
    }
    table {
        font-size: 0.8em;
    }
    td {
        padding: 0.375em 0.0625em; 
    }
    .colTitle {
        width: 12.5em; 
    }
    .colUrl {
        min-width: 2.5em; 
    }
    .colYear {
        min-width: 1.875em; 
    }
}

/* Additional adjustments for max-width: 901px */
@media (max-width: 901px) {
    .colTitle {
        min-width: 30%;
    }
}

@media (max-height: 640px) {
    #add-box {
        display: none; /* Hide the #add-box on smaller screens */
    }
}

td {
    vertical-align: top;
    border-bottom: 0.05em solid #CEE1F2; 
    margin: 0;
}

/* add stripes to table */
#tablehead:nth-child(odd) {
    background-color: rgb(255, 255, 255);
}

/* Hover over table rows */
#tablehead:hover td {
    background: #6d8092;
}

/* make table header look nice */
th {
    text-align: left;
    color: rgb(255, 255, 255);
    background-color: #7C92A6;
    border-color: rgb(255, 255, 255);
    position: sticky;
    padding: 0;
    top: 0;
}

table a {
    color: rgb(255, 255, 255);
    text-decoration: none;
}

th a {
    display: block;
    padding: 0.3em 0.625em; 
}

th:hover {
    background-color: #6d8092;
}

.clickable:hover {
    background-color: #e4f3ff;
    cursor: pointer;
}

a.externalUrl {
    color: rgb(255, 255, 255);
    background: #7C92A6;
}

a.externalUrl:hover {
    background-color: #6d8092;
}

.typeicon {
    width: 1.2em;
    height: 1.2em;
}

.hidden_row {
    display: none;
    background-color: #f3faff;
}

.hidden_content {
    padding: 0.3125em 0.3125em; 
    font-size: 1.1em;
    margin-left: 0.9375em; 
    margin-right: 0.9375em; 
    text-align: justify;
}

.hidden_left {
    background-color: #7C92A6;
}

/* Admin Header */
.header {
    background-color: #CEE1F2;
    border: 0;
    font-size: 1.2em;
    padding: 0.9375em 0;
}

@media (min-width: 902px) {
    .header {
        display: flex;
        padding: 1.25em 3.75em; 
    }

    .center-top {
        text-align: center;
    }
}
.left,
.right,
.center {
    flex: 1;
    max-width: 15.625em; 
    margin: 0 auto;
}

mark {
    background-color: #fff89a;
}

.hiddenRowContent {
    display: none;
}

.tableUrl {
    white-space: nowrap;
}

#sourcecode {
    background: #CEE1F2;
    color: black;
    text-decoration: none;
    margin-left: 0.3125em; 
    margin-bottom: 0.125em; 
    padding: 0.4em 1em; 
    display: inline-block;
    font-weight: bold;
    border-radius: 0.25em; 
}
