/* Support ticket messenger — Filament admin + agent panels */

.wg-support-chat__shell {
    display: flex;
    flex-direction: column;
    height: 32rem;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid rgb(229 231 235);
    background: linear-gradient(180deg, rgb(249 250 251) 0%, rgb(255 255 255) 100%);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
}

.dark .wg-support-chat__shell {
    border-color: rgb(255 255 255 / 0.1);
    background: linear-gradient(180deg, rgb(17 24 39) 0%, rgb(3 7 18) 100%);
}

.wg-support-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgb(229 231 235);
    background: rgb(255 255 255 / 0.85);
    backdrop-filter: blur(8px);
}

.dark .wg-support-chat__header {
    border-bottom-color: rgb(255 255 255 / 0.08);
    background: rgb(17 24 39 / 0.85);
}

.wg-support-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-image: radial-gradient(rgb(148 163 184 / 0.12) 1px, transparent 1px);
    background-size: 18px 18px;
}

.dark .wg-support-chat__messages {
    background-image: radial-gradient(rgb(148 163 184 / 0.08) 1px, transparent 1px);
}

.wg-support-chat__row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 100%;
}

.wg-support-chat__row--mine {
    justify-content: flex-end;
}

.wg-support-chat__row--theirs {
    justify-content: flex-start;
}

.wg-support-chat__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgb(226 232 240);
    color: rgb(71 85 105);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dark .wg-support-chat__avatar {
    background: rgb(51 65 85);
    color: rgb(226 232 240);
}

.wg-support-chat__avatar--support {
    background: rgb(237 233 254);
    color: rgb(109 40 217);
}

.dark .wg-support-chat__avatar--support {
    background: rgb(76 29 149 / 0.35);
    color: rgb(196 181 253);
}

.wg-support-chat__bubble {
    max-width: min(75%, 28rem);
    border-radius: 1rem;
    padding: 0.625rem 0.875rem;
    position: relative;
    word-break: break-word;
}

.wg-support-chat__bubble--mine {
    background: rgb(124 58 237);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.wg-support-chat__bubble--theirs {
    background: white;
    color: rgb(31 41 55);
    border: 1px solid rgb(229 231 235);
    border-bottom-left-radius: 0.25rem;
}

.dark .wg-support-chat__bubble--theirs {
    background: rgb(31 41 55);
    color: rgb(243 244 246);
    border-color: rgb(255 255 255 / 0.08);
}

.wg-support-chat__bubble--internal {
    background: rgb(254 243 199);
    color: rgb(120 53 15);
    border: 1px dashed rgb(251 191 36);
    border-bottom-left-radius: 0.25rem;
}

.dark .wg-support-chat__bubble--internal {
    background: rgb(120 53 15 / 0.25);
    color: rgb(253 230 138);
    border-color: rgb(217 119 6 / 0.5);
}

.wg-support-chat__sender {
    font-size: 0.6875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.85;
}

.wg-support-chat__text {
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.wg-support-chat__time {
    margin-top: 0.25rem;
    font-size: 0.625rem;
    text-align: right;
    opacity: 0.7;
}

.wg-support-chat__image {
    display: block;
    max-width: 100%;
    max-height: 14rem;
    border-radius: 0.625rem;
    margin-bottom: 0.375rem;
}

.wg-support-chat__file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    background: rgb(0 0 0 / 0.06);
    font-size: 0.8125rem;
    text-decoration: none;
}

.wg-support-chat__bubble--mine .wg-support-chat__file {
    background: rgb(255 255 255 / 0.15);
    color: white;
}

.wg-support-chat__bubble--theirs .wg-support-chat__file {
    color: inherit;
}

.wg-support-chat__empty {
    margin: auto;
    text-align: center;
    padding: 2rem 1rem;
}

.wg-support-chat__composer {
    padding: 0.875rem 1rem;
    border-top: 1px solid rgb(229 231 235);
    background: rgb(255 255 255 / 0.92);
    backdrop-filter: blur(8px);
}

.dark .wg-support-chat__composer {
    border-top-color: rgb(255 255 255 / 0.08);
    background: rgb(17 24 39 / 0.92);
}

.wg-support-chat__composer--closed {
    text-align: center;
}

.wg-support-chat__input {
    width: 100%;
    resize: none;
    border-radius: 1.25rem;
    border: 1px solid rgb(209 213 219);
    background: white;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: rgb(17 24 39);
    max-height: 7rem;
}

.wg-support-chat__input:focus {
    outline: none;
    border-color: rgb(124 58 237);
    box-shadow: 0 0 0 2px rgb(124 58 237 / 0.15);
}

.dark .wg-support-chat__input {
    border-color: rgb(75 85 99);
    background: rgb(31 41 55);
    color: rgb(243 244 246);
}

.wg-support-chat__attach-btn,
.wg-support-chat__send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.wg-support-chat__attach-btn {
    color: rgb(107 114 128);
    background: rgb(243 244 246);
}

.wg-support-chat__attach-btn:hover {
    background: rgb(229 231 235);
    color: rgb(55 65 81);
}

.dark .wg-support-chat__attach-btn {
    background: rgb(31 41 55);
    color: rgb(156 163 175);
}

.wg-support-chat__send-btn {
    color: white;
    background: rgb(124 58 237);
    border: none;
}

.wg-support-chat__send-btn:hover:not(:disabled) {
    background: rgb(109 40 217);
}

.wg-support-chat__send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
