/* TaxAdepts Chatbot Widget Styles */

#taxadepts-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Toggle Button */
#taxadepts-chatbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1B4D6E;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#taxadepts-chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Container */
#taxadepts-chatbot-container {
    display: none;
    width: 380px;
    height: 520px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 70px;
    right: 0;
}

#taxadepts-chatbot-widget.taxadepts-chatbot-open #taxadepts-chatbot-container {
    display: flex;
}

#taxadepts-chatbot-widget.taxadepts-chatbot-open #taxadepts-chatbot-toggle {
    display: none;
}

/* Header */
#taxadepts-chatbot-header {
    background: #1B4D6E;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
}

#taxadepts-chatbot-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#taxadepts-chatbot-close:hover {
    opacity: 1;
}

/* Messages Area */
#taxadepts-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.taxadepts-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
}

.taxadepts-msg p {
    margin: 0 0 8px 0;
}

.taxadepts-msg p:last-child {
    margin-bottom: 0;
}

.taxadepts-msg ul {
    margin: 4px 0;
    padding-left: 18px;
}

.taxadepts-msg li {
    margin-bottom: 4px;
}

.bot-msg {
    background: #f0f4f8;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-msg {
    background: #1B4D6E;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.taxadepts-msg a {
    color: #1B4D6E;
    text-decoration: underline;
}

.user-msg a {
    color: #a8d4f0;
}

/* Link Card */
.taxadepts-link-card {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    background: #e8f0f7;
    border-radius: 8px;
    color: #1B4D6E;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #cde0ed;
    transition: background 0.2s;
}

.taxadepts-link-card:hover {
    background: #d4e6f3;
}

.taxadepts-link-card::before {
    content: '🔗 ';
}

/* Typing Indicator */
.taxadepts-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #f0f4f8;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.taxadepts-typing span {
    width: 8px;
    height: 8px;
    background: #90a4ae;
    border-radius: 50%;
    animation: taxadepts-bounce 1.4s infinite ease-in-out;
}

.taxadepts-typing span:nth-child(1) { animation-delay: 0s; }
.taxadepts-typing span:nth-child(2) { animation-delay: 0.2s; }
.taxadepts-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes taxadepts-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* Input Area */
#taxadepts-chatbot-input-area {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
    background: #fafafa;
}

#taxadepts-chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#taxadepts-chatbot-input:focus {
    border-color: #1B4D6E;
}

#taxadepts-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #1B4D6E;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#taxadepts-chatbot-send:hover {
    background: #153f5a;
}

#taxadepts-chatbot-send:disabled {
    background: #9eb8c9;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #taxadepts-chatbot-container {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed;
    }

    #taxadepts-chatbot-widget.taxadepts-chatbot-open {
        bottom: 0;
        right: 0;
    }
}


/* Bitrix Form Container inside chat */
.taxadepts-form-container {
    max-width: 100% !important;
    padding: 8px !important;
    background: #ffffff !important;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    min-height: 300px;
}

.taxadepts-form-container iframe {
    width: 100% !important;
    border: none !important;
    border-radius: 8px;
}
