/* Alex Appliances Chatbot Widget Styles */

:root {
    --alex-primary-color: #1e40af;
    --alex-secondary-color: #ffffff;
    --alex-text-color: #333;
    --alex-border-color: #e5e7eb;
    --alex-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alex-chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.alex-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.alex-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Button */
.alex-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--alex-primary-color);
    color: var(--alex-secondary-color);
    border: none;
    cursor: pointer;
    box-shadow: var(--alex-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.alex-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.alex-chat-button:active {
    transform: scale(0.95);
}

.alex-chat-icon,
.alex-close-icon {
    width: 28px;
    height: 28px;
    transition: all 0.2s ease;
}

/* Chat Window */
.alex-chat-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: var(--alex-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: alexSlideUp 0.3s ease;
}

.alex-position-bottom-right .alex-chat-window {
    right: 0;
}

.alex-position-bottom-left .alex-chat-window {
    left: 0;
}

@keyframes alexSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.alex-chat-header {
    background-color: var(--alex-primary-color);
    color: var(--alex-secondary-color);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alex-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.alex-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alex-header-icon svg {
    width: 24px;
    height: 24px;
}

.alex-header-text {
    flex: 1;
}

.alex-header-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.alex-header-status {
    margin: 4px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.alex-minimize-button {
    background: none;
    border: none;
    color: var(--alex-secondary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.alex-minimize-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.alex-minimize-button svg {
    width: 20px;
    height: 20px;
}

/* Messages Container */
.alex-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    scroll-behavior: smooth;
}

.alex-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.alex-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.alex-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Message Bubbles */
.alex-message {
    margin-bottom: 16px;
    display: flex;
    animation: alexMessageFade 0.3s ease;
}

@keyframes alexMessageFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alex-message-bot {
    justify-content: flex-start;
}

.alex-message-user {
    justify-content: flex-end;
}

.alex-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.alex-message-bot .alex-message-content {
    background: white;
    color: var(--alex-text-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.alex-message-user .alex-message-content {
    background: var(--alex-primary-color);
    color: var(--alex-secondary-color);
    border-bottom-right-radius: 4px;
}

.alex-message-content a {
    color: inherit;
    text-decoration: underline;
}

.alex-message-content p {
    margin: 0 0 8px;
}

.alex-message-content p:last-child {
    margin-bottom: 0;
}

/* Typing Indicator */
.alex-typing-indicator {
    padding: 0 20px 12px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.alex-typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: alexTyping 1.4s infinite;
}

.alex-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.alex-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes alexTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.alex-chat-input-container {
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid var(--alex-border-color);
    gap: 12px;
}

.alex-chat-input {
    flex: 1;
    border: 1px solid var(--alex-border-color);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.alex-chat-input:focus {
    border-color: var(--alex-primary-color);
}

.alex-send-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background-color: var(--alex-primary-color);
    color: var(--alex-secondary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.alex-send-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.alex-send-button:active {
    transform: scale(0.95);
}

.alex-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alex-send-button svg {
    width: 20px;
    height: 20px;
}

/* Powered By */
.alex-powered-by {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #9ca3af;
    background: white;
    border-top: 1px solid var(--alex-border-color);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .alex-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
    }
    
    .alex-position-bottom-right .alex-chat-window {
        right: 20px;
    }
    
    .alex-position-bottom-left .alex-chat-window {
        left: 20px;
    }
}

/* Loading State */
.alex-message-loading {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.alex-loading-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: alexBounce 1.4s infinite ease-in-out;
}

.alex-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.alex-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes alexBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}
