* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
}

/* Botón flotante para abrir el chatbot */
.chatbot-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #00A896;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 168, 150, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 168, 150, 0.4);
    background: #008B7A;
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

/* Contenedor del chatbot */
.chatbot-container {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 20px;
    border: 2px solid #00A896;
    box-shadow: 0 10px 40px rgba(0, 168, 150, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chatbot-container.hidden {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
    pointer-events: none;
}

/* Header del chatbot */
.chatbot-header {
    background: #00A896;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1;
}

.chatbot-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-selector {
    display: flex;
    gap: 3px;
    background: rgba(255, 255, 255, 0.15);
    padding: 3px;
    border-radius: 6px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: white;
    width: 28px;
    height: 18px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.chatbot-close svg {
    width: 16px;
    height: 16px;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.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;
}

/* Mensajes */
.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: #00A896;
    color: white;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: #e9ecef;
    color: #495057;
}

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

.bot-message .message-content {
    background: #f0f9f8;
    color: #004d47;
    box-shadow: 0 2px 4px rgba(0, 168, 150, 0.1);
    border: 1px solid rgba(0, 168, 150, 0.2);
}

.user-message .message-content {
    background: #00A896;
    color: white;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.message-content a {
    color: #00A896;
    text-decoration: underline;
}

.user-message .message-content a {
    color: white;
    text-decoration: underline;
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    margin-bottom: 8px;
    width: fit-content;
}

.typing-indicator.hidden {
    display: none;
}

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

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

.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;
    }
}

/* Contenedor de input */
.chatbot-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid rgba(0, 168, 150, 0.2);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.chatbot-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 168, 150, 0.3);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    border-color: #00A896;
}

.chatbot-send {
    background: #00A896;
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: #008B7A;
}


.chatbot-send:active {
    transform: scale(0.95);
    background: #007A6B;
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        right: 10px;
        top: 80px;
        height: calc(100vh - 100px);
    }

    .chatbot-toggle {
        right: 20px;
        top: 20px;
    }
}

