﻿/* FOR TESTING ONLY */
/*table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}    
    .textbox {
    outline: 2px solid blue;
}
.srchtable {
    outline: 2px solid yellow;
}

.searchbox-wrap {
    outline: 2px solid red;
}
.submit-button {
    outline: 2px solid green;
}*/

.searchtitle{
    color:brown; 
}
.search-logo {
    height: 125px;
    width: auto;
    /*max-width: 100%;*/
    object-fit: contain;
    align-self: center;
    display: inline-block;
}

.search-logo-cell {
    /*width:25%;*/
    text-align: right;
}


.simplesearch {
    display: block;
    min-height: auto;
    padding: 24px 12px;
}


.searchbox-wrap {
    position: relative;
    flex: 1 1 500px;
}

    .searchbox-wrap .textbox {
        /*padding-right: 45px;*/
    }
    /* space for icon */
    /*.searchbox-wrap .submit-button {
        position: absolute;
        right: 8px;
        top: 40%;*/
        /*transform: translateY(-1%);*/
        /*margin-left: 0;
    }*/


@media (min-width: 992px) {
    .simplesearch {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }
}

.centercontrol {
    display: flex;
    justify-content: center;
}


.srchtable {
    width: 100%;
    /* max-width: 1200px;*/
    min-width: 0;
    table-layout: fixed;
    box-sizing: border-box;
    margin: 0 auto;
    position: sticky;
    top: 0;
    z-index: 1000;
    
}

    .srchtable td,
    .srchtable th {
        padding: 10px;
        margin: 0;
        /*box-sizing: border-box;*/
    }
        /*.srchtable td.logo-cell {
            text-align: right;
        }
*/

.table-adv-header {
    border-collapse: separate;
    border-spacing: 10px;
    align-content:baseline;
}

.form-control, .search, .textbox {
    margin: 1px 0;
    padding: 2px 4px;
}

.inline-input {
    display: inline-block;
    width: 48%;
    margin-right: 2%;
    box-sizing: border-box;
}

.metafield {
    width: 200px;
}

.CheckboxList label {
    margin-left: 10px;
    font-weight: 200;
    font-size: 12px;
}

.RadioList label {
    margin-left: 3px;
    margin-right: 10px;
    font-weight: 200;
    font-size: 11px;
}



.search {
    display: inline-block;
    box-sizing: border-box;
    line-height: 20px;
    border-radius: 50px;
    -moz-border-radius: 50px;
    -webkit-border-radius: 50px;
    height: 30px;
    vertical-align: middle;
    padding: 12px 20px;
}



.textbox {
    border-color: lightgrey;
    width: 100%;
    max-width: 1100px;
}

    .searchbox-wrap .textbox {
        width: 100%;
        padding-right: 45px; /* creates space INSIDE input */
        box-sizing: border-box;
    }

.searchbox-wrap .submit-button {
    position: absolute;
    right: 2px;
    top: 70%;
    transform: translateY(-90%);
    width: 35px;
    height: 30px;
}

.submit-button {
    background-image: url("https://cdn1.iconfinder.com/data/icons/hawcons/32/698627-icon-111-search-256.png");
    line-height: inherit;
    text-decoration: none;
    cursor: pointer;
    background-position: 5px;
    background-repeat: no-repeat;
    background-size: 20px;
    background-color: transparent;
    margin-left: -45px;
    border: none;
}

.resultslabel {
    font-size: 14px;
    color: #808080ff;
    margin-left: -100px;
}

.button-as-hyperlink {
    appearance: none;
    -webkit-appearance: none;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: steelblue !important;
    text-decoration: underline !important;
    cursor: pointer;
    font: inherit;
    line-height: inherit;
}

    .button-as-hyperlink:focus {
        outline: 2px solid rgba(0,0,0,0.2);
        outline-offset: 2px;
    }

.hyperlink {
    text-decoration: none;
    color: steelblue;
}

.headerlabel {
    font-size: 16px;
    margin-left: 10px;
}

