/* Popup Menu */
body.menu-open {
    overflow: hidden;
    padding-right: 17px; 
}

.popup-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100%;
    background-color: white;
    z-index: 1050;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.popup-menu.show {
    right: 0;
}

.popup-menu-content {
    padding: 60px 20px 20px;
    height: 100%;
}

.popup-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popup-menu ul li {
    margin-bottom: 15px;
}

.popup-menu ul li a {
    color: #333;
    text-decoration: none;
    font-size: 18px;
    display: block;
    padding: 8px 0;
    transition: color 0.3s;
}

.popup-menu ul li a:hover {
    color: #0d6efd;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.overlay.show {
    display: block;
}

/* AI Chat Popup - Novi dizajn */
.ai-chat-popup {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: #fff;
    z-index: 1060;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

.ai-chat-popup.show {
    right: 0;
}

.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--dark-color);
    color: white;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-avatar i {
    font-size: 18px;
}

.ai-chat-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-status {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.close-ai-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-ai-chat:hover {
    opacity: 1;
}

/* Poruke */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ai-chat-messages::-webkit-scrollbar {
    display: none;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    font-size: 14px;
    animation: fadeIn 0.3s ease-out;
    word-wrap: break-word; 
    overflow-wrap: break-word; 
}

.message-content {
    word-break: break-word; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background-color: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ai-message {
    background-color: rgb(214, 214, 214);
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Input area */
.ai-chat-input-container {
    padding: 15px;
    background-color: white;
    border-top: 1px solid var(--dark-color);
}

.ai-chat-input {
    display: flex;
    background-color: rgb(214, 214, 214);
    border-radius: 25px;
    padding: 5px;
}

.ai-message-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
}

.ai-send-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ai-send-button:hover {
    background-color: var(--dark-color);
}

/* Responsive */
@media (max-width: 500px) {
    .ai-chat-popup {
        width: 100%;
        right: -100%;
    }

    .message {
        max-width: 90%;
    }
}