/* =========================================================================
   FDIC Live Chat Widget
   ========================================================================= */

.live-chat-root {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: var(--font-sans, 'Plus Jakarta Sans', Arial, sans-serif);
}

.live-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--navy-800, #0d2440) 0%, var(--navy-700, #112e51) 100%);
    color: #fff;
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(8,23,46,0.2));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s var(--ease, ease), box-shadow 0.2s;
}

.live-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl, 0 16px 40px rgba(8,23,46,0.24));
}

.live-chat-toggle .live-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--red-600, #d63236);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.live-chat-toggle.has-unread .live-chat-badge {
    display: flex;
}

.live-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(8, 23, 46, 0.18);
    border: 1px solid var(--gray-200, #e0e3e8);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.live-chat-panel.open {
    display: flex;
}

.live-chat-header {
    background: linear-gradient(135deg, #08172e 0%, #112e51 100%);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.live-chat-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.live-chat-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-chat-header-text h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.live-chat-header-text p {
    margin: 2px 0 0;
    font-size: 11px;
    opacity: 0.85;
}

.live-chat-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.live-chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.live-chat-status-dot.online {
    background: #12b76a;
    box-shadow: 0 0 0 3px rgba(18,183,106,0.25);
}

.live-chat-close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    opacity: 0.85;
}

.live-chat-close:hover {
    opacity: 1;
}

.live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--gray-50, #f7f8fa);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.live-chat-empty {
    text-align: center;
    color: var(--gray-500, #6c7682);
    font-size: 13px;
    padding: 40px 16px;
    line-height: 1.6;
}

.live-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.live-chat-bubble.user {
    align-self: flex-end;
    background: var(--navy-700, #112e51);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.live-chat-bubble.admin {
    align-self: flex-start;
    background: #fff;
    color: var(--gray-800, #252d35);
    border: 1px solid var(--gray-200, #e0e3e8);
    border-bottom-left-radius: 4px;
}

.live-chat-bubble.ai {
    align-self: flex-start;
    background: #eef4ff;
    color: var(--gray-800, #252d35);
    border: 1px solid #c7d7fe;
    border-bottom-left-radius: 4px;
}

.live-chat-meta {
    font-size: 10px;
    color: var(--gray-400, #9ba4b0);
    margin-top: 4px;
}

.live-chat-bubble-wrap {
    display: flex;
    flex-direction: column;
}

.live-chat-bubble-wrap.user {
    align-items: flex-end;
}

.live-chat-bubble-wrap.admin,
.live-chat-bubble-wrap.ai {
    align-items: flex-start;
}

.live-chat-sender-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-500, #6c7682);
    margin-bottom: 4px;
}

.live-chat-compose {
    padding: 12px 14px;
    border-top: 1px solid var(--gray-200, #e0e3e8);
    background: #fff;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.live-chat-compose textarea {
    flex: 1;
    min-height: 42px;
    max-height: 100px;
    resize: none;
    border: 1px solid var(--gray-200, #e0e3e8);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
}

.live-chat-compose textarea:focus {
    outline: none;
    border-color: var(--navy-500, #005ea2);
    box-shadow: 0 0 0 3px rgba(0, 94, 162, 0.12);
}

.live-chat-send {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: var(--navy-700, #112e51);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.live-chat-send:not(:disabled):hover {
    background: var(--navy-800, #0d2440);
}

.live-chat-typing {
    font-size: 11px;
    color: var(--gray-500, #6c7682);
    padding: 0 16px 8px;
    min-height: 18px;
}

@media (max-width: 480px) {
    .live-chat-root {
        right: 16px;
        bottom: 16px;
    }
    .live-chat-panel {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
    }
}

.live-chat-identify {
    padding: 20px 16px;
    background: var(--gray-50, #f7f8fa);
    border-bottom: 1px solid var(--gray-200, #e0e3e8);
    flex: 1;
}

.live-chat-identify-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy-800, #0d2440);
}

.live-chat-identify-desc {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--gray-500, #6c7682);
}

.live-chat-identify-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--gray-200, #e0e3e8);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 10px;
}

.live-chat-identify-input:focus {
    outline: none;
    border-color: var(--navy-500, #005ea2);
    box-shadow: 0 0 0 3px rgba(0, 94, 162, 0.12);
}

.live-chat-identify-error {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--red-600, #d63236);
}

.live-chat-identify-btn {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 11px 14px;
    background: var(--navy-700, #112e51);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.live-chat-identify-btn:hover {
    background: var(--navy-800, #0d2440);
}

.live-chat-identify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
