﻿/* BTI database: list, filters, tiles and the EU keyword multiselect. Colours follow the portal
   primary (#204391, --primary in global.css). */

.bti-page {
    --bti-primary: #204391;
    --bti-primary-dark: #172f66;
    --bti-primary-soft: #eef2fa;
    --bti-yellow: #ffd12e;
    --bti-border: #dee2e6;
    --bti-muted: #6c757d;
}

/* ---------- CEFTA branding ---------- */

/* Page header in the CEFTA blue with the yellow accent line used across the portal. */
.bti-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    border-radius: .75rem;
    padding: 1.5rem 1.5rem 1.75rem;
    background:
        radial-gradient(circle at 92% -20%, rgba(255, 209, 46, .22) 0, rgba(255, 209, 46, 0) 45%),
        radial-gradient(circle at 70% 140%, rgba(255, 255, 255, .10) 0, rgba(255, 255, 255, 0) 50%),
        linear-gradient(120deg, var(--bti-primary-dark) 0%, var(--bti-primary) 55%, #2d5bbf 100%);
    box-shadow: 0 .5rem 1.5rem rgba(23, 47, 102, .18);
}

.bti-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--bti-yellow);
}

.bti-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--bti-yellow);
    margin-bottom: .35rem;
}

.bti-hero-title {
    font-size: calc(1.4rem + 1vw);
    font-weight: 300;
    line-height: 1.15;
    margin: 0;
}

@media (min-width: 1200px) {
    .bti-hero-title {
        font-size: 2.25rem;
    }
}

.bti-hero-subtitle {
    color: rgba(255, 255, 255, .8);
    margin: .5rem 0 0;
    max-width: 48rem;
}

.bti-hero .breadcrumb {
    --bs-breadcrumb-divider-color: rgba(255, 255, 255, .6);
    --bs-breadcrumb-item-active-color: rgba(255, 255, 255, .85);
    margin-bottom: .5rem;
    font-size: .8125rem;
}

.bti-hero .breadcrumb a {
    color: #fff;
    text-decoration: none;
}

.bti-hero .breadcrumb a:hover {
    text-decoration: underline;
}

/* Portal language menu (_BTILanguageSelect): a glass pill in the hero's top corner. */
.bti-hero .bti-lang {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: .4rem;
    width: fit-content;
    margin: -.5rem -.5rem .75rem auto;
    padding: .2rem .3rem .2rem .65rem;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: .85rem;
}

