/* AI Labirinto Chat - Widget Styles */

/* Bubble trigger */
.ailc-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--ailc-primary-color, #0073aa);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    z-index: 999999;
}

.ailc-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.ailc-bubble-icon {
    color: white;
}

.ailc-bubble-tooltip {
    position: absolute;
    right: 70px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    font-size: 13px;
}

.ailc-bubble:hover .ailc-bubble-tooltip {
    opacity: 1;
}

/* Position variations */
.ailc-position-bottom-left .ailc-bubble {
    left: 20px;
    right: auto;
}

.ailc-position-bottom-left .ailc-bubble-tooltip {
    left: 70px;
    right: auto;
}

/* Chat window */
.ailc-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: var(--ailc-bg-color, #ffffff);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    z-index: 999998;
    overflow: hidden;
}

.ailc-size-small .ailc-chat-window {
    width: 320px;
    height: 500px;
}

.ailc-size-large .ailc-chat-window {
    width: 440px;
    height: 700px;
}

.ailc-position-bottom-left .ailc-chat-window {
    left: 20px;
    right: auto;
}

/* Header */
.ailc-chat-header {
    background: var(--ailc-primary-color, #0073aa);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ailc-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.ailc-header-text {
    display: flex;
    flex-direction: column;
}

.ailc-chat-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ailc-chat-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.ailc-close-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ailc-close-btn:hover {
    opacity: 1;
}

/* Messages area */
.ailc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f5f5f5;
}

.ailc-message {
    display: flex;
    gap: 8px;
    animation: ailc-message-slide 0.3s ease;
}

@keyframes ailc-message-slide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ailc-message-user {
    justify-content: flex-end;
}

.ailc-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.ailc-message-bot .ailc-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.ailc-message-user .ailc-message-content {
    background: var(--ailc-primary-color, #0073aa);
    color: white;
    border-bottom-right-radius: 4px;
}

.ailc-message-content p {
    margin: 0 0 8px 0;
}

.ailc-message-content p:last-child {
    margin-bottom: 0;
}

.ailc-message-sources {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.7;
}

.ailc-source-link {
    color: var(--ailc-primary-color, #0073aa);
    text-decoration: underline;
    margin-right: 8px;
}

/* Typing indicator */
.ailc-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    width: fit-content;
}

.ailc-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: ailc-typing 1.4s infinite;
}

.ailc-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ailc-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ailc-typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input area */
.ailc-chat-input-container {
    border-top: 1px solid #e0e0e0;
    padding: 12px;
    background: white;
}

.ailc-chat-form {
    display: flex;
    gap: 8px;
}

.ailc-message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ailc-message-input:focus {
    border-color: var(--ailc-primary-color, #0073aa);
}

.ailc-send-btn {
    width: 44px;
    height: 44px;
    background: var(--ailc-primary-color, #0073aa);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ailc-send-btn:hover {
    transform: scale(1.1);
}

.ailc-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Draggable */
.ailc-chat-window.ailc-dragging {
    cursor: move;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .ailc-chat-window {
        bottom: 0;
        right: 0;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0;
    }

    .ailc-bubble {
        bottom: 20px;
        right: 20px;
    }
}

/* Scrollbar styling */
.ailc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ailc-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ailc-chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.ailc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}