.error-message {
    color: #dc3545;
    font-style:normal;
    padding: 10px 15px;
}
.info-message {
    color: #6495ED;
    font-style: italic;
    padding: 10px 15px;
}

.scrollable-gridview {
    max-height: 65vh;
    overflow-y: auto;
}


    .scrollable-gridview table thead th {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
    }

.lb-outerContainer {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    border-radius: 4px;
    background-color: #fff;
}

/* instead of .container */
.search-container {
    width: 95vw;
    /*    height: 80vw;*/
    height: auto;
    margin: 0 auto;
    padding: 15px;
}


.lb-close, lb.details {
    position: absolute;
    top: -35px;
    width: 100%;
}

#uvOverlay {
    display: none;
    top: 0;
    left: 0;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7) !important;
    z-index: 9999;
}

.body {
    position: relative;
    min-height: 100%;
}

#uv {
    position: relative;
    min-height: 400px;
    display: block;
    width: 80vw;
    height: 80vh;
    margin: 40px auto;
    background: #fff;
    z-index: 10000;
}

#btnClose {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10001;
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

    #btnClose:hover {
        background-color: #c82333;
    }

/* The sidebar menu */
.srchsidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: #000000;
    overflow-x: hidden;
    padding-top: 60px;
    transition: 0.5s;
}

    .srchsidebar a {
        padding: 8px 8px 8px 32px;
        text-decoration: none;
        font-size: 15px;
        color: #818181;
        display: block;
        transition: 0.3s;
    }

    .srchsidebar button {
        width: 100%;
    }

    .srchsidebar p {
        color: #f1f1f1;
    }

    .srchsidebar h4 {
        color: #fff;
    }

    .srchsidebar a:hover {
        color: #f1f1f1;
    }

    .srchsidebar .closebtn {
        position: absolute;
        top: 0;
        right: 25px;
        font-size: 36px;
        margin-left: 50px;
    }

#main {
    transition: margin-left .5s;
    padding: 16px;
}

.hide {
    display: none !important;
}

.show {
    display: block !important;
}

.showinline {
    display: inline !important;
}

.showinline {
    display: block !important;
}

.download {
    display: none;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
/* Tablets (portrait and landscape) */
@media (max-width: 1024px) {
    /* Tablets: keep desktop-like width, but avoid overflow */
    .textbox {
        max-width: 900px;
    }

    .metafield {
        width: 220px;
    }
}
/* Tablets (portrait) and small devices */
@media (max-width: 768px) {
    .textbox {
        width: 100%;
        max-width: 100%;
    }

    .metafield {
        width: 100%;
        max-width: 100%;
    }

    .inline-input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .search-container {
        width: 98vw;
        padding: 10px;
    }

    #uv {
        width: 90vw;
        height: 75vh;
        margin: 20px auto;
    }

    /* Better touch targets for tablets */
    .btn, select, .dropdown {
        min-height: 40px;
        padding: 8px 12px;
    }

    /* Improved checkbox spacing for touch */
    .CheckboxList label {
        padding: 8px 0;
        display: inline-block;
    }
}
@media (max-width: 900px) {
    .results-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }
    .search-logo {
        height:36px;
        width:auto;
    }
    .results-logo {
        height: 36px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
        align-self: center;
    }

    .results-header .textbox,
    .searchbox-wrap,
    .textbox {
        /*width: 100% !important;*/
        max-width: 100% !important;
        flex: 1 1 auto;
        box-sizing: border-box;
    }

    table.results-header-table,
    table.results-header-table tbody,
    table.results-header-table tr,
    table.results-header-table td {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

        table.results-header-table img {
            max-width: 100%;
            height: 36px;
            width: auto;
        }

        table.results-header-table input[type="text"],
        table.results-header-table .textbox {
            width: 100% !important;
            max-width: 100% !important;
        }
}



