/* Shared FAQ chatbot widget styles. Include on any page that uses partials/faq-chat.php. */

.faq-chat{
    height: 60px;
    width: 60px;
    background: linear-gradient(135deg, #4a4aff 0%, #1a1ad1 100%);
    border: none;
    border-radius: 50%;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 200, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15);
    -webkit-user-select: none;
    user-select: none;
}

.faq-chat svg{
    width: 28px;
    height: 28px;
}

.faq-chat:hover{
    transform: scale(1.07);
    box-shadow: 0 8px 26px rgba(0, 0, 200, 0.45), 0 3px 8px rgba(0, 0, 0, 0.18);
}

.faq-chat:active{
    transform: scale(0.97);
}

.faq-chat-content{
    height: 520px;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    background-color: white;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    border-radius: 16px;
    font-family: 'Poppins';
    display: flex;
    flex-flow: column;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.faq-chat-content.hidden,
.faq-chat.hidden{
    display: none;
}

.faq-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: none;
    background: linear-gradient(135deg, #4a4aff 0%, #1a1ad1 100%);
    color: white;
}

.faq-header-title{
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-avatar{
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.faq-avatar svg{
    width: 20px;
    height: 20px;
}

.faq-title{
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.faq-status{
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.faq-status-dot{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #4ade80;
    display: inline-block;
    box-shadow: 0 0 4px rgba(74, 222, 128, 0.8);
}

.faq-close{
    background-color: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    transition: background-color 0.15s ease;
}

.faq-close:hover{
    background-color: rgba(255, 255, 255, 0.18);
}

.faq-close .close-svg{
    width: 20px;
    height: 20px;
}

.faq-messages{
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    overflow-y: auto;
    padding: 14px;
    font-size: 13px;
    background-color: #f7f8fa;
}

.faq-messages::-webkit-scrollbar{
    width: 6px;
}
.faq-messages::-webkit-scrollbar-thumb{
    background-color: #d0d0d0;
    border-radius: 3px;
}

.faq-msg{
    padding: 9px 12px;
    border-radius: 14px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.faq-msg.user{
    background: linear-gradient(135deg, #4a4aff 0%, #1a1ad1 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.faq-msg.bot{
    background-color: white;
    color: #222;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    max-width: 90%;
}

.faq-msg.bot p{
    margin: 0 0 8px 0;
}
.faq-msg.bot p:last-child{
    margin-bottom: 0;
}
.faq-msg.bot ol,
.faq-msg.bot ul{
    margin: 4px 0 8px 0;
    padding-left: 22px;
}
.faq-msg.bot ol:last-child,
.faq-msg.bot ul:last-child{
    margin-bottom: 0;
}
.faq-msg.bot li{
    margin-bottom: 4px;
    line-height: 1.4;
}
.faq-msg.bot li:last-child{
    margin-bottom: 0;
}
.faq-msg.bot strong{
    font-weight: 600;
}
.faq-msg.bot em{
    font-style: italic;
}
.faq-msg.bot code{
    background-color: #e2e2e2;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.faq-msg.bot.typing{
    padding: 12px 14px;
}

.faq-typing-dots{
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.faq-typing-dots span{
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #999;
    animation: faqBounce 1.2s infinite ease-in-out;
}
.faq-typing-dots span:nth-child(2){ animation-delay: 0.15s; }
.faq-typing-dots span:nth-child(3){ animation-delay: 0.3s; }

@keyframes faqBounce{
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.faq-input{
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: solid 1px #eee;
    background-color: white;
}

.faq-input-text{
    padding: 10px 14px;
    font-family: 'Poppins';
    font-size: 13px;
    flex: 1;
    min-width: 0;
    border: 1px solid #d8d8d8;
    border-radius: 20px;
    background-color: #f7f8fa;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.faq-input-text:focus{
    outline: none;
    border-color: #4a4aff;
    background-color: white;
}

.faq-send{
    background: linear-gradient(135deg, #4a4aff 0%, #1a1ad1 100%);
    color: white;
    cursor: pointer;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.faq-send svg{
    width: 18px;
    height: 18px;
}

.faq-send:hover{
    transform: scale(1.06);
}

.faq-send:active{
    transform: scale(0.95);
}

.faq-send:disabled{
    background: #b0b0b0;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 480px){
    .faq-chat-content{
        height: calc(100vh - 32px);
        width: calc(100vw - 32px);
        bottom: 16px;
        right: 16px;
        border-radius: 14px;
    }
}
