/* Nishi Chatbot - Compact & Fixed */
.nishi-chatbot-container {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 10000;
    font-family: 'Open Sans', sans-serif;
}

/* Toggle Button */
.nishi-toggle-btn {
    position: fixed !important;
    bottom: 15px !important;
    right: 15px !important;
    z-index: 10001 !important;
    background: #2c9b64 !important;
    color: white !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(44, 155, 100, 0.4) !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    transition: all 0.2s ease !important;
}

.nishi-toggle-btn.hidden {
    display: none !important;
}

.nishi-toggle-btn:hover {
    background: #1e7a4c !important;
    box-shadow: 0 3px 8px rgba(44, 155, 100, 0.5) !important;
}

/* Chat Window */
.nishi-chat-window {
    width: 280px;
    height: 380px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s ease;
    visibility: hidden;
    position: fixed;
    bottom: 15px;
    right: 5px;
    z-index: 10002;
    border: 1px solid #ddd;
}

.nishi-chat-window.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* Chat Header */
.nishi-chat-header {
    background: #2c9b64;
    color: white;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nishi-chat-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nishi-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
}

.nishi-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.nishi-messages {
    flex: 1;
    padding: 5px;
    overflow-y: auto;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Message Bubbles */
.nishi-message {
    max-width: 100%;
    padding: 6px 8px;
    border-radius: 10px;
    position: relative;
    line-height: 1.3;
    word-wrap: break-word;
    font-size: 12px;
    margin: 2px 0;
}

.nishi-message.user {
    background: #0e7cf2;
    color: white;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 5px;
}

.nishi-message.bot {
    background: rgb(225, 239, 223);
    color: #333;
    align-self: flex-start;
    border: 1px solid #e0e0e0;
    margin-left: 0;
    margin-right: 0;
}

/* Message Content */
.message-content {
    margin: 0;
    padding: 0;
}

.answer-text {
    line-height: 1.4;
}

.nishi-message.bot strong {
    color: #2c9b64;
    font-weight: 600;
}

/* Message Time */
.message-time {
    font-size: 9px;
    opacity: 0.7;
    margin-top: 2px;
    display: block;
    text-align: right;
}

/* Copy Button */
.nishi-copy-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 3px 6px;
    font-size: 10px;
    cursor: pointer;
    color: #666;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: all 0.2s ease;
}

.nishi-copy-btn:hover {
    background: #2c9b64;
    color: white;
    border-color: #2c9b64;
}

.nishi-copy-btn.copied {
    background: #2c9b64;
    color: white;
    border-color: #2c9b64;
}

/* Typing Indicator */
.nishi-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    background: white;
    border-radius: 10px;
    align-self: flex-start;
    border: 1px solid #e0e0e0;
}

.nishi-typing.active {
    display: flex;
}

.nishi-typing-dot {
    width: 4px;
    height: 4px;
    background: #2c9b64;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.nishi-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.nishi-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-3px); }
}

/* Input Area */
.nishi-input-area {
    padding: 8px 10px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 6px;
    align-items: center;
}

.nishi-input-area input {
    flex: 1;
    padding: 6px 6px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 12px;
    outline: none;
    background: #f8f9fa;
}

.nishi-input-area input:focus {
    border-color: #2c9b64;
    background: white;
}

.nishi-input-area button {
    background: #2c9b64;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.nishi-input-area button:hover:not(:disabled) {
    background: #1e7a4c;
}

.nishi-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Welcome Message */
.nishi-welcome {
    padding: 5px;
    text-align: center;
}

.nishi-welcome h4 {
    color: #2c9b64;
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
}

.nishi-welcome p {
    font-size: 11px;
    color: #666;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.nishi-quick-questions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
}

.nishi-quick-question {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 5px 8px;
    text-align: left;
    cursor: pointer;
    font-size: 11px;
    color: #555;
    transition: all 0.2s ease;
}

.nishi-quick-question:hover {
    background: #2c9b64;
    color: white;
    border-color: #2c9b64;
}

/* Scrollbar */
.nishi-messages::-webkit-scrollbar {
    width: 3px;
}

.nishi-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.nishi-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
}

.nishi-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 480px) {
    .nishi-chat-window {
        width: calc(100vw - 30px);
        height: 55vh;
        right: 1cm;
        bottom: 60px;
    }
    
    .nishi-toggle-btn {
        bottom: 10px !important;
        right: 10px !important;
    }
}