/* TrapperTracker Chat Widget Styles */

/* Toggle button */
#tt-chat-toggle {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1f2937;
    border: none;
    cursor: pointer;
    z-index: 5000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}
#tt-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
#tt-chat-toggle .tt-chat-icon {
    font-size: 26px;
    line-height: 1;
}

/* Badge */
.tt-chat-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1f2937;
}
.tt-chat-badge.hidden {
    display: none;
}

/* Panel */
.tt-chat-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    z-index: 5001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0) translateY(20px);
    transform-origin: bottom right;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
    pointer-events: none;
}
.tt-chat-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
.tt-chat-header {
    background: #1f2937;
    color: white;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.tt-chat-header-title {
    font-size: 15px;
    font-weight: 600;
}
.tt-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
.tt-chat-close:hover {
    opacity: 0.7;
}

/* Messages */
.tt-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tt-msg {
    display: flex;
}
.tt-msg-bot {
    justify-content: flex-start;
}
.tt-msg-user {
    justify-content: flex-end;
}
.tt-msg-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.tt-msg-bot .tt-msg-bubble {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}
.tt-msg-user .tt-msg-bubble {
    background: #ef4444;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Input area */
.tt-chat-input-area {
    border-top: 1px solid #e5e7eb;
    padding: 10px 12px;
    flex-shrink: 0;
    background: #fafafa;
}
.tt-chat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.tt-chat-buttons:empty {
    margin-bottom: 0;
}
.tt-chat-action-btn {
    padding: 6px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    background: white;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    font-family: inherit;
}
.tt-chat-action-btn:hover {
    border-color: #ef4444;
    background: #fef2f2;
    color: #ef4444;
}
.tt-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.tt-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.tt-chat-input:focus {
    border-color: #ef4444;
}
.tt-chat-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}
.tt-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.tt-chat-send-btn:hover {
    background: #dc2626;
}
.tt-chat-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Mobile */
@media (max-width: 480px) {
    .tt-chat-panel {
        bottom: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 60px);
        border-radius: 0;
        transform-origin: bottom center;
    }
    #tt-chat-toggle {
        bottom: 80px;
        right: 16px;
    }
}

/* Pulse animation for attention */
@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6); }
}
