/* ============================================================================
   FILE: Lawfunder.Admin/wwwroot/css/chat-widget.css
   PURPOSE: Styles for AI chat widget (floating button + panel) and full-page chat
   CREATED: 2026-02-17
   AUSTRALIAN CREDIT LICENSE: ACL 514419
   ============================================================================ */

/* ===== FLOATING CHAT BUTTON ===== */
.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1.5rem;
}

.chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.chat-fab .chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== CHAT PANEL OVERLAY ===== */
.chat-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 400px;
    height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1049;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.chat-panel.chat-panel-open {
    display: flex;
}

/* Panel Header */
.chat-panel-header {
    background: #0d6efd;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-panel-header h6 {
    margin: 0;
    font-weight: 600;
}

.chat-panel-header .btn-close-chat {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    padding: 0;
    line-height: 1;
}

.chat-panel-header .btn-close-chat:hover {
    opacity: 1;
}

/* Panel Messages */
.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f8f9fa;
}

/* Panel Input */
.chat-panel-input {
    border-top: 1px solid #dee2e6;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    background: #fff;
    flex-shrink: 0;
}

.chat-panel-input input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.875rem;
    outline: none;
}

.chat-panel-input input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.chat-panel-input button {
    border: none;
    background: #0d6efd;
    color: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-panel-input button:hover {
    background: #0b5ed7;
}

.chat-panel-input button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* ===== MESSAGE BUBBLES (shared for panel + full-page) ===== */
.chat-message {
    margin-bottom: 12px;
}

.chat-message-user .chat-content {
    word-wrap: break-word;
}

.chat-message-assistant .chat-content {
    word-wrap: break-word;
}

.chat-message-assistant .chat-content pre {
    margin-top: 8px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.chat-message-assistant .chat-content code {
    font-size: 0.85em;
}

.chat-message-error .chat-content {
    word-wrap: break-word;
}

/* ===== FULL-PAGE CHAT SPECIFIC ===== */
.conv-item.active {
    background-color: #e7f1ff;
    border-color: #0d6efd;
}

.conv-item:hover {
    background-color: #f0f0f0;
}

/* Typing indicator animation */
.typing-dots {
    display: inline-flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6c757d;
    animation: typing-bounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .chat-panel {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 80px;
        height: 60vh;
    }

    .chat-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}
