/* moeen-chatbot.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main widget container */
.moeen-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
}

/* Widget positioning */
.moeen-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.moeen-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat icon button */
.moeen-chat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.moeen-chat-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.2);
}

.moeen-chat-icon svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Chat window */
.moeen-chatbox {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.moeen-widget.bottom-left .moeen-chatbox {
    right: auto;
    left: 0;
}

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

/* Chat header */
.moeen-chat-header {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.moeen-chat-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.moeen-chat-header .subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.moeen-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.moeen-close-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Chat messages area */
.moeen-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.moeen-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.moeen-message.user {
    flex-direction: row-reverse;
}

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

.moeen-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.moeen-message.user .moeen-message-content {
    background: #6c757d;
    color: white;
}

.moeen-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.moeen-message.user .moeen-message-avatar {
    background: #495057;
}

/* Message options */
.moeen-message-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.moeen-option-button {
    background: white;
    border: 2px solid #6c757d;
    color: #6c757d;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
    font-family: inherit;
}

.moeen-option-button:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

.moeen-option-button:active {
    transform: translateY(0);
}

/* Dark theme option buttons */
.moeen-widget.dark .moeen-option-button {
    background: #3a3a3a;
    border-color: #6c757d;
    color: #6c757d;
}

.moeen-widget.dark .moeen-option-button:hover {
    background: #6c757d;
    color: white;
}

/* Chat input */
.moeen-chat-input {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: white;
    display: flex;
    gap: 8px;
    align-items: center;
}

.moeen-input-field {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    -webkit-border-radius: 20px;
}

.moeen-input-field:focus {
    border-color: #6c757d;
}

.moeen-send-btn {
    background: #6c757d;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.moeen-send-btn:hover {
    background: #495057;
}

.moeen-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Typing indicator */
.moeen-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.moeen-typing-dots {
    display: flex;
    gap: 4px;
}

.moeen-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6c757d;
    animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .moeen-chatbox {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 80dvh !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 80dvh;
    }
    
    .moeen-widget.bottom-right,
    .moeen-widget.bottom-left {
        bottom: 10px;
    }
    
    .moeen-widget.bottom-right {
        right: 10px;
    }
    
    .moeen-widget.bottom-left {
        left: 10px;
    }
}

/* Dark theme */
.moeen-widget.dark .moeen-chatbox {
    background: #1e1e1e;
    color: white;
}

.moeen-widget.dark .moeen-chat-messages {
    background: #2a2a2a;
}

.moeen-widget.dark .moeen-message-content {
    background: #3a3a3a;
    color: white;
}

.moeen-widget.dark .moeen-message.user .moeen-message-content {
    background: #6c757d;
    color: white;
}

.moeen-widget.dark .moeen-chat-input {
    background: #1e1e1e;
    border-top-color: #444;
}

.moeen-widget.dark .moeen-input-field {
    background: #3a3a3a;
    border-color: #444;
    color: white;
}