/**
 * Night Market Customer Service Chatbot Styles
 */

:root {
    --chatbot-primary: #F3E567;
    --chatbot-dark: #282827;
    --chatbot-light: #F1F8FF;
    --chatbot-text: #333333;
    --chatbot-border-radius: 16px;
    --chatbot-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    --chatbot-animation-duration: 0.3s;
}

/* Chatbot Container */
.nm-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Lato', sans-serif;
}

/* Chatbot Icon */
.nm-chatbot-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--chatbot-primary);
    box-shadow: var(--chatbot-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform var(--chatbot-animation-duration) ease-in-out;
    color: var(--chatbot-dark);
}

.nm-chatbot-icon:hover {
    transform: scale(1.05);
}

.nm-chatbot-icon.active {
    transform: scale(0.9);
}

.nm-chatbot-icon-inner {
    width: 30px;
    height: 30px;
}

.nm-chatbot-icon svg {
    width: 100%;
    height: 100%;
}

/* Notification Dot */
.nm-chatbot-notification {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background-color: #FF5252;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

.nm-chatbot-notification.show {
    display: block;
    animation: pulse 1.5s infinite;
}

/* Chatbot Window */
.nm-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: var(--chatbot-border-radius);
    box-shadow: var(--chatbot-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: transform var(--chatbot-animation-duration) ease-in-out, 
                opacity var(--chatbot-animation-duration) ease-in-out;
}

.nm-chatbot-window.open {
    transform: scale(1);
    opacity: 1;
}

/* Chatbot Header */
.nm-chatbot-header {
    background-color: var(--chatbot-primary);
    color: var(--chatbot-dark);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: var(--chatbot-border-radius);
    border-top-right-radius: var(--chatbot-border-radius);
}

.nm-chatbot-title {
    font-weight: bold;
    font-size: 16px;
}

.nm-chatbot-close {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

/* Chatbot Messages */
.nm-chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nm-chatbot-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 5px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nm-chatbot-message.show {
    opacity: 1;
    transform: translateY(0);
}

.nm-chatbot-message.bot {
    align-self: flex-start;
    background-color: #F0F0F0;
    color: var(--chatbot-text);
    border-bottom-left-radius: 5px;
}

.nm-chatbot-message.user {
    align-self: flex-end;
    background-color: var(--chatbot-primary);
    color: var(--chatbot-dark);
    border-bottom-right-radius: 5px;
}

/* Typing Indicator */
.nm-chatbot-typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nm-chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #aaa;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1s infinite ease-in-out;
}

.nm-chatbot-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.nm-chatbot-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.nm-chatbot-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Input Container */
.nm-chatbot-input-container {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

.nm-chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-family: inherit;
}

.nm-chatbot-input:focus {
    border-color: var(--chatbot-primary);
}

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

.nm-chatbot-send:hover {
    background-color: #e6d85f;
}

.nm-chatbot-send svg {
    width: 20px;
    height: 20px;
}

/* Animations */
@keyframes typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation Classes */
.nm-chatbot-icon.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.nm-chatbot-icon.pulse {
    animation-name: chatbotPulse;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

@keyframes chatbotPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Styles */
@media (max-width: 480px) {
    .nm-chatbot-window {
        width: calc(100vw - 40px);
        height: 400px;
    }
}
