
:root{
    --main-color:  rgb(0, 102, 204); /* #06c; */
    --border-color: #999;
    --border-color: var(--grey-color); /* If on the website */

    /* From main CSS file (te-messenger.css 
    *
    * var(--in-content-spacing)
    * 
    */
}

/* =======================================================*/
/* Field structure
/* =======================================================*/
.mes-fields-container{
    display: flex;
}
.mes-payment{
    display: flex;
}
.mes-button-container{
    display: flex;
}

/* =======================================================*/
/* Addition info inside dropdown options */
/* =======================================================*/
.additional-info{
    display: inline-flex;
    align-items: center;
    width: 100%;
    margin: .5rem;
    padding: 0 1em;
    background-color: rgba(255, 255, 255, 0.15);
    border: 0;
    border-radius: .25rem;
    line-height: 1.75em;
    font-size: 0.8em;
    cursor: default;
}

/* =======================================================*/
/* Selected contacts label
/* =======================================================*/
/* .contact-count{} */
/* =======================================================*/
/* Styled field : Element styled to look like an html field
/* =======================================================*/

.styled-field{
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}
.styled-field .clear-selected-options{
    margin-right: .25rem;
    display: none;
}
.styled-field .clear-selected-options:hover *{
    cursor: pointer;
    color: darkred;
}
.styled-field:has(input[has-value]) .clear-selected-options,
.styled-field:has(.styled-field-option) .clear-selected-options{
    display: inline;
}

#te-messenger input,
.styled-input{
    /* width: 100%; */
    border: 1px var(--grey-color) solid;
    border-radius: 3px;
    line-height: 2rem;
    background: rgba(250,250,250,0.9);
}
.styled-input{
    /* width: 100%; */
    position: relative;
}
 .styled-input .selected-options{
        overflow: auto;
        /* min-height: 2.5rem; */
        max-height: 10rem;
        scroll-behavior: smooth;
        transition: all 50ms ease-in;
    }
 .styled-input input{
        position: sticky;
        height: 2rem;
        width: calc(100% - .5rem - .5rem);
        bottom: 0;
        right: 0;
    }
/* ----------------------- */
/* Styled select
/* ----------------------- */

.styled-input input,
.styled-input input:active,
.styled-input input:focus{
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}
.styled-input:has(input){
    cursor: text;
}

#te-messenger input:focus,
#te-messenger input:active,
.styled-input:has(input:focus, input:active){
    box-shadow: 0 0 0 1.5px #06c;
    box-shadow: 0 0 0 1.5px var(--main-color);
}


/* ----------------------- */
/* Styled select option
/* ----------------------- */

.styled-field.selectable .styled-field-option.value-error{
    order: 1;
}
.styled-field.selectable .styled-field-option{
    display: inline-flex;
    width: 100%;
    padding: 3px 1em;
    align-items: center;
    justify-content: space-between;
    column-gap: 1px;
    background-color: #efefef;
    border: 0.5px var(--border-color) solid;
    border-radius: 15px;
    padding: 0 6px 0 2px;
    line-height: 1.75em;
    font-size: 0.8em;
    cursor: default;
    order: 2;
}
.styled-field.selectable .styled-field-option:hover{ 
    background-color:#ddd;
    cursor: pointer;
}
.styled-field.selectable .styled-field-option .option-close{
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--in-content-spacing);
    height: var(--in-content-spacing);
    border-radius: 50%;
}
.styled-field.selectable .styled-field-option .option-close:hover{
    background-color: var(--red-color-light);
    cursor: pointer;
}
.styled-field.selectable .styled-field-option .option-text{
    width: 90%;
    max-width: 90%;
}
.styled-field.selectable .styled-field-option .external-link a{
    display: inline-flex;
    padding: 0.05rem;
    border-radius: 1rem;
    width: 1rem;
    height: 1rem;
    line-height: 1;
}
.styled-field.selectable .styled-field-option .external-link a:hover{
    background: green; /* fallback color ? */
    background: var(--focus-color);    
}

/* ----------------------- */
/* Styled options to select from
/* Ex. results
/* ----------------------- */
.options-container{
    position: relative;
    z-index: 1;
}
    .styled-options{
        display: flex;
        position: absolute;
        flex-wrap: wrap;
        /* top: calc(2 * var(--in-content-spacing)); */
        width: 100%;
        max-height: 10rem;
        overflow: auto;
        
        background: rgba(50,150,250,0.9);
        border: var(--border-color) 1px solid;
        border-radius: 0 0 1rem 1rem;
        padding: calc(.5 * var(--in-content-spacing)) var(--in-content-spacing) calc(1 * var(--in-content-spacing));
    }

.value-error,
.value-error i,
.value-error span{
    color: tomato;
}
.value-error .phone-number{
    display: none;
}

[hidden]{
    display: none !important;
    pointer-events: none;
    position: absolute;
}

/* =======================================================*/
/* Modular Messenger
/* =======================================================*/

/* Effects inside form */
.field-wrap[aria-expanded="true"][aria-controls="modular-messenger"] #modular-messenger{
    opacity: 1;
    transition: all .5s ease;
}
.field-wrap[aria-expanded="false"][aria-controls="modular-messenger"] #modular-messenger{
    opacity: 0;
    transition: all .5s ease;
}

/* ----------------------- */
/* "Message to" filter
/* ----------------------- */

.the-profile-filter{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .82rem;
}
.the-profile-filter select{
    padding: 0;
}
.the-profile-filter input{
    padding-top: 0; /* Not working */
    padding-bottom: 0; /* Not working */
}

#filtered-select-all{
    display: none;
}
:has(input#filtered-select-all ~ .styled-options:not([hidden]) .styled-field-option) #filtered-select-all{
    display: flex;
    width: 100%;
    justify-content: center;
}

/* ----------------------- */
/* Message text
/* ----------------------- */

#message .message-text-container{
    border: 1px #ccc solid;
    border-radius: .5rem;
    background: #999;
}
#message .message-taskbar{
    display: flex;
    flex-wrap: nowrap;
    padding: .5rem;
    justify-content: flex-start;
    align-items: flex-start;
    height: 2.5rem;
    contain: layout;
}

#message textarea{
    border-radius: 0 0 .5rem .5rem;
}
#message .message-taskbar button:hover{
    cursor: pointer;
}
#message .message-taskbar .dropdown-button-text:hover{
    cursor: default;
}

/* ----------------------- */
/* TE Multicheckbox field
/* ----------------------- */

.te-multichecbox label:has(input:checked){
    color: #eee;
    background-color: #06c;
}
.te-multichecbox label:hover{
    cursor: pointer;
}
.te-multichecbox label:has(> input){
    padding: 0 .5rem;
    border: 1px #ccc solid;
    border-radius: .5rem;
}
.te-multichecbox input{
    display: none;
    pointer-events: none;
}