/* =============================================
   LEGAL29 - Chatbot Styles
   ============================================= */

.chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: var(--space-8);
    z-index: var(--z-modal);
    font-family: var(--font-primary);
}

.chatbot-toggle {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: var(--fs-xl);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.chatbot-toggle .close-icon {
    display: none;
}

.chatbot-widget.active .chatbot-toggle .chat-icon {
    display: none;
}

.chatbot-widget.active .chatbot-toggle .close-icon {
    display: block;
}

.chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 500px;
    max-height: calc(100vh - 200px);
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-widget.active .chatbot-window {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.chatbot-avatar {
    width: 42px;
    height: 42px;
    background: rgba(201, 162, 39, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: var(--fs-lg);
}

.chatbot-info h4 {
    color: var(--color-white);
    font-size: var(--fs-base);
    font-weight: 600;
}

.chatbot-info p {
    color: var(--color-gray-400);
    font-size: var(--fs-xs);
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

/* Messages */
.chatbot-messages {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--color-gray-100);
}

.chat-message {
    max-width: 85%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--fs-sm);
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.chat-message.bot {
    background: var(--color-white);
    color: var(--color-gray-800);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.chat-message.user {
    background: var(--color-primary);
    color: var(--color-white);
    margin-left: auto;
    border-bottom-right-radius: var(--radius-sm);
}

.chat-message.bot .disclaimer {
    display: block;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-gray-200);
    font-size: var(--fs-xs);
    color: var(--color-gray-500);
    font-style: italic;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: var(--space-4);
}

.chat-typing span {
    width: 8px;
    height: 8px;
    background: var(--color-gray-400);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

/* Input */
.chatbot-input {
    padding: var(--space-4);
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    gap: var(--space-2);
}

.chatbot-input input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    transition: all var(--transition-fast);
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--color-secondary);
}

.chatbot-input button {
    width: 42px;
    height: 42px;
    background: var(--color-secondary);
    border: none;
    border-radius: 50%;
    color: var(--color-white);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input button:hover {
    background: var(--color-secondary-dark);
    transform: scale(1.05);
}

.chatbot-input button:disabled {
    background: var(--color-gray-400);
    cursor: not-allowed;
    transform: none;
}

/* Quick Actions */
.chatbot-quick-actions {
    padding: var(--space-3) var(--space-4);
    background: var(--color-white);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    border-top: 1px solid var(--color-gray-100);
}

.quick-action {
    padding: var(--space-2) var(--space-3);
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    color: var(--color-gray-700);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-action:hover {
    background: var(--color-secondary);
    color: var(--color-white);
    border-color: var(--color-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 80px;
        right: 16px;
        left: auto;
    }

    .chatbot-window {
        position: fixed;
        bottom: 140px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        height: calc(100vh - 200px);
        max-height: 450px;
    }

    .chatbot-toggle {
        width: 50px;
        height: 50px;
    }

    .chatbot-quick-actions {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .quick-action {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 400px) {
    .chatbot-window {
        bottom: 130px;
        right: 10px;
        left: 10px;
        height: calc(100vh - 180px);
        max-height: 400px;
    }

    .chatbot-header {
        padding: 12px 16px;
    }

    .chatbot-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .chatbot-info h4 {
        font-size: 14px;
    }

    .chatbot-messages {
        padding: 12px;
    }

    .chat-message {
        max-width: 90%;
        padding: 10px 14px;
        font-size: 13px;
    }

    .chatbot-input {
        padding: 10px;
    }

    .chatbot-input input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .chatbot-input button {
        width: 38px;
        height: 38px;
    }
}