/* ERP AI Chatbot Widget Styles */

.erp-chatbot-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--btn-primary-color, #3b82f6);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.erp-chatbot-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.erp-chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .erp-chatbot-container {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

.erp-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--btn-primary-color, #3b82f6);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: 16px 16px 0 0;
}

.erp-chatbot-status {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
    animation: pulse-status 2s infinite;
}
@keyframes pulse-status {
    0% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3); }
}

.erp-chatbot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.erp-chatbot-close:hover {
    opacity: 1;
}

.erp-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(245, 247, 250, 0.5);
}
[data-theme="dark"] .erp-chatbot-messages {
    background: rgba(15, 23, 42, 0.4);
}

.erp-chatbot-msg {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 85%;
    word-wrap: break-word;
}
.erp-chatbot-bot {
    background: #e8ecf1;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
[data-theme="dark"] .erp-chatbot-bot {
    background: #334155;
    color: #e2e8f0;
}
.erp-chatbot-user {
    background: var(--btn-primary-color, #3b82f6);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.erp-chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
}
[data-theme="dark"] .erp-chatbot-input-area {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}

.erp-chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    background: #f8f9fa;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.erp-chatbot-input:focus {
    border-color: var(--btn-primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
[data-theme="dark"] .erp-chatbot-input {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.erp-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--btn-primary-color, #3b82f6);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
}
.erp-chatbot-send:hover {
    filter: brightness(0.9);
}
.erp-chatbot-send:active {
    transform: scale(0.95);
}

/* Quick action chips */
.erp-chatbot-quick-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 2px 0;
    max-width: 100%;
}
.erp-chatbot-chip {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--btn-primary-color, #3b82f6);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.erp-chatbot-chip:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
}
[data-theme="dark"] .erp-chatbot-chip {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}
.erp-chatbot-chip-action {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #059669;
}
.erp-chatbot-chip-action:hover {
    background: rgba(16, 185, 129, 0.15);
}

/* Feedback buttons */
.erp-chatbot-feedback {
    display: flex;
    gap: 6px;
    align-self: flex-start;
    margin-left: 4px;
    margin-top: -4px;
    padding-bottom: 4px;
}
.erp-chatbot-fb-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.2s;
}
.erp-chatbot-fb-btn:hover {
    color: var(--btn-primary-color, #3b82f6);
}

/* Scrollbar styling */
.erp-chatbot-messages::-webkit-scrollbar {
    width: 5px;
}
.erp-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.erp-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}
.erp-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .erp-chatbot-container {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 80px;
        max-height: calc(100vh - 100px);
    }
    .erp-chatbot-float-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .erp-chatbot-float-btn,
    .erp-chatbot-close,
    .erp-chatbot-send,
    .erp-chatbot-chip {
        transition: none;
    }
    .erp-chatbot-status {
        animation: none;
    }
}
