/* === AI ASSISTANT BUTTON === */
.ai-assistant-btn {
    position: fixed;
    bottom: 95px;
   
    width: 50px;
    height: 50px;
    background: #2563EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0px 4px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    border: none;
    padding: 0;
}

.ai-assistant-btn:hover {
    transform: scale(1.1);
    box-shadow: 0px 6px 25px rgba(37, 99, 235, 0.6);
}

.ai-assistant-btn img {
    height: 28px;
}

.ai-assistant-btn.always-visible {
    display: flex;
}


.ai-chat-popup {
    position: fixed;
    bottom: 40px;
    right: 100px;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.ai-chat-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ai-chat-popup-header {
    background: #2563EB;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ai-chat-popup-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Unbounded', sans-serif;
}

.ai-chat-popup-title img {
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
}

.ai-chat-popup-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.ai-chat-popup-close:hover {
    opacity: 0.8;
}

.ai-chat-popup-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-chat-popup-placeholder {
    text-align: center;
    color: #888;
    font-size: 16px;
    margin-top: 100px;
    font-family: 'Unbounded', sans-serif;
}

.ai-chat-popup-msg {
    display: flex;
    max-width: 85%;
    position: relative;
}

.ai-chat-popup-msg.user {
    align-self: flex-end;
    justify-content: flex-end;
}

.ai-chat-popup-msg.bot {
    align-self: flex-start;
    justify-content: flex-start;
}

.ai-chat-popup-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    font-family: 'Unbounded', sans-serif;
}

.ai-chat-popup-msg.user .ai-chat-popup-bubble {
    background: #2563EB;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.ai-chat-popup-msg.bot .ai-chat-popup-bubble {
    background: #ffffff;
    color: #151515;
    border: 1px solid #e5e5e5;
    border-bottom-left-radius: 4px;
}

.ai-copy-icon-popup {
    position: absolute;
    width: 14px;
    height: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    bottom: 0;
}

.ai-chat-popup-msg:hover .ai-copy-icon-popup {
    opacity: 1;
}

.ai-chat-popup-msg.user .ai-copy-icon-popup {
    right: -18px;
}

.ai-chat-popup-msg.bot .ai-copy-icon-popup {
    left: 102%;
    bottom: 5px;
}

.ai-chat-popup-input-area {
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.ai-chat-popup-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 10px;
    resize: none;
    font-size: 16px;
    font-family: 'Unbounded', sans-serif;
    outline: none;
    transition: border-color 0.3s ease;
    padding-top: 14px;
    padding-left: 10px;
}


.ai-chat-popup-input:focus {
    border-color: #2563EB;
}

.ai-chat-popup-send {
    width: 55px;
    height: 58px;
    background: #2563EB;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.ai-chat-popup-send:hover {
    background: #1d4ed8;
}

/* Адаптив для popup */
@media (max-width: 480px) {
    .ai-chat-popup {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 100px;
        height: 500px;
    }
    
    .ai-assistant-btn {
        bottom: 80px;
        right: 18px;
        width: 50px;
        height: 50px;
    }
    
    .ai-assistant-btn img {
        width: 28px;
        height: 28px;
    }
}


.ai-chat-popup-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    font-family: 'Unbounded';
    }
    
 
    .ai-chat-popup-bubble ul,
    .ai-chat-popup-bubble ol {
        margin: 10px 0;
        padding-left: 35px; 
        max-width: 100%;
    }
    
    .ai-chat-popup-bubble li {
        line-height: 1.4;
        margin-bottom: 8px;
        word-wrap: break-word;
        padding-left: 5px;
    }
    
   
    .ai-chat-popup-bubble li::marker {
     
        font-size: 12px; 
    }
    
  
    .ai-chat-popup-bubble ul li {
        list-style-position: outside; 
    }
    

    .ai-chat-popup-bubble li br {
        display: none;
    }



    .ai-chat-popup-bubble a {
    color: #2563EB;
    text-decoration: underline;
    word-break: break-all;
    }
    
    .ai-chat-popup-bubble a:hover {
    color: #1d4ed8;
    }
    
    .ai-chat-popup-bubble p {
    margin: 8px 0;
    }
    
    .ai-chat-popup-bubble strong,
    .ai-chat-popup-bubble b {
    font-weight: 600;
    }


    .ai-chat-popup-bubble ul {
        list-style: none;
        padding-left: 0;
        margin: 10px 0;
    }
    
    .ai-chat-popup-bubble ul li {
        position: relative;
        padding-left: 25px; 
        margin-bottom: 8px;
        line-height: 1.4;
    }
    
    .ai-chat-popup-bubble ul li::before {
        content: '•';
        position: absolute;
        left: 8px; 
        color: #2563EB;
        font-size: 16px;
        line-height: 1.2;
    }
    

    .ai-chat-popup-bubble ol {
        padding-left: 0px;
        margin: 10px 0;
    }