/* ==================== CHATBOT WIDGET STYLES ==================== */
/* WhatsApp-inspired chatbot with modern glassmorphism design */

:root {
    --chatbot-primary: #25D366;
    /* WhatsApp green */
    --chatbot-secondary: #05439a;
    /* Site blue */
    --chatbot-accent: #1da63b;
    /* Site green */
    --chatbot-bg: #f0f2f5;
    --chatbot-white: #ffffff;
    --chatbot-text: #111b21;
    --chatbot-text-light: #667781;
    --chatbot-border: #e9edef;
    --chatbot-shadow: rgba(0, 0, 0, 0.1);
}

/* ==================== CHATBOT TOGGLE BUTTON ==================== */
.chatbot-toggle {
    position: fixed;
    bottom: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, #20ba5a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: none;
    outline: none;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-toggle i {
    font-size: 20px;
    color: #f3f3f5;
}

/* Pulse animation for toggle button */
.chatbot-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--chatbot-primary);
    animation: chatbot-pulse 2s infinite;
    z-index: -1;
}

@keyframes chatbot-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Badge for unread messages */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3b30;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid white;
}

/* ==================== CHATBOT CONTAINER ==================== */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 380px;
    height: 600px;
    background: var(--chatbot-white);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: bottom left;
}

.chatbot-container.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ==================== CHATBOT HEADER ==================== */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, #20ba5a 100%);
    color: var(--chatbot-white);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--chatbot-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chatbot-header-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.chatbot-status {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: status-blink 2s infinite;
}

@keyframes status-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chatbot-close {
    background: transparent;
    border: none;
    color: var(--chatbot-white);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ==================== CHATBOT MESSAGES AREA ==================== */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #efeae2;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 255, 255, .05) 35px, rgba(255, 255, 255, .05) 70px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ==================== MESSAGE BUBBLES ==================== */
.message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: message-slide-in 0.3s ease;
}

@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.bot .message-bubble {
    background: var(--chatbot-white);
    color: var(--chatbot-text);
    border-bottom-left-radius: 2px;
}

.message.user .message-bubble {
    background: #d9fdd3;
    color: var(--chatbot-text);
    border-bottom-right-radius: 2px;
}

.message-time {
    font-size: 11px;
    color: var(--chatbot-text-light);
    margin-top: 4px;
    text-align: right;
}

/* ==================== TYPING INDICATOR ==================== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--chatbot-white);
    border-radius: 8px;
    border-bottom-left-radius: 2px;
    max-width: 75px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--chatbot-text-light);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

/* ==================== QUICK REPLIES ==================== */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply-btn {
    background: var(--chatbot-white);
    border: 1px solid var(--chatbot-primary);
    color: var(--chatbot-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--chatbot-primary);
    color: var(--chatbot-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.quick-reply-btn:active {
    transform: translateY(0);
}

/* ==================== CHATBOT INPUT AREA ==================== */
.chatbot-input-area {
    background: var(--chatbot-white);
    padding: 16px;
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    border-radius: 24px;
    background: var(--chatbot-bg);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--chatbot-text);
    resize: none;
    max-height: 100px;
    overflow-y: auto;
}

.chatbot-input::placeholder {
    color: var(--chatbot-text-light);
}

.chatbot-send-btn {
    background: var(--chatbot-primary);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    background: #20ba5a;
    transform: scale(1.05);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

.chatbot-send-btn i {
    color: var(--chatbot-white);
    font-size: 18px;
}

.chatbot-send-btn:disabled {
    background: var(--chatbot-border);
    cursor: not-allowed;
    transform: none;
}

/* ==================== FORM IN CHAT ==================== */
.chat-form {
    background: var(--chatbot-white);
    padding: 16px;
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-form-group {
    margin-bottom: 12px;
}

.chat-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--chatbot-text);
    margin-bottom: 6px;
}

.chat-form-group input,
.chat-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--chatbot-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--chatbot-text);
    background: var(--chatbot-white);
    transition: border-color 0.2s ease;
}

.chat-form-group input:focus,
.chat-form-group select:focus {
    outline: none;
    border-color: var(--chatbot-primary);
}

.chat-form-submit {
    width: 100%;
    padding: 12px;
    background: var(--chatbot-primary);
    color: var(--chatbot-white);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.chat-form-submit:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.chat-form-submit:active {
    transform: translateY(0);
}

/* ==================== WELCOME MESSAGE ==================== */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: var(--chatbot-text-light);
}

.welcome-message h4 {
    font-size: 16px;
    color: var(--chatbot-text);
    margin-bottom: 8px;
}

.welcome-message p {
    font-size: 13px;
    line-height: 1.6;
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    .chatbot-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        left: 0;
        border-radius: 0;
        transform-origin: center;
    }

    .chatbot-container.active {
        transform: scale(1);
    }

    .chatbot-toggle {
        bottom: 20px;
        left: 20px;
        width: 56px;
        height: 56px;
    }

    .chatbot-toggle i {
        font-size: 26px;
    }

    .message-bubble {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .chatbot-header {
        padding: 16px;
    }

    .chatbot-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .chatbot-header-info h3 {
        font-size: 15px;
    }

    .chatbot-status {
        font-size: 12px;
    }

    .chatbot-messages {
        padding: 16px;
    }

    .chatbot-input-area {
        padding: 12px;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==================== ACCESSIBILITY ==================== */
.chatbot-toggle:focus,
.chatbot-close:focus,
.chatbot-send-btn:focus,
.quick-reply-btn:focus {
    outline: 2px solid var(--chatbot-primary);
    outline-offset: 2px;
}

/* ==================== DARK MODE SUPPORT (Optional) ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --chatbot-bg: #1f2c33;
        --chatbot-white: #111b21;
        --chatbot-text: #e9edef;
        --chatbot-text-light: #8696a0;
        --chatbot-border: #2a3942;
    }

    .chatbot-messages {
        background: #0b141a;
    }

    .message.bot .message-bubble {
        background: #1f2c33;
        color: var(--chatbot-text);
    }

    .message.user .message-bubble {
        background: #005c4b;
        color: var(--chatbot-white);
    }

    .chatbot-input {
        background: #1f2c33;
        color: var(--chatbot-text);
    }

    .chat-form {
        background: #1f2c33;
    }

    .chat-form-group input,
    .chat-form-group select {
        background: #111b21;
        color: var(--chatbot-text);
        border-color: var(--chatbot-border);
    }
}