/* Estilos del Chatbot Widget */

#chatbot-widget {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 99999 !important;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Botón flotante */
.chatbot-toggle {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #5dd6ff, #6df7a7) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(93, 214, 255, 0.4) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    border: none !important;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(93, 214, 255, 0.6);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger, #ff6b6b);
    color: white;
    font-size: 12px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg, #0b1220);
}

/* Contenedor del chat */
.chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: var(--surface, #0f1629);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.chatbot-container.chatbot-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header del chat */
.chatbot-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(93, 214, 255, 0.1), rgba(109, 247, 167, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text, #eaf0ff);
}

.chatbot-header-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--muted, #9fb0d3);
}

.chatbot-close {
    background: transparent;
    border: none;
    color: var(--text, #eaf0ff);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message-user {
    justify-content: flex-end;
}

.chatbot-message-user .chatbot-text {
    background: linear-gradient(135deg, var(--brand, #5dd6ff), #7df8ff);
    color: #05222b;
    border-radius: 18px 18px 4px 18px;
}

.chatbot-message-bot .chatbot-text {
    background: var(--card, rgba(255, 255, 255, 0.06));
    color: var(--text, #eaf0ff);
    border-radius: 18px 18px 18px 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand, #5dd6ff), var(--accent, #6df7a7));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chatbot-text {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 75%;
    word-wrap: break-word;
}

.chatbot-text a {
    color: var(--brand, #5dd6ff);
    text-decoration: underline;
}

/* Indicador de escritura */
.chatbot-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted, #9fb0d3);
    animation: typing 1.4s infinite;
}

.chatbot-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input del chat */
.chatbot-input-container {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    background: rgba(15, 22, 41, 0.8);
    border-radius: 0 0 20px 20px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text, #eaf0ff);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    pointer-events: auto;
    cursor: text;
}

.chatbot-input:focus {
    border-color: var(--brand, #5dd6ff);
    background: rgba(255, 255, 255, 0.06);
}

.chatbot-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand, #5dd6ff), #7df8ff);
    color: #05222b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(93, 214, 255, 0.4);
}

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
    #chatbot-widget {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-container {
        width: calc(100vw - 30px);
        height: calc(100vh - 80px);
        max-height: 85vh;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }
}

