/* chatbot.css - Estilos Completos KANANCE Chatbot */
:root {
    --color-primary: #F07E26;
    --color-secondary: #1D1B1B;
    --color-accent: #E3E3E3;
    --color-white: #FFFFFF;
    --color-background-alt: #F8F9FA;
    --color-text: #1D1B1B;
    --color-text-light: #6C757D;
    --color-border: #DEE2E6;
    --shadow-medium: 0 4px 16px rgba(29, 27, 27, 0.15);
    --shadow-heavy: 0 8px 32px rgba(29, 27, 27, 0.2);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CONTENEDOR PRINCIPAL - Wrapper para posicionamiento */
#kanance-chatbot-container {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 9999;
    pointer-events: none;
}

#kanance-chatbot {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-heavy);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 10000;
    pointer-events: auto;
}

#kanance-chatbot.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* HEADER */
.chatbot-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: var(--color-white);
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.chatbot-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.status {
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #eee;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    display: block;
    box-shadow: 0 0 5px #2ecc71;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
    line-height: 1;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

/* AREA DE MENSAJES */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--color-background-alt);
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
}

.bot-message .message-content {
    background: var(--color-white);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.user-message .message-content {
    background: var(--color-primary);
    color: var(--color-white);
    border-bottom-right-radius: 2px;
}

/* INPUT AREA */
.chatbot-input-area {
    padding: 15px;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 10px;
    align-items: center;
}

#chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

#chatbot-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(240, 126, 38, 0.1);
}

#chatbot-send {
    background: var(--color-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#chatbot-send:hover {
    background: var(--color-secondary);
    transform: scale(1.05);
}

/* BOTONES DE CATEGORÍA */
.category-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.category-btn {
    background: var(--color-background-alt);
    border: 1px solid var(--color-border);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    color: var(--color-text);
    font-weight: 600;
}

.category-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* BOTÓN FLOTANTE TOGGLE */
#chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-heavy);
    z-index: 10001;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    visibility: visible;
    pointer-events: auto;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
}

#chatbot-toggle img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* WHATSAPP BUTTON */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 90px;
    width: 50px;
    height: 50px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
    z-index: 10001;
    transition: var(--transition);
    text-decoration: none;
    animation: pulse-green 2s infinite;
    visibility: visible;
    pointer-events: auto;
    border: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* ANIMACIONES */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-overlay {
    position: fixed;
    z-index: 10002;
    /* Higher than chatbot (10000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--color-white, #ffffff);
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-top: 4px solid var(--color-primary, #F07E26);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--color-primary, #F07E26), var(--color-secondary, #1D1B1B));
    color: white;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Título del modal */
.modal-header h2 {
    margin: 0;
    font-family: 'Maiandra GD', 'Century Gothic', Arial, sans-serif;
    font-size: 1.5rem;
    color: white;
    /* Changed to white for better contrast on gradient */
}

.close-btn {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: white;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition, all 0.3s ease);
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    line-height: 1.6;
    overflow-y: auto;
    max-height: 70vh;
    text-align: left;
    /* Ensure text is left-aligned */
}

.modal-body h3 {
    color: var(--color-primary, #F07E26);
    font-family: 'Maiandra GD', 'Century Gothic', Arial, sans-serif;
    margin: 1.5rem 0 0.5rem;
    border-left: 3px solid var(--color-primary, #F07E26);
    padding-left: 1rem;
}

.modal-body p {
    margin-bottom: 1rem;
    color: var(--color-text, #333333);
    font-family: 'Maiandra GD', 'Century Gothic', Arial, sans-serif;
    margin-bottom: 0.5rem;
    color: var(--color-text, #333333);
    font-family: 'Maiandra GD', 'Century Gothic', Arial, sans-serif;
}

.modal-body ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    color: var(--color-text, #333333);
    font-family: 'Maiandra GD', 'Century Gothic', Arial, sans-serif;
}

.modal-body .contacto-info {
    background: var(--color-background-alt, #f8f9fa);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.btn-cerrar {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-top: 2rem;
    background: linear-gradient(135deg, var(--color-primary, #F07E26), var(--color-secondary, #1D1B1B));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Maiandra GD', 'Century Gothic', Arial, sans-serif;
}

.btn-cerrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 126, 38, 0.3);
}

/* ================= RESPONSIVE PARA BOTONES FLOTANTES ================= */
/* Media query para tablets y móviles grandes */
@media (max-width: 768px) {
    #chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
    }

    #chatbot-toggle img {
        width: 34px;
        height: 34px;
    }

    .whatsapp-float {
        bottom: 80px;
        right: 15px;
        width: 48px;
        height: 48px;
    }

    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }
}

/* Media query para móviles pequeños */
@media (max-width: 480px) {
    #chatbot-toggle {
        bottom: 12px;
        right: 12px;
        width: 52px;
        height: 52px;
    }

    #chatbot-toggle img {
        width: 32px;
        height: 32px;
    }

    .whatsapp-float {
        bottom: 72px;
        right: 12px;
        width: 46px;
        height: 46px;
    }

    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }
}