/* Ajentrix Widget CSS */

.ajentrix-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ajentrix-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.ajentrix-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.ajentrix-widget-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.ajentrix-widget-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ajentrix-widget-icon {
    width: 24px;
    height: 24px;
}

.ajentrix-widget-chat {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ajentrix-widget.bottom-left .ajentrix-widget-chat {
    right: auto;
    left: 0;
}

.ajentrix-widget-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.ajentrix-widget-title {
    font-weight: 600;
    font-size: 16px;
}

.ajentrix-widget-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.ajentrix-widget-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.ajentrix-widget-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ajentrix-widget-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.ajentrix-widget-message.user {
    align-self: flex-end;
}

.ajentrix-widget-message.bot {
    align-self: flex-start;
}

.ajentrix-widget-message.error {
    align-self: center;
    max-width: 100%;
}

.ajentrix-widget-message-sender {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    opacity: 0.7;
}

.ajentrix-widget-message.user .ajentrix-widget-message-sender {
    text-align: right;
}

.ajentrix-widget-message-content {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.ajentrix-widget-message.user .ajentrix-widget-message-content {
    background-color: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.ajentrix-widget-message.bot .ajentrix-widget-message-content {
    background-color: #f3f4f6;
    color: #374151;
    border-bottom-left-radius: 4px;
}

.ajentrix-widget-message.error .ajentrix-widget-message-content {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    text-align: center;
}

.ajentrix-widget-input {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: center;
}

.ajentrix-widget-input input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ajentrix-widget-input input:focus {
    border-color: #3b82f6;
}

.ajentrix-widget-voice {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #10B981;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-right: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ajentrix-widget-voice:hover {
    transform: scale(1.05);
    background-color: #059669;
}

.ajentrix-widget-voice:active {
    transform: scale(0.95);
}

.ajentrix-widget-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #3B82F6;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ajentrix-widget-send:hover {
    transform: scale(1.05);
    background-color: #2563EB;
}

.ajentrix-widget-send:active {
    transform: scale(0.95);
}

/* Ensure SVG icons are visible */
.ajentrix-widget-voice svg,
.ajentrix-widget-send svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

/* Ensure icons are white */
.ajentrix-widget-voice,
.ajentrix-widget-send {
    color: white !important;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .ajentrix-widget-chat {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 20px;
        left: 20px;
    }
    
    .ajentrix-widget.bottom-left .ajentrix-widget-chat {
        right: 20px;
        left: 20px;
    }
}

/* Scrollbar styling */
.ajentrix-widget-messages::-webkit-scrollbar {
    width: 4px;
}

.ajentrix-widget-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ajentrix-widget-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.ajentrix-widget-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}