/* ========================================
   CHATBOT VERITECH - VERSION 2.0 FINAL
   ======================================== */

/* Contenedor principal */
.veritech-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Botón flotante */
.veritech-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066FF 0%, #4285F4 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.veritech-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.5);
}

.veritech-chat-button.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.veritech-chat-button .chat-icon {
    width: 28px;
    height: 28px;
    color: white;
}

.chat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #00ff88;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.4);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Ventana del chat */
.veritech-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.veritech-chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.veritech-chat-header {
    background: linear-gradient(135deg, #0066FF 0%, #4285F4 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.veritech-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.veritech-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.veritech-avatar-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0066FF 0%, #4285F4 100%);
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.veritech-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.veritech-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.95;
    margin-top: 2px;
}

.veritech-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.veritech-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.veritech-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.veritech-close-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* Messages */
.veritech-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.veritech-messages::-webkit-scrollbar {
    width: 6px;
}

.veritech-messages::-webkit-scrollbar-track {
    background: transparent;
}

.veritech-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.veritech-message {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.veritech-message.user {
    align-items: flex-end;
}

.veritech-message.bot {
    align-items: flex-start;
}

.veritech-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.veritech-message.user .veritech-message-bubble {
    background: linear-gradient(135deg, #0066FF 0%, #4285F4 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.veritech-message.bot .veritech-message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.veritech-message-bubble p {
    margin: 0;
    padding: 0;
}

.veritech-message-bubble p + p {
    margin-top: 8px;
}

.veritech-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

/* Typing indicator */
.veritech-message.typing-indicator .veritech-message-bubble {
    padding: 12px 16px;
    display: flex;
    gap: 6px;
    align-items: center;
}

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

.veritech-dot:nth-child(1) {
    animation-delay: 0s;
}

.veritech-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.veritech-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Input */
.veritech-input-container {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

.veritech-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.veritech-input:focus {
    border-color: #0066FF;
}

.veritech-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066FF 0%, #4285F4 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.veritech-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.veritech-send-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Footer */
.veritech-footer {
    padding: 8px;
    text-align: center;
    background: white;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #e0e0e0;
}

.veritech-footer small {
    font-size: 11px;
    color: #999;
}

/* Responsive */
@media (max-width: 480px) {
    .veritech-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: 20px;
    }

    .veritech-chat-button {
        bottom: 10px;
        right: 10px;
    }
}
