html, body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    font-style: normal;
    font-weight: 400;
}
/* Ensure Arial is used across common UI elements */
body, input, select, textarea, button,
.navbar, .panel, .list-group, .table,
.headline, .filter_cat a.cat-item, .filter_content_container a.doc-item {
    font-family: Arial, Helvetica, sans-serif;
}
body {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}
img.loadericon {
    max-width: 100%;
}
.navbar {
    background-color: #ffffff;
    border-radius: 0;
    margin-bottom: 0;
    min-height: 50px;
    z-index: 1;
}
.navbar .navbar-nav > li > a {
    color: #5e5e5d;
    background-color: transparent;
    font-weight: 500;
}
.navbar .navbar-brand {
    display: inline-block;
    padding: 5px 0px;
}
.navbar .navbar-brand img {
    max-height: 40px;
    display: block;
}

#langDropdown {
    z-index: 1000;
    position: relative;
}

#langDropdown .lang-flag img {
    width: 18px;
    height: 12px;
    margin-right: 6px;
    vertical-align: text-bottom;
}

#langDropdown .dropdown-menu {
    z-index: 1001 !important;
}

#langDropdown .dropdown-menu > li > a img {
    width: 18px;
    height: 12px;
    margin-right: 6px;
    vertical-align: text-bottom;
}

.back-button {
    display: inline-block;
    padding: 10px;
    text-decoration: none;
}

.back-button img {
    height: 30px;
    width: auto;
}

#btnBackPub.disabled {
    /*
    opacity: 0.8;
    cursor: not-allowed;
    */
    display: none;
}

.main-content {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    
}
#btnBackPub.disabled {
    /*
    opacity: 0.8;
    cursor: not-allowed;
    */
    display: none;
}

/* Filter Panel Styles */
.popin{
    position: absolute;
    width:330px;
    left: -330px;
    top: 0;
    bottom: 0;
    color: #5e5e5d;
    z-index: 9;
    box-shadow: 5px 5px 10px rgba(0,0,0,0.2);
    background-color: #ffffff;

    -moz-transition:all 0.4s ease;
    -webkit-transition:all 0.4s ease;
    -o-transition:all 0.4s ease;
    transition:all 0.4s ease;
	
}
.popin.open {
    left: 0;
}

.popin .close-button {
    position: absolute;
    top: 5px;
    right: 5px;
}
.popin .close-button span{
    color: #5e5e5d;
    margin: 5px;
    margin-right: 15px;
    font-size: 2em;
}

#filterPopin > .nav-tabs {
    position: absolute;
    left: 100%;
    top: -40px;
    width: 100%;
    height: 40px;
    margin-top: 10px;
    transform-origin: 0% 100%;
    transform: rotate(90deg);
    border-bottom: 0 none;
}

#filterPopin > .nav-tabs > li > a {
    background-color: white;
    color: #000000 !important;
    font-weight: bold;
    cursor: pointer;
    border-width: 1px 1px 0px 1px;
    border-style: solid;
    border-color: #5e5e5d;
}

.popin .headline {
    font-size: 26px;
    vertical-align: top;
    padding-left: 20px;
    line-height: 50px;
    color: #000000;
}

.popin .buttonDivider {
    width: 100%;
    height: 1px;
    vertical-align: top;
    border-bottom: 1px solid #cccccc;
    margin-bottom: 2px;
}

.searchInput {
    padding: 10px 20px;
    position: relative;
    height: 54px;
}

.searchInput .searchIcon {
    position: absolute;
    left: 25px;
    top: 0px;
    color: #5e5e5d;
    font-size: 18px;
    line-height: 54px;
}

    .searchInput .removeIcon {
        position: absolute;
        right: 48px;
        top: 0px;
        color: #5e5e5d;
        font-size: 24px;
        line-height: 54px;
        cursor: pointer;
    }
    .searchInput .btnAdvSearch {
        position: absolute;
        right: 8px;
        top: 0px;
        font-size: 14px;
        line-height: 54px;
        cursor: pointer;
    }

    .searchInput input {
        padding-left: 32px;
        padding-right: 32px;
        width: 270px;
    }