.bti-hero .bti-lang:focus-within {
    border-color: var(--bti-yellow, #ffd12e);
}

.bti-hero .bti-lang-select {
    padding: .15rem 1.6rem .15rem .25rem;
    border: 0;
    border-radius: 999px;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right .45rem center / .7rem;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
}

.bti-hero .bti-lang-select:focus {
    outline: 0;
}

/* The open list is drawn by the browser on white. */
.bti-hero .bti-lang-select option {
    color: #212529;
}

@media (min-width: 992px) {
    .bti-hero .bti-lang {
        position: absolute;
        top: 1rem;
        right: 1rem;
        margin: 0;
    }
}

/* Main action: CEFTA yellow on blue. */
.btn-cefta {
    --bs-btn-color: var(--bti-primary-dark, #172f66);
    --bs-btn-bg: var(--bti-yellow, #ffd12e);
    --bs-btn-border-color: var(--bti-yellow, #ffd12e);
    --bs-btn-hover-color: var(--bti-primary-dark, #172f66);
    --bs-btn-hover-bg: #ffdc5c;
    --bs-btn-hover-border-color: #ffdc5c;
    --bs-btn-active-color: var(--bti-primary-dark, #172f66);
    --bs-btn-active-bg: #f2c200;
    --bs-btn-active-border-color: #f2c200;
    --bs-btn-focus-shadow-rgb: 255, 209, 46;
    font-weight: 600;
}

.bti-hero .btn-outline-light {
    --bs-btn-hover-color: var(--bti-primary);
    --bs-btn-active-color: var(--bti-primary);
    border-color: rgba(255, 255, 255, .6);
}

/* Filter and table cards carry a thin CEFTA blue top edge. */
.bti-filter,
.bti-table-card {
    border-top: 3px solid var(--bti-primary);
}

/* ---------- filters ---------- */

.bti-filter {
    border-color: var(--bti-border);
    border-radius: .75rem;
}

.bti-filter .form-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--bti-muted);
    margin-bottom: .25rem;
}

.bti-filter .card-footer {
    border-top-color: var(--bti-border);
}

.bti-more-toggle {
    color: var(--bti-primary);
    font-weight: 600;
}

.bti-more-chevron {
    display: inline-block;
    transition: transform .2s ease;
}

.bti-more-toggle:not(.collapsed) .bti-more-chevron {
    transform: rotate(180deg);
}

/* The datetimepicker widget opens below its own input inside the input group. */
.bti-filter .input-group > .form-control.date-picker {
    position: relative;
}

/* bootstrap-select draws its button grey, which reads as disabled next to the text inputs. */
.bti-filter .bootstrap-select > .dropdown-toggle,
.bti-filter .bootstrap-select > .dropdown-toggle:hover,
.bti-filter .bootstrap-select > .dropdown-toggle:focus,
.bti-card .bootstrap-select > .dropdown-toggle,
.bti-card .bootstrap-select > .dropdown-toggle:hover,
.bti-card .bootstrap-select > .dropdown-toggle:focus {
    background-color: #fff;
    border: 1px solid var(--bti-border);
    color: #212529;
}

.bti-filter .bootstrap-select > .dropdown-toggle .filter-option-inner-inner,
.bti-card .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
    color: #212529;
}

/* List/Tiles switch in the portal primary, not the Bootstrap default blue. */
.bti-page .btn-outline-primary {
    --bs-btn-color: var(--bti-primary);
    --bs-btn-border-color: var(--bti-primary);
    --bs-btn-hover-bg: var(--bti-primary);
    --bs-btn-hover-border-color: var(--bti-primary);
    --bs-btn-active-bg: var(--bti-primary);
    --bs-btn-active-border-color: var(--bti-primary);
}

.bti-page .btn-check:checked + .btn-outline-primary {
    background-color: var(--bti-primary);
    border-color: var(--bti-primary);
    color: #fff;
}

/* ---------- EU keyword multiselect ---------- */

/* Closed box: the chosen keywords as chips, English bold with the local word beside it. */
.bti-ms .bti-ms-toggle {
    min-height: calc(1.5em + .75rem + 2px);
    padding-top: .3rem;
    padding-bottom: .3rem;
    cursor: pointer;
}

.bti-ms .bti-ms-toggle:focus-visible {
    border-color: var(--bti-primary, #204391);
    box-shadow: 0 0 0 .2rem rgba(32, 67, 145, .2);
    outline: 0;
}

.bti-ms .bti-ms-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    align-items: center;
    min-height: 1.6rem;
}

.bti-ms .bti-ms-placeholder {
    color: var(--bti-muted, #6c757d);
}

.bti-ms .bti-ms-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 100%;
    padding: .1rem .2rem .1rem .55rem;
    border: 1px solid #d5ddef;
    border-radius: 999px;
    background-color: var(--bti-primary-soft, #eef2fa);
    color: var(--bti-primary-dark, #172f66);
    font-size: .8rem;
    line-height: 1.4;
}

.bti-ms .bti-ms-chip-en {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bti-ms .bti-ms-chip-local {
    padding-left: .35rem;
    border-left: 1px solid #c7d2ea;
    color: #4a5a80;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bti-ms .bti-ms-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    color: #4a5a80;
    cursor: pointer;
}

.bti-ms .bti-ms-chip-x:hover {
    background-color: var(--bti-primary, #204391);
    color: #fff;
}

.bti-ms .bti-ms-chip-more {
    padding-right: .55rem;
    background-color: #fff;
    color: var(--bti-muted, #6c757d);
    font-weight: 600;
}

/* Open list */
.bti-ms .bti-ms-menu {
    min-width: 20rem;
    margin-top: .25rem !important;
    border: 1px solid var(--bti-border, #dee2e6);
    border-radius: .75rem;
    overflow: hidden;
}

.bti-ms .bti-ms-head {
    padding: .6rem .6rem .4rem;
    border-bottom: 1px solid #eef0f3;
    background-color: #fbfcfe;
}

.bti-ms .bti-ms-search-wrap {
    position: relative;
}

.bti-ms .bti-ms-search-wrap .bi-search {
    position: absolute;
    top: 50%;
    left: .65rem;
    transform: translateY(-50%);
    color: var(--bti-muted, #6c757d);
    font-size: .85rem;
    pointer-events: none;
}

.bti-ms .bti-ms-search {
    padding-left: 2rem;
    border-radius: .5rem;
}

.bti-ms .bti-ms-tabs {
    display: flex;
    gap: .25rem;
    margin-top: .5rem;
}

.bti-ms .bti-ms-tab {
    padding: .15rem .65rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--bti-muted, #6c757d);
    font-size: .8rem;
    font-weight: 600;
}

.bti-ms .bti-ms-tab:hover {
    background-color: #eef0f3;
}

.bti-ms .bti-ms-tab.active {
    background-color: var(--bti-primary, #204391);
    color: #fff;
}

.bti-ms .bti-ms-tab-count:not(:empty) {
    display: inline-block;
    min-width: 1.2rem;
    margin-left: .15rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .25);
    text-align: center;
}

.bti-ms .bti-ms-tab:not(.active) .bti-ms-tab-count:not(:empty) {
    background-color: var(--bti-primary-soft, #eef2fa);
    color: var(--bti-primary, #204391);
}

.bti-ms .bti-ms-list {
    max-height: 20rem;
    overflow-y: auto;
    padding: .25rem;
}

.bti-ms .bti-ms-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    padding: .45rem .55rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: #212529;
    text-align: left;
}

.bti-ms .bti-ms-option:hover,
.bti-ms .bti-ms-option.active {
    background-color: #f3f6fb;
}

.bti-ms .bti-ms-option.selected {
    background-color: var(--bti-primary-soft, #eef2fa);
}

.bti-ms .bti-ms-box {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border: 1.5px solid #b8c2d6;
    border-radius: .3rem;
    background-color: #fff;
    color: transparent;
    font-size: .8rem;
    transition: background-color .12s, border-color .12s;
}

.bti-ms .bti-ms-option.selected .bti-ms-box {
    border-color: var(--bti-primary, #204391);
    background-color: var(--bti-primary, #204391);
    color: #fff;
}

.bti-ms .bti-ms-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.bti-ms .bti-ms-en {
    font-size: .875rem;
    font-weight: 600;
}

.bti-ms .bti-ms-local {
    margin-top: .1rem;
    color: var(--bti-muted, #6c757d);
    font-size: .8rem;
}

.bti-ms .bti-ms-text mark {
    padding: 0;
    border-radius: .15rem;
    background-color: #ffe78a;
    color: inherit;
}

.bti-ms .bti-ms-code {
    flex: 0 0 auto;
    padding: .05rem .4rem;
    border-radius: .35rem;
    background-color: #f1f3f5;
    color: var(--bti-muted, #6c757d);
    font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: .72rem;
}

.bti-ms .bti-ms-message {
    display: flex;
    gap: .5rem;
    align-items: center;
    justify-content: center;
    padding: .75rem;
    color: var(--bti-muted, #6c757d);
    font-size: .85rem;
}

.bti-ms .bti-ms-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem .75rem;
    border-top: 1px solid #eef0f3;
    background-color: #fbfcfe;
    color: var(--bti-muted, #6c757d);
    font-size: .8rem;
}

/* ---------- table ---------- */

.bti-table-card {
    border-color: var(--bti-border);
    border-radius: .75rem;
    overflow: hidden;
}

.bti-table thead th {
    background-color: var(--bti-primary-soft);
    border-bottom: 1px solid var(--bti-border);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    padding-top: .75rem;
    padding-bottom: .75rem;
    color: var(--bti-primary);
}

/* SortableColumnLink renders its links with .text-white for the old dark header. */
.bti-table thead th a.text-white {
    color: var(--bti-primary) !important;
    text-decoration: none;
}

.bti-table thead th a.text-white:hover {
    color: var(--bti-primary) !important;
}

.bti-table thead th .sorting-icon {
    margin-left: .25rem;
    color: var(--bti-primary);
}

.bti-table tbody td {
    padding-top: .75rem;
    padding-bottom: .75rem;
    border-color: #eef0f3;
}

.bti-table .bti-row {
    cursor: pointer;
}

.bti-table tbody tr:last-child td {
    border-bottom: 0;
}

/* ---------- shared bits ---------- */

.bti-party {
    background-color: var(--bti-primary-soft, #eef2fa);
    color: var(--bti-primary, #204391);
    font-weight: 600;
}

.bti-code {
    font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .875rem;
    background-color: #f6f8fb;
    border: 1px solid #e3e7ee;
    border-radius: .375rem;
    padding: .1rem .4rem;
    white-space: nowrap;
}

.bti-keyword,
.bti-keyword-more {
    font-weight: 500;
    margin: 0 .25rem .25rem 0;
    white-space: normal;
    text-align: left;
}

.bti-keyword {
    background-color: #fff;
    color: #495057;
    border: 1px solid #d5dbe5;
}

.bti-keyword-more {
    background-color: #f1f3f5;
    color: var(--bti-muted, #6c757d);
}

/* ---------- tiles ---------- */

.bti-tile-card {
    border-color: var(--bti-border);
    border-radius: .75rem;
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

.bti-tile-card:hover,
.bti-tile-card:focus-visible {
    box-shadow: 0 .5rem 1.25rem rgba(32, 67, 145, .15);
    transform: translateY(-2px);
}

.bti-tile-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background-color: #f6f8fb;
    border-bottom: 1px solid var(--bti-border);
}

.bti-tile-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.bti-tile-card:hover .bti-tile-media img {
    transform: scale(1.03);
}

.bti-tile-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: .8125rem;
}

.bti-tile-placeholder .bi {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: .25rem;
}

.bti-tile-party {
    position: absolute;
    top: .5rem;
    left: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 1.375rem;
    border-radius: 2rem;
    background-color: #fff;
    color: var(--bti-primary);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .03em;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}


/* ---------- last update per party ---------- */

.bti-updates {
    border-color: var(--bti-border);
    border-radius: .75rem;
}

.bti-update-chip {
    font-size: .8125rem;
    background-color: #f6f8fb;
    border: 1px solid #e3e7ee;
    border-radius: 2rem;
    padding: .25rem .75rem;
}

/* ---------- details ---------- */

.bti-hero .bti-party {
    background-color: #fff;
}

.bti-hero .bti-code-hero {
    background-color: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .35);
    color: #fff;
}

.bti-card {
    border-color: var(--bti-border);
    border-radius: .75rem;
}

.bti-details .min-w-0 {
    min-width: 0;
}

.bti-section-title {
    position: relative;
    padding-left: .75rem;
    font-size: .8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bti-primary);
    margin-bottom: .75rem;
}

.bti-section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: .1rem;
    bottom: .1rem;
    width: 3px;
    border-radius: 2px;
    background: var(--bti-yellow);
}

.bti-facts dt {
    font-weight: 600;
    color: var(--bti-muted);
    font-size: .875rem;
}

.bti-facts dt,
.bti-facts dd {
    padding-top: .5rem;
    padding-bottom: .5rem;
    margin-bottom: 0;
    border-bottom: 1px solid #f1f3f5;
}

.bti-facts dt:nth-last-of-type(1),
.bti-facts dd:last-of-type {
    border-bottom: 0;
}

/* Descriptions come from Excel and the API with their own line breaks. */
.bti-text {
    white-space: pre-line;
    line-height: 1.6;
}

.bti-status-valid {
    background-color: #e6f4ea;
    color: #1e7b34;
}

.bti-status-expired {
    background-color: #fdecea;
    color: #b42318;
}

.bti-status-pending {
    background-color: #fff4e5;
    color: #9a5b00;
}

.bti-status-valid .bi,
.bti-status-expired .bi,
.bti-status-pending .bi {
    font-size: .5rem;
    vertical-align: middle;
}

.bti-gallery-main {
    text-decoration: none;
    aspect-ratio: 4 / 3;
    background-color: #f6f8fb;
    border: 1px solid #e3e7ee;
    border-radius: .5rem;
    overflow: hidden;
}

.bti-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bti-gallery-thumb {
    width: 4.5rem;
    height: 4.5rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: .5rem;
    overflow: hidden;
    background-color: #f6f8fb;
}

.bti-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bti-gallery-thumb.active,
.bti-gallery-thumb:hover,
.bti-gallery-thumb:focus-visible {
    border-color: var(--bti-primary);
}

.bti-file {
    padding: .65rem .75rem;
    border: 1px solid #e3e7ee;
    border-radius: .5rem;
    color: #212529;
    text-decoration: none;
}

.bti-file + .bti-file {
    margin-top: .5rem;
}

.bti-file:hover,
.bti-file:focus-visible {
    background-color: #f6f8fb;
    border-color: var(--bti-primary);
    color: var(--bti-primary);
}

.bti-file .bi:first-child {
    color: var(--bti-primary);
}

/* ---------- keyword codebook ---------- */

.bti-lang-missing {
    font-weight: 500;
    background-color: #fff;
    color: var(--bti-muted, #6c757d);
    border: 1px dashed #c9d1dd;
    margin: 0 .2rem .2rem 0;
}

/* Seven language tabs scroll sideways on a phone instead of wrapping. */
.bti-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

/* site.css colours labels inside tab content white (the other label screens add .text-black). */
.bti-page .tab-content .form-label {
    color: #212529 !important;
}

.bti-card .form-label {
    font-weight: 600;
    font-size: .875rem;
}

.bti-file.is-removed {
    background-color: #fdf2f1;
    border-color: #f3c7c2;
}

.bti-file.is-removed a {
    text-decoration: line-through;
    color: var(--bti-muted) !important;
}

.bti-tabs .nav-link {
    color: var(--bti-muted);
    font-weight: 600;
    font-size: .875rem;
}

.bti-tabs .nav-link.active {
    color: var(--bti-primary);
    border-top: 3px solid var(--bti-yellow);
}

.bti-actions {
    position: sticky;
    bottom: .75rem;
    z-index: 5;
    box-shadow: 0 .25rem 1rem rgba(23, 47, 102, .12);
}

.bti-dropzone {
    display: block;
    text-align: center;
    cursor: pointer;
    padding: 2rem 1rem;
    border: 2px dashed #c9d1dd;
    border-radius: .75rem;
    background-color: #f8fafd;
    transition: border-color .15s ease, background-color .15s ease;
}

.bti-dropzone .bi {
    display: block;
    font-size: 2.5rem;
    color: var(--bti-primary);
    margin-bottom: .5rem;
}

.bti-dropzone:hover,
.bti-dropzone.is-dragover,
.bti-dropzone:focus-within {
    border-color: var(--bti-primary);
    background-color: var(--bti-primary-soft);
}

.bti-dropzone.has-file {
    border-style: solid;
    border-color: #1e7b34;
    background-color: #f1f9f3;
}

.bti-dropzone.is-invalid {
    border-color: #b42318;
}

.bti-dropzone.is-invalid + .invalid-feedback {
    display: block;
}

.bti-steps {
    list-style: none;
    padding: 0;
}

.bti-steps li {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .6rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.bti-steps li:last-child {
    border-bottom: 0;
}

.bti-steps .bi {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bti-primary-soft);
    color: var(--bti-primary);
}

.bti-stat {
    height: 100%;
    padding: .9rem 1rem;
    border-radius: .75rem;
    background-color: #f6f8fb;
    border-left: 3px solid var(--bti-primary);
}

.bti-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bti-primary);
    line-height: 1.2;
}

.bti-stat-label {
    font-size: .8125rem;
    color: var(--bti-muted);
}

@media (prefers-reduced-motion: reduce) {
    .bti-tile-card,
    .bti-tile-media img,
    .bti-more-chevron {
        transition: none;
    }

    .bti-tile-card:hover,
    .bti-tile-card:hover .bti-tile-media img {
        transform: none;
    }
}