/* Small tablets and large phones (portrait) */
@media (max-width: 600px) {
    .textbox {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 10px 15px;
    }

    .search {
        padding: 10px 15px;
        font-size: 16px;
    }

    .submit-button {
        width: 32px;
        background-size: 18px;
        margin-left: -40px;
    }

    #uv {
        width: 95vw;
        height: 70vh;
        margin: 15px auto;
    }

    #btnClose {
        top: 5px;
        right: 5px;
        padding: 6px 12px;
        font-size: 13px;
    }

    .search-container {
        width: 100vw;
        padding: 8px;
    }

    #main {
        padding: 10px;
    }

    /* Ensure images scale properly */
    .img-fluid {
        max-width: 100%;
        height: auto !important;
    }
}



/* Only apply aggressive mobile styles on very small screens */
@media (max-width: 480px) {
    .headerlabel {
        font-size: 14px;
        margin-left: 5px;
    }

    .table {
        font-size: 13px;
    }

        .table td,
        .table th {
            padding: 6px;
        }

    #uv {
        width: 98vw;
        height: 65vh;
        margin: 10px auto;
    }

    .srchsidebar a {
        padding: 6px 6px 6px 16px;
        font-size: 14px;
    }
}

/* Very small phones */
@media (max-width: 320px) {
    #uv {
        width: 100vw;
        height: 50vh;
        margin: 5px auto;
    }

    .headerlabel {
        font-size: 12px;
    }

    #btnClose {
        padding: 4px 8px;
        font-size: 11px;
    }
}
/* results wrappers*/
.results-wrap {
    max-width: 1200px;
    margin: 0 auto;
}
    /* Remove ONLY the first table row top border (the one under the header) */
    .results-wrap .table > tbody > tr:first-child > td {
        border-top: none;
    }