.searchAdv {
    padding: 10px 20px;
    position: relative;
    height: 124px;
    background-color: rgba(0,0,0,0.2);
    display: none;
}

    .searchAdv .form-group {
        margin-bottom: 4px;
    }

        .searchAdv .form-group:first-child {
            margin-bottom: 8px;
        }

    .searchAdv label {
        font-size: 12px;
        line-height: 32px;
        text-align: right;
        padding-top: 0 !important;
    }

    .searchAdv .checkbox {
        line-height: 20px;
        padding-top: 0;
    }

        .searchAdv .checkbox label {
            display: block;
            position: relative;
            padding-left: 35px;
            cursor: pointer;
            font-size: 12px;
            line-height: 22px;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            text-align: left !important;
        }

        .searchAdv .checkbox input {
            position: absolute;
            opacity: 0;
            cursor: pointer;
            height: 0;
            width: 0;
        }

        .searchAdv .checkbox input:checked ~ .checkmark {
            background-color: #ffffff;
            border-color: #5e5e5d;
        }

        .searchAdv .checkbox .checkmark {
            position: absolute;
            top: 0;
            left: 0;
            height: 20px;
            width: 20px;
            background-color: #eee;
            border-radius: 4px;
        }

            .searchAdv .checkbox .checkmark:before,
            .searchAdv .checkbox .checkmark:after {
                content: "";
                position: absolute;
                display: none;
                width: 12px;
                height: 2px;
                background-color: #e42612; /* CT Red */
                left: 3px;
                top: 9px;
                border-radius: 1px;
            }

        .searchAdv .checkbox input:checked ~ .checkmark:before,
        .searchAdv .checkbox input:checked ~ .checkmark:after {
            display: block;
        }

        .searchAdv .checkbox .checkmark:before {
            transform: rotate(45deg);
        }
        .searchAdv .checkbox .checkmark:after {
            transform: rotate(-45deg);
        }

.popin .listContainer {
    position: absolute;
    top: 110px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px;
}

.popin .listContainer p {
    color: #5e5e5d;
    font-size: 14px;
    margin-bottom: 15px;
}

#accordionFilter .panel-heading a {
    color: #ffffff;
}

#accordionFilter .panel-heading {
    background-color: #e42612;
    border-color: #e42612;
}

#accordionFilter .list-group-item.active{
    background-color: #e42612;
    border-color: #e42612;
    color: #ffffff;
}

#accordionFilter .list-group-item{
    color: #000000;
    background-color: #ffffff;
    border-color: #ddd;
}

#accordionFilter .list-group-item:hover{
    background-color: #f5f5f5;
    color: #5e5e5d;
}

#accordionFilter .sub-categories {
    border-left: 2px solid #e42612;
    margin-left: 15px;
    padding-left: 10px;
    background-color: #ffffff;
}

#accordionFilter .sub-item {
    font-size: 12px;
    padding: 8px 15px;
    border-left: none;
    border-top: none;
    border-right: none;
    border-bottom: 0 none;
    background-color: #ffffff;
    display: block;
    text-decoration: none;
    color: #5e5e5d;
}

#accordionFilter .sub-item:last-child {
    border-bottom: none;
}

#accordionFilter .sub-item:hover {
    background-color: #f9f9f9;
    color: #5e5e5d;
}

#accordionFilter .sub-item.active {
    background-color: #e42612;
    border-color: #e42612;
    color: #ffffff;
    font-weight: bold;
}

#accordionFilter .list-group-item.active {
    background-color: #e42612;
    border-color: #e42612;
    color: #ffffff;
    font-weight: bold;
}

/* Main content with side panel */
.cat_container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    text-align: center;
    padding: 20px;
    background-color: #fff;
    box-shadow: inset 0px 2px 20px rgba(0,0,0,0.3);
    border-radius: 0;
}

.filter_cat,
.filter_content {
    position: absolute;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    overflow-x: hidden;
    overflow-y: auto;
    text-align: center;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: inset 0px 2px 20px rgba(0,0,0,0.3);
    border-radius: 0;
}

.filter_cat.has-side, .filter_content.has-side {
    left: 330px;
}

.filter_cat_container, .filter_content_container{
    padding-top: 20px;
}

.headline {
    font-size: 24px;
    color: #5e5e5d;
    padding-bottom: 20px;
    font-weight: 700;
}

