/* Live Chat Widget Styles */
#reach-hub-floating-chat {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-size: 14px;
}

/* Chat Trigger Button */
.reach-chat-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1D77D1 0%, #17345E 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(29, 119, 209, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.reach-chat-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(29, 119, 209, 0.5);
}

.reach-chat-trigger:active {
    transform: scale(0.95);
}

.reach-chat-trigger svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.reach-chat-trigger .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
}

/* Chat Panel */
.reach-chat-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.3s ease;
}

.reach-chat-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Chat Header */
.reach-chat-header {
    background: linear-gradient(135deg, #1D77D1 0%, #17345E 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.reach-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.reach-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.reach-chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.reach-chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.reach-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.reach-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
}

.reach-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.reach-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.reach-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.reach-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Message Bubbles */
.reach-message {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reach-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.reach-message.bot {
    align-self: flex-start;
}

.reach-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.reach-message.user .reach-message-avatar {
    background: #1D77D1;
}

.reach-message.bot .reach-message-avatar {
    background: #6b7280;
}

.reach-message-content {
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.5;
}

.reach-message.user .reach-message-content {
    background: #1D77D1;
    color: white;
    border-bottom-right-radius: 4px;
}

.reach-message.bot .reach-message-content {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.reach-message-text {
    margin: 0;
    white-space: pre-wrap;
}

.reach-message-citations {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 12px;
    color: #6b7280;
}

.reach-message.user .reach-message-citations {
    border-top-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.reach-message-citation {
    display: inline-block;
    margin: 0 4px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.reach-message.user .reach-message-citation {
    background: rgba(255, 255, 255, 0.2);
}

.reach-message-citation:hover {
    background: rgba(0, 0, 0, 0.1);
}

.reach-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.reach-message.user .reach-message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Typing Indicator */
.reach-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    max-width: 60px;
}

.reach-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite;
}

.reach-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.reach-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.reach-chat-input-area {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reach-chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.reach-chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    min-height: 40px;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.reach-chat-input:focus {
    outline: none;
    border-color: #1D77D1;
    box-shadow: 0 0 0 3px rgba(29, 119, 209, 0.1);
}

.reach-chat-send {
    background: #1D77D1;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reach-chat-send:hover:not(:disabled) {
    background: #17345E;
}

.reach-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reach-chat-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.reach-chat-upload {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.reach-chat-upload:hover {
    background: #e5e7eb;
}

.reach-chat-upload input[type="file"] {
    display: none;
}

/* Presence/Status */
.reach-presence-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 640px) {
    .reach-chat-panel {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 80px;
        height: calc(100vh - 100px);
    }

    .reach-chat-trigger {
        width: 56px;
        height: 56px;
        bottom: 10px;
        right: 10px;
    }

    .reach-message {
        max-width: 90%;
    }
}

/* Accessibility */
.reach-chat-trigger:focus-visible,
.reach-chat-close:focus-visible,
.reach-chat-send:focus-visible {
    outline: 2px solid #1D77D1;
    outline-offset: 2px;
}

/* Loading state */
.reach-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
}


