/**
 * Anmey IT Services AI Chatbot Widget Styles
 */

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chatbot-toggle .close-icon {
    display: none;
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-window.active {
    display: flex;
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header .avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-header .avatar svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.chatbot-header .info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header .info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-header .minimize-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.chatbot-header .minimize-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chatbot-header .minimize-btn:hover svg {
    opacity: 1;
}

/* Chat Messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.message.bot {
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.message .avatar-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message .avatar-small svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.message.user .avatar-small {
    background: #28a745;
}

.message .bubble {
    max-width: 75%;
    padding: 12px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
    text-align: left;
}

.message.bot .bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message.user .bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 3px;
}

.message .bubble a {
    color: #667eea;
    text-decoration: underline;
    word-break: break-all;
}

.message .bubble a:hover {
    color: #5a6fd6;
}

.message.user .bubble a {
    color: #fff;
    text-decoration: underline;
}

.message.user .bubble a:hover {
    color: #e0e0e0;
}

.message .bubble strong,
.message .bubble b {
    font-weight: 700;
    color: #1a1a1a;
}

.message.user .bubble strong,
.message.user .bubble b {
    color: #fff;
}

.message .bubble em,
.message .bubble i {
    font-style: italic;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 10px 15px;
}

.typing-indicator.active {
    display: flex;
    align-items: center;
    gap: 10px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Chat Input */
.chatbot-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input input:focus {
    border-color: #667eea;
}

.chatbot-input button {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chatbot-input button:hover {
    transform: scale(1.05);
}

.chatbot-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.chatbot-input button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    padding: 8px 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.quick-reply-btn:hover {
    background: #e0e0e0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 90px;
        height: calc(100% - 120px);
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
    }
}

/* Enquiry Form Styles */
.enquiry-form-bubble {
    padding: 0 !important;
    background: #fff !important;
}

.enquiry-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}

.enquiry-form input,
.enquiry-form select,
.enquiry-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.enquiry-form input:focus,
.enquiry-form select:focus,
.enquiry-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.enquiry-form textarea {
    min-height: 60px;
    resize: vertical;
}

.enquiry-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.enquiry-submit-btn:hover {
    opacity: 0.9;
}

.enquiry-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.enquiry-success {
    padding: 15px;
    text-align: center;
    color: #28a745;
    font-weight: 500;
}

/* Quick Contact Form */
.contact-quick-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.contact-quick-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.contact-quick-form input:focus {
    outline: none;
    border-color: #667eea;
}

.quick-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.quick-submit-btn:hover {
    opacity: 0.9;
}

/* Clear Chat Button */
.clear-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.clear-chat-btn:hover {
    opacity: 1;
}

.clear-chat-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Move minimize to the right of clear */
.chatbot-header .minimize-btn {
    margin-left: 5px;
}

/* Message Fade-In Animation */
.message.fade-in {
    animation: messageFadeIn 0.3s ease-out;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Footer / Powered By */
.chatbot-footer {
    text-align: center;
    padding: 6px;
    font-size: 11px;
    color: #999;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

/* Enquiry Badge - subtle notification */
.enquiry-badge {
    margin: 5px 0 10px 42px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 1px solid #c8e6c9;
    border-radius: 12px;
    font-size: 12px;
    color: #2e7d32;
    display: inline-block;
    transition: opacity 0.5s ease;
}