.filter_cat a.cat-item {
    display: inline-block;
    width: 180px;
    min-height: 284px;
    padding: 5px;
    margin: 15px;
    vertical-align: top;
    color: #5e5e5d;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid #ccc;
    background-color: #fff;
    box-shadow: 2px 5px 10px rgba(0,0,0,0.2);
    position: relative;
    -moz-transition: all 0.2s ease;
    -webkit-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

    .filter_cat a.cat-item:hover {
        box-shadow: 2px 8px 12px rgba(0,0,0,0.3);
        -ms-transform: scale(1.1, 1.1);
        -webkit-transform: scale(1.1, 1.1);
        transform: scale(1.1, 1.1);
        transform-origin: center bottom;
    }

    .filter_cat a.cat-item img {
        width: 170px;
        height: 210px;
        object-fit: contain;
    }

    .filter_cat a.cat-item > .title {
        font-weight: 700;
        padding-top: 5px;
        display: block;
        overflow: visible;
        min-height: 3em;
        line-height: 1.2;
        word-wrap: break-word;
        word-break: break-word;
    }

    .filter_cat a.cat-item .cat_icon {
        position: absolute;
        right: -16px;
        top: -18px;
        font-size: 24px;
        color: #e42612;
    }

    .filter_content_container a.doc-item {
        display: inline-block;
        width: 160px;
        min-height: 260px;
        padding: 5px;
        margin: 1.5em 5px;
        margin-top: 2em; /* Increased top margin to accommodate badge above */
        vertical-align: top;
        color: #5e5e5d;
        text-decoration: none;
        font-size: 12px;
        font-weight: 400;
        border: 1px solid #ccc;
        background-color: #fff;
        box-shadow: 2px 5px 10px rgba(0,0,0,0.2);
        position: relative;
        -moz-transition: all 0.2s ease;
        -webkit-transition: all 0.2s ease;
        -o-transition: all 0.2s ease;
        transition: all 0.2s ease;
    }

    .filter_content_container a.doc-item:hover {
        box-shadow: 2px 8px 12px rgba(0,0,0,0.3);
        -ms-transform: scale(1.1, 1.1);
        -webkit-transform: scale(1.1, 1.1);
        transform: scale(1.1, 1.1);
        transform-origin: center bottom;
    }

    .filter_content_container a.doc-item img {
        width: 150px;
        height: 190px;
        object-fit: contain;
    }
    .filter_content_container a.doc-item .badge-new {
        position: absolute;
        left: 0;
        right: 0;
        top: -16px; /* places the badge just above the card, leaving a small gap */
        background-color: #e42612; /* CT Red */
        color: #ffffff;
        font-weight: 700;
        font-size: 12px;
        line-height: 20px;
        padding: 2px 0;
        text-align: center;
        text-transform: uppercase;
        border-radius: 2px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .filter_content_container a.doc-item > div.title {
        padding-top: 5px;
        display: block;
        overflow: visible;
        min-height: 3em;
        word-wrap: break-word;
        word-break: break-word;
    }
    .filter_content_container a.doc-item:hover > div.title {
        position: absolute;
        left: 5px;
        right: 5px;
        bottom: 5px;
        display: block;
        background-color: rgba(255, 255, 255, 0.8);
    }

        .filter_content_container a.doc-item > div.doc-link {
            position: absolute;
            left: 0;
            right: 0;
            width: 100%;
            bottom: -1.7em;
            font-size: 1.5em;
            z-index: 0; /* Ensure buttons are above the badge */
        }
            .filter_content_container a.doc-item > div.doc-link i {
                cursor: pointer;
                margin: 2px 4px;
            }
                .filter_content_container a.doc-item > div.doc-link i:hover {
                    color: #e42612;
                }
    .filter_content_container table {
        width: 100%;
        background-color: #fff;
    }
    .filter_content_container tr.doc-item {
        cursor: pointer;
    }
        .filter_content_container tr.doc-item td {
            padding: 10px;
            text-align: left;
        }
        .filter_content_container tr img {
            max-width: 100px;
            max-height: 100px;
            object-fit: contain;
            border: 1px solid #ccc;
            box-shadow: 1px 1px 6px rgba(0,0,0,0.3);
        }
    .filter_content_container.no-thumb tr td:first-child{
        display: none;
    }
    .filter_content_container td h4 {
        margin: 0 0 5px 0;
        font-size: 16px;
        font-weight: 700;
        text-align: left;
    }
.filter_content_container td h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: hsl(0, 99%, 48%); /* CT Red */
    font-weight: 900;
    text-align: left;
}
.filter_content_container td p {
    margin: 0;
    font-size: 12px;
    text-align: left;
}
.filter_content_container .highlight {
    background-color: #ffff00;
} 
.text-danger {
    color: #a94442;
    text-align: center;
    padding: 20px;
    font-size: 16px;
    font-weight: 400;
}

.autocomplete-suggestions {
    border: 1px solid #5e5e5d;
    border-top: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.autocomplete-suggestion {
    padding: 10px 20px;
    white-space: nowrap;
    overflow: hidden;
}

.autocomplete-selected {
    background: #F0F0F0;
}

.autocomplete-suggestions strong {
    font-weight: normal;
    color: #3399FF;
}

.autocomplete-group {
    padding: 2px 5px;
}

    .autocomplete-group strong {
        font-weight: bold;
        font-size: 16px;
        color: #FF0000;
        display: block;
        border-bottom: 1px solid #000;
    }

@media (max-width: 767px) {
    .navbar-nav > li > a {
        padding-left: 50px;
    }

    .filter_cat, .filter_content {
        padding: 50px 5px 50px 5px;
    }

        .filter_cat a.cat-item > .title {
            line-height: 1.2;
            word-wrap: break-word;
            text-align: center;
            display: block !important;
            overflow: visible !important;
        }
        .filter_cat a.cat-item {
            max-width: 42vw;
            margin: 5px;
            min-height: 30vh;
            font-size: 16px;
        }

            .filter_cat a.cat-item img {
                width: 100%;
                height: 20vh;
                margin-bottom: 5px;
            }

    .filter_content_image {
        display: none !important;
    }

        .filter_content_image img {
            max-width: 100%;
        }
    .headline{
        padding-top: 20px;
    }
}

