/* AI Sales Chatbot Widget - Simple Version */

/* Widget Container */
#asc-chatbot-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    direction: rtl;
    z-index: 999999;
}

/* Position Classes */
.asc-widget-position-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.asc-widget-position-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
}

/* Toggle Button */
.asc-widget-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.asc-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.asc-widget-toggle svg {
    transition: transform 0.3s ease;
}

.asc-widget-toggle:hover svg {
    transform: rotate(15deg);
}

/* Widget Container */
.asc-widget-container {
    position: fixed;
    bottom: 90px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.asc-widget-position-bottom-right .asc-widget-container {
    right: 20px;
}

.asc-widget-position-bottom-left .asc-widget-container {
    left: 20px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.asc-widget-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.asc-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asc-bot-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.asc-header-text h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.asc-header-text span {
    font-size: 12px;
    opacity: 0.85;
    display: block;
    margin-top: 2px;
}

.asc-header-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.asc-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.asc-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.asc-header-btn:active {
    transform: scale(0.95);
}

.asc-header-btn svg {
    width: 18px;
    height: 18px;
}

/* Messages Area */
.asc-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.asc-messages-area::-webkit-scrollbar {
    width: 6px;
}

.asc-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.asc-messages-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.asc-messages-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Message Styles */
.asc-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.asc-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

/* Bot Message */
.asc-message-bot {
    justify-content: flex-start;
}

.asc-message-bot .asc-message-content {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

/* User Message */
.asc-message-user {
    justify-content: flex-end;
}

.asc-message-user .asc-message-content {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.asc-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    max-width: 80px;
}

.asc-typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.asc-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.asc-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input Area */
.asc-input-area {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.asc-message-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

.asc-message-input:focus {
    outline: none;
    border-color: #2563eb;
}

.asc-message-input::placeholder {
    color: #94a3b8;
}

.asc-send-button {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}

.asc-send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.asc-send-button:active:not(:disabled) {
    transform: translateY(0);
}

.asc-send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #94a3b8;
}

.asc-send-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.asc-send-button svg {
    width: 22px;
    height: 22px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .asc-widget-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    
    .asc-widget-position-bottom-left .asc-widget-container,
    .asc-widget-position-bottom-right .asc-widget-container {
        left: 0 !important;
        right: 0 !important;
    }
}

/* Error Message */
.asc-error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin: 10px 20px;
}

/* WhatsApp Transfer Button */
.asc-whatsapp-transfer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #25D366;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
    white-space: nowrap;
}

.asc-whatsapp-transfer-btn:hover {
    background: #1da851;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.asc-whatsapp-transfer-btn:active {
    transform: translateY(0);
}

.asc-whatsapp-transfer-btn svg {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .asc-whatsapp-transfer-btn span {
        display: none;
    }
    
    .asc-whatsapp-transfer-btn {
        padding: 8px;
        margin-left: 4px;
    }
}