/* Make the header align to the same left/right edges as the table below */
.results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.results-logo {
    height: 50px;
    display: block;
}
/* Let the textbox take remaining space */
.results-header .textbox {
    flex: 1 1 500px;
    width: 100%;
    max-width: none; /* override the 660px cap if you want it wider */
}
/* Scroll container */
.journal-scroll {
    height: 200px;
    overflow-y: auto;
    padding: 8px 6px;
    background-color: #f2f2f2;
    border-radius: 4px;
    /* inset look */
    background: #ededed;
    border: 1px solid #aaa;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

    .journal-scroll::before,
    .journal-scroll::after {
        content: none;
    }


    /* Chrome / Edge / Safari */
    .journal-scroll::-webkit-scrollbar {
        width: 14px;
    }

    .journal-scroll::-webkit-scrollbar-track {
        background: #e0e0e0;
    }

    .journal-scroll::-webkit-scrollbar-thumb {
        background-color: #666;
        border-radius: 6px;
        border: 3px solid #e0e0e0;
    }

        .journal-scroll::-webkit-scrollbar-thumb:hover {
            background-color: #444;
        }

/* Mobile: force GridView thumbnails to a single column */
@media (max-width: 600px) {

    /* Target the table inside your scrollable gridview */
    .scrollable-gridview table,
    .scrollable-gridview tbody,
    .scrollable-gridview tr,
    .scrollable-gridview td {
        display: block;
        width: 100% !important;
    }

    /* Optional: hide table header (usually useless on mobile for thumbnail grids) */
    .scrollable-gridview thead {
        display: none;
    }

    .scrollable-gridview td {
        padding: 8px 0;
        border-top: 1px solid #ddd;
    }

    /* Make images fill the available width instead of shrinking */
    .scrollable-gridview img {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
        display: block;
    }
}
table.results-header-table {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-collapse: collapse;
    
}

    table.results-header-table td {
        padding: 6px 12px;
        white-space: nowrap;
        vertical-align: middle;
    }
/* Phones: make the results header table stack (prevents horizontal scroll) */
@media (max-width: 900px) {
    table.results-header-table,
    table.results-header-table tbody,
    table.results-header-table tr,
    table.results-header-table td {
        display: block;
        width: 100%;
    }

    table.results-header-table td {
            padding: 6px 0;
            white-space: normal;
    }
}




/* ===== Mobile fix: Advanced Search — stacking with visible labels ===== */
@media (max-width: 900px) {

    /* --- Shared: any table inside divSearch2 that uses data-label on input cells --- */

    /* Collapse all table structure to block so rows stack vertically */
    #divSearch2 table.table,
    #divSearch2 table.table tbody,
    #divSearch2 table.table tr,
    #divSearch2 table.table td,
    #divJournalSearch table,
    #divJournalSearch table tbody,
    #divJournalSearch table tr,
    #divJournalSearch table td,
    #divExhibitSearch table,
    #divExhibitSearch table tbody,
    #divExhibitSearch table tr,
    #divExhibitSearch table td,
    #divBookSearch table,
    #divBookSearch table tbody,
    #divBookSearch table tr,
    #divBookSearch table td,
    #divMapSearch table,
    #divMapSearch table tbody,
    #divMapSearch table tr,
    #divMapSearch table td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Hide pure-label rows in the inner tables only (not outer .table rows).
       Targets only tables that are descendants of a td, i.e. the nested inner tables. */
    #divJournalSearch td > table tr:not(:has(td[data-label])),
    #divExhibitSearch td > table tr:not(:has(td[data-label])),
    #divBookSearch td > table tr:not(:has(td[data-label])),
    #divMapSearch td > table tr:not(:has(td[data-label])) {
        display: none !important;
    }

    /* Each input td: label appears via ::before above the control */
    td[data-label]:not([data-label=""]) {
        padding: 4px 0 10px !important;
        border: none !important;
    }

        td[data-label]:not([data-label=""])::before {
            content: attr(data-label);
            display: block;
            font-size: 11px;
            font-weight: 600;
            color: #555;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-bottom: 3px;
        }

    /* Trash-icon cell in repeater: no label, right-align */
    td[data-label=""] {
        padding: 4px 0 !important;
        border: none !important;
        text-align: right;
    }

    /* --- Repeater criteria rows: each <tr> becomes a card --- */
    #divSearch2 table.table tr {
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 14px;
        background: #fff;
    }

        /* Hide the static header row in the repeater table (no data-label attrs) */
        #divSearch2 table.table tr:not(:has(td[data-label])) {
            display: none !important;
        }

    /* --- Outer wrapper rows in metadata divs: section heading + inner table --- */
    /* The outer .table > tr > td:first-child is the section label ("Issue Identifiers" etc.) */
    #divJournalSearch > table.table > tbody > tr > td:first-child,
    #divExhibitSearch > table.table > tbody > tr > td:first-child,
    #divBookSearch > table.table > tbody > tr > td:first-child,
    #divMapSearch > table.table > tbody > tr > td:first-child {
        font-weight: 700;
        font-size: 13px;
        color: #333;
        border-bottom: 2px solid #ccc !important;
        padding: 8px 0 6px !important;
        margin-bottom: 4px;
    }

    /* Remove border from the colspan cell that wraps the inner table */
    #divJournalSearch > table.table > tbody > tr > td:last-child,
    #divExhibitSearch > table.table > tbody > tr > td:last-child,
    #divBookSearch > table.table > tbody > tr > td:last-child,
    #divMapSearch > table.table > tbody > tr > td:last-child {
        border: none !important;
        padding: 0 !important;
    }

    /* --- All controls fill available width --- */
    #divSearch2 table.table select,
    #divSearch2 table.table input,
    #divSearch2 table.table .form-control,
    #divSearch2 table.table .btn,
    #divJournalSearch table input,
    #divJournalSearch table select,
    #divExhibitSearch table input,
    #divExhibitSearch table select,
    #divBookSearch table input,
    #divBookSearch table select,
    #divMapSearch table input,
    #divMapSearch table select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Year-range pairs: each field stacks full width */
    .inline-input {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 4px;
        display: block;
    }
}

.ui-autocomplete {
    background: #fff;
    opacity: 1;
    z-index: 9999;
}

    .ui-autocomplete .ui-menu-item-wrapper {
        background: #fff;
    }
