/* Chatbot widget stilovi */

#chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2d5016, #6b8e23);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(45, 80, 22, 0.5);
}

#chatbot-toggle i {
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

#chatbot-toggle .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #d4a574;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

#chatbot-window {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

#chatbot-window.open {
    display: flex;
}

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

#chatbot-header {
    background: linear-gradient(135deg, #2d5016, #6b8e23);
    color: white;
    padding: 16px 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;
    font-size: 1.2rem;
    flex-shrink: 0;
}

#chatbot-header .info h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

#chatbot-header .info p {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.85;
}

#chatbot-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

#chatbot-close:hover {
    opacity: 1;
}

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

#chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.bot .chat-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, #2d5016, #6b8e23);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-message.user .chat-time {
    text-align: right;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #6b8e23;
    border-radius: 50%;
    animation: typing 1.2s infinite;
}

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick buttons */
.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.quick-btn {
    background: white;
    border: 1.5px solid #2d5016;
    color: #2d5016;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quick-btn:hover {
    background: #2d5016;
    color: white;
}

#chatbot-footer {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #eee;
}

#chatbot-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    resize: none;
}

#chatbot-input:focus {
    border-color: #2d5016;
}

#chatbot-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2d5016, #6b8e23);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#chatbot-send:hover {
    transform: scale(1.05);
}

#chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chatbot-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: #f0f7e6;
    border: 1.5px solid #6b8e23;
    border-radius: 8px;
    color: #2d5016;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.chatbot-call-btn:hover {
    background: #2d5016;
    color: white;
}

/* Mobilni */
@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 90px;
        height: 450px;
    }

    #chatbot-toggle {
        right: 20px;
        bottom: 20px;
    }
}
