/* ChatWidget - Fixed Position Widget Styles */
.ChatWidget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1025; /* Above most other elements but below modals */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
    background: white;
    border: 1px solid #dee2e6;
    max-width: 400px;
    transition: all 0.3s ease;
}

.ChatWidget-container.is-minimized {
    width: 280px;
    cursor: pointer;
}

.ChatWidget-container.is-minimized:hover {
    box-shadow: 0 6px 16px rgb(0 0 0 / 20%);
}

.ChatWidget-header {
    padding: 12px 16px;
    background: var(--primary) !important;
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    user-select: none;
}

.ChatWidget-header.is-minimized {
    border-radius: 8px;
    cursor: pointer;
}

.ChatWidget-headerContent {
    display: flex;
    align-items: center;
    width: 100%;
}

.ChatWidget-headerIcon {
    margin-right: 8px;
    font-size: 16px;
}

.ChatWidget-headerTitle {
    flex: 1;
    font-weight: var(--font-weight-semibold);
    font-size: 14px;
}

.ChatWidget-headerActions {
    display: flex;
    gap: 4px;
}

.ChatWidget-minimizeBtn,
.ChatWidget-closeBtn {
    color: white !important;
    padding: 4px 8px !important;
    line-height: 1 !important;
    border: none !important;
    background: transparent !important;
}

.ChatWidget-minimizeBtn:hover,
.ChatWidget-closeBtn:hover {
    background: rgb(255 255 255 / 20%) !important;
    color: white !important;
}

.ChatWidget.is-expanded {
    width: 380px;
    height: 500px;
    display: flex;
    flex-direction: column;
}

.ChatWidget-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
}

.ChatWidget-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
}

.ChatWidget-message {
    margin-bottom: 12px;
}

.ChatWidget-message:last-child {
    margin-bottom: 0;
}

.ChatWidget-message--user {
    text-align: right;
}

.ChatWidget-message--agent {
    text-align: left;
}

.ChatWidget-messageContent {
    display: inline-block;
    max-width: 80%;
    background-color: var(--white);
    border-radius: 16px;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}

.ChatWidget-message--user .ChatWidget-messageContent {
    background-color: var(--primary) !important;
    color: var(--light);
}

.ChatWidget-message--agent .ChatWidget-messageContent {
    background-color: var(--secondary) !important;
    color: var(--light);
}

.ChatWidget-messageText {
    margin-bottom: 4px;
    overflow-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.ChatWidget-messageText code {
    background-color: rgb(0 0 0 / 10%);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.875em;
}

.ChatWidget-message--user .ChatWidget-messageText code {
    background-color: rgb(255 255 255 / 20%);
}

.ChatWidget-messageTime {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

.ChatWidget-input {
    margin-top: auto;
}

.ChatWidget-input textarea {
    resize: none;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #ced4da;
}

.ChatWidget-input textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgb(0 123 255 / 25%);
}

.ChatWidget-input .input-group-append .btn {
    border-radius: 0 6px 6px 0;
    border-left: 0;
}

.ChatWidget-input .btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--border-primary);
}

/* Error message styling */
.ChatWidget-content .alert {
    margin: 0 0 16px;
    padding: 8px 12px;
    font-size: 14px;
}

/* Custom scrollbar for chat messages */
.ChatWidget-messages::-webkit-scrollbar {
    width: 6px;
}

.ChatWidget-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ChatWidget-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ChatWidget-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Chat Widget Menu Styles */
.ChatWidget-menuDropdown .ChatWidget-menuBtn {
    color: white !important;
    padding: 6px 12px !important;
    line-height: 1 !important;
    border: none !important;
    background: transparent !important;
    border-radius: 4px !important;
    min-width: 38px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ChatWidget-menuDropdown .ChatWidget-menuBtn:hover,
.ChatWidget-menuDropdown .ChatWidget-menuBtn:focus {
    background: rgb(255 255 255 / 20%) !important;
    color: white !important;
    box-shadow: none !important;
}

.ChatWidget-menuDropdown .ChatWidget-menuBtn:active {
    background: rgb(255 255 255 / 30%) !important;
    color: white !important;
}

.ChatWidget-menuIcon {
    font-size: 16px;
}

/* Mobile responsiveness */
@media (width <= 768px) {
    .ChatWidget-container {
        right: 10px;
        bottom: 10px;
        left: 10px;
        max-width: none;
    }

    .ChatWidget.is-expanded {
        width: 100%;
        height: 400px;
    }

    .ChatWidget-container.is-minimized {
        width: auto;
        left: auto;
        right: 10px;
    }
}
