/**
 * Hotel Smart Manager - Estilos del chatbot
 * Sintesia Studio - Sistema de gestión hotelera
 */

.hotel-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.chatbot-container {
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chatbot-container.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chatbot-header {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-title {
    display: flex;
    align-items: center;
}

.chatbot-title img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

.chatbot-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.close-chatbot {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-chatbot:hover {
    color: #fff;
}

.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 0.9rem;
    position: relative;
    animation: messageAppear 0.3s ease;
}

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

.message-ai {
    background-color: var(--background);
    color: var(--text-dark);
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}

.message-user {
    background-color: var(--secondary);
    color: #fff;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.message-ai .message-time {
    text-align: left;
}

.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background-color: var(--background);
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    max-width: 60px;
    margin-bottom: 10px;
    align-self: flex-start;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.chatbot-input {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--secondary);
}

.send-message {
    background-color: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    cursor: pointer;
}

.send-message:hover {
    background-color: var(--secondary-dark);
}

.send-message i {
    font-size: 1.1rem;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(to bottom right, var(--secondary), var(--secondary-dark));
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 10;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

.chatbot-toggle i {
    color: #fff;
    font-size: 1.5rem;
}

.chatbot-suggestions {
    padding: 0 15px 10px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 15px;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background-color: var(--secondary);
    color: #fff;
}

/* Message content formatting */
.chatbot-message p {
    margin: 0 0 10px 0;
}

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

.chatbot-message ul, .chatbot-message ol {
    margin: 10px 0;
    padding-left: 25px;
}

.chatbot-message li {
    margin-bottom: 5px;
}

.chatbot-message a {
    color: var(--secondary);
    text-decoration: underline;
}

.message-user a {
    color: #fff;
    text-decoration: underline;
}

.chatbot-message code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
}

.message-user code {
    background-color: rgba(255, 255, 255, 0.2);
}

.chatbot-message pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-user pre {
    background-color: rgba(255, 255, 255, 0.2);
}

.chatbot-message table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    font-size: 0.85em;
}

.chatbot-message th,
.chatbot-message td {
    padding: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
}

.message-user table,
.message-user th,
.message-user td {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Responsive design */
@media (max-width: 576px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        position: fixed;
        bottom: 70px;
        right: 20px;
    }
    
    .chatbot-message {
        max-width: 85%;
    }
}
