:root {
    /* Colors */
    --color-primary: #03498f;
    --color-primary-dark: #024480;
    --color-primary-hover: #03498f;
    --color-text: #666;
    --color-text-dark: #000;
    --color-white: #fff;
    --color-border: #cfe7ff;
    --color-border-light: #f3f3f3;
    --color-border-lighter: #f0f0f0;
    --color-bg-hover: #eeeeeeed;
    --color-spinner-1: #6065ac;
    --color-spinner-2: #004a8f;
    --color-spinner-3: #2a81c4;
    --color-spinner-4: #0c8c4a;
    --color-spinner-5: #fbb33a;
    --color-spinner-6: #f1773f;
    --color-spinner-7: #e20a2f;
}

/* UTILITY */
.hidden {
    display: none !important;
}

.inactive {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.blurred {
    filter: blur(2px);
    pointer-events: none;
}

/* SPINNER */
#spinner-wrapper-wrapper {
    margin-top: 20px;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.spinner {
    animation: rotator 1.4s linear infinite;
}

@keyframes rotator {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(270deg);
    }
}

.path {
    stroke-dasharray: 187;
    stroke-dashoffset: 0;
    transform-origin: center;
    animation:
        dash 1.4s ease-in-out infinite,
        colors 5.6s ease-in-out infinite;
}

@keyframes dash {
    0% {
        stroke-dashoffset: 187;
    }

    50% {
        stroke-dashoffset: 46.75;
        transform: rotate(135deg);
    }

    100% {
        stroke-dashoffset: 187;
        transform: rotate(450deg);
    }
}

@keyframes colors {
    0% {
        stroke: var(--color-spinner-1);
    }

    14% {
        stroke: var(--color-spinner-2);
    }

    27% {
        stroke: var(--color-spinner-3);
    }

    42% {
        stroke: var(--color-spinner-4);
    }

    57% {
        stroke: var(--color-spinner-5);
    }

    72% {
        stroke: var(--color-spinner-6);
    }

    86% {
        stroke: var(--color-spinner-7);
    }

    99% {
        stroke: var(--color-spinner-1);
    }
}

/* LISTS */
#trial-search-filters-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.flex-vertical {
    flex-direction: column;
}

#trial-search-filters-wrapper>* {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}

#trial-search-filters-wrapper h4 {
    font-size: 16px;
    margin: 0;
    font-weight: 700;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    border-radius: 5px;
    border: 1px solid transparent;
}

.input-with-chevron {
    position: relative;
    width: 100%;
}

#trial-search-filters-wrapper input[type="text"] {
    box-sizing: border-box;
    padding: 20px 40px 20px 20px;
    display: block;
    height: 40px;
    border-radius: 5px;
    margin: 0;
    border: 1px solid var(--color-border);
    outline: 0 !important;
    width: 100%;
}

.input-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--color-text);
    transition: transform 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.input-chevron.rotated {
    transform: translateY(-50%) rotate(180deg);
}

.input-chevron:hover {
    color: var(--color-primary-hover);
}

#trial-search-filters-wrapper ul {
    background: var(--color-white);
    border: 2px solid var(--color-border-light);
    border-radius: 5px;
    padding: 0;
    font-size: 14px;
    line-height: 25px;
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

#trial-search-filters-wrapper ul.floating {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 5px;
}

#trial-search-filters-wrapper ul.expanded {
    max-height: 500px;
}

#trial-search-filters-wrapper li {
    padding: 5px 10px;
    transition: all 0.2s;
    border-bottom: 2px solid var(--color-border-lighter);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#trial-search-filters-wrapper li.selected {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    font-weight: 700;
}

#trial-search-filters-wrapper li:not(.selected):hover {
    background: var(--color-bg-hover);
    /* font-weight: 700; */
    /* border-left: 5px solid var(--color-primary); */
}

#trial-search-filters-wrapper input[type="button"] {
    border: none;
    background: none;
    margin: 0 auto;
    display: block;
    text-decoration: underline;
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 768px) {
    #trial-search-filters-wrapper {
        flex-direction: column;
    }
}

/* advanced filters */
.list-no-margin {
    margin-top: 0;
    margin-bottom: 0;
}

#age-filter>ul {
    background: var(--color-white);
    border: 2px solid var(--color-border-light);
    border-radius: 5px;
    padding: 0;
    font-size: 14px;
    line-height: 25px;
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

#age-filter label {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    transition: all 0.2s;
    border-bottom: 2px solid var(--color-border-lighter);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

#age-filter label:last-child {
    border-bottom: none;
}

#age-filter input[type="checkbox"] {
    margin: 0 10px 0 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

#age-filter span {
    flex: 1;
    transition: all 0.2s;
}

/* active filters */
.selected-filter-item {
    display: inline-block;
    max-width: 100%;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-primary-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.selected-filter-remove {
    margin-left: 0.3em;
    cursor: pointer;
}

#trial-search-filters-wrapper__current {
    display: flex;
    gap: 0.3em;
    flex-wrap: wrap;
}
