/* Chatbot Styles */
/* Ocultar chatbot anterior - ahora se usa Chatwoot */
.chatbot-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chatbot-button i {
    color: white;
    font-size: 24px;
}

.chatbot-button .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
    align-items: flex-start;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row;
    justify-content: flex-end;
    gap: 6px;
}

.message.bot {
    gap: 10px;
    justify-content: flex-start;
}

.message > div:not(.message-avatar) {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.message.user > div:not(.message-avatar) {
    align-items: flex-end;
}

.message.bot > div:not(.message-avatar) {
    align-items: flex-start;
    flex: 1;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    overflow: hidden;
}

.chatbot-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message.bot .message-avatar {
    background: #e0e0e0;
    color: #666;
}

.message-content {
    padding: 12px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    white-space: normal;
    writing-mode: horizontal-tb;
    text-align: left;
    width: 100%;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    text-align: left;
    white-space: normal;
    writing-mode: horizontal-tb;
}

.message.bot .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: left;
    white-space: normal;
    writing-mode: horizontal-tb;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: left;
}

.message.user .message-time {
    text-align: right;
}

.chatbot-typing {
    display: flex;
    gap: 5px;
    padding: 12px 15px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 70px;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chatbot-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.chatbot-input:focus {
    border-color: #667eea;
}

.chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chatbot-send i {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
        left: auto;
    }

    .chatbot-button {
        width: 56px;
        height: 56px;
    }

    .chatbot-button i {
        font-size: 22px;
    }

    .chatbot-window {
        position: fixed;
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        max-height: 500px;
        right: 20px;
        left: 20px;
        bottom: 90px;
    }

    .chatbot-header {
        padding: 12px 16px;
    }

    .chatbot-header h3 {
        font-size: 16px;
    }

    .chatbot-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .chatbot-messages {
        padding: 15px;
        gap: 12px;
    }

    .message > div:not(.message-avatar) {
        max-width: 85%;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .message-content {
        padding: 10px 14px;
        font-size: 14px;
    }

    .message-time {
        font-size: 10px;
    }

    .chatbot-input-container {
        padding: 12px;
        gap: 8px;
    }

    .chatbot-input {
        padding: 10px 14px;
        font-size: 16px; /* Previene zoom en iOS */
    }

    .chatbot-send {
        width: 42px;
        height: 42px;
    }

    .chatbot-send i {
        font-size: 16px;
    }

    /* Ocultar el botón cuando el chat está abierto en móviles */
    .chatbot-window.active ~ .chatbot-button,
    .chatbot-container:has(.chatbot-window.active) .chatbot-button {
        display: none;
    }
}

/* Teléfonos muy pequeños */
@media (max-width: 480px) {
    .chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .chatbot-button {
        width: 52px;
        height: 52px;
    }

    .chatbot-button i {
        font-size: 20px;
    }

    .chatbot-header {
        padding: 10px 14px;
    }

    .chatbot-header h3 {
        font-size: 15px;
    }

    .chatbot-messages {
        padding: 12px;
        gap: 10px;
    }

    .message > div:not(.message-avatar) {
        max-width: 90%;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .message-content {
        padding: 8px 12px;
        font-size: 13px;
    }

    .chatbot-input-container {
        padding: 10px;
    }

    .chatbot-input {
        padding: 10px 12px;
    }

    .chatbot-send {
        width: 40px;
        height: 40px;
    }
}

