/* The official Chatwoot widget controls its own UI — we only reposition the
   bubble a few pixels above the default, because in that bottom-right corner
   GLPI uses that same space for the pagination controls of its listings.
   #chatwoot_live_chat_widget is the official ID that Chatwoot's own SDK
   assigns to the bubble's iframe (not something on our side that could
   break on plugin updates, it belongs to Chatwoot itself). */
#chatwoot_live_chat_widget {
    bottom: 76px !important;
}

/* Styles below are only for the plugin's configuration screen (Setup > Chatwoot). */

.chatwoot-config-card {
    max-width: 980px;
    margin: 1.5rem auto;
}

.chatwoot-config-card .card-header {
    background: linear-gradient(135deg, #f5f7fb 0%, #eef1f8 100%);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.chatwoot-config-card .card-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.chatwoot-section {
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: .5rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    background: #fff;
}

.chatwoot-section + .chatwoot-section {
    margin-top: 1.5rem;
}

.chatwoot-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: .25rem;
}

.chatwoot-section-title i {
    color: var(--tblr-primary, #4C6FFF);
}

.chatwoot-status-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0 1.25rem;
}

.chatwoot-status-row .form-switch {
    padding-left: 2.5rem;
}

.chatwoot-status-row .form-check-input {
    width: 2.5rem;
    height: 1.35rem;
    cursor: pointer;
}

.chatwoot-field {
    margin-bottom: 1rem;
}

.chatwoot-field label {
    font-weight: 500;
    margin-bottom: .3rem;
    display: block;
}

.chatwoot-field small.form-text {
    color: #6c757d;
}

.chatwoot-field-wrap {
    position: relative;
}

.chatwoot-eye-btn {
    position: absolute;
    right: .25rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #6c757d;
    padding: .25rem .5rem;
    cursor: pointer;
}

.chatwoot-eye-btn:hover {
    color: #333;
}

.chatwoot-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
}

/* Picker (profiles/groups/users): search field + chips + suggestions */
.chatwoot-picker {
    position: relative;
}

.chatwoot-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .4rem;
    min-height: 0;
}

.chatwoot-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #eef1fb;
    color: #2b3a8f;
    border: 1px solid #d7def7;
    border-radius: 999px;
    padding: .2rem .6rem .2rem .75rem;
    font-size: .825rem;
    line-height: 1.4;
}

.chatwoot-chip button {
    border: none;
    background: transparent;
    color: #5566b3;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    display: flex;
}

.chatwoot-chip button:hover {
    color: #1f2a66;
}

.chatwoot-picker-suggestions {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: .4rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    margin-top: .25rem;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.chatwoot-picker-suggestions.show {
    display: block;
}

.chatwoot-picker-suggestion {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .9rem;
}

.chatwoot-picker-suggestion:hover,
.chatwoot-picker-suggestion.active {
    background: #f1f3fb;
}

.chatwoot-picker-suggestion.empty {
    color: #999;
    cursor: default;
}

.chatwoot-result-box {
    border-radius: .4rem;
    font-size: .9rem;
}

.chatwoot-actions {
    align-items: center;
}

.chatwoot-actions .ms-auto {
    margin-left: auto;
}
