/* Chatbot Styles */
.kahos-chatbot-container {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.kahos-chatbot-container.position-right {
    right: 20px;
}

.kahos-chatbot-container.position-left {
    left: 20px;
}

.kahos-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color, #4e73df);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.kahos-chatbot-button:hover {
    transform: scale(1.0.55);
}

.kahos-chatbot-button-text {
    position: absolute;
    background-color: white;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    white-space: nowrap;
    color: #333;
    display: none;
}

.kahos-chatbot-container.position-right .kahos-chatbot-button-text {
    right: 70px;
}

.kahos-chatbot-container.position-left .kahos-chatbot-button-text {
    left: 70px;
}

.kahos-chatbot-button:hover .kahos-chatbot-button-text {
    display: block;
}

.kahos-chatbot-button-text.is-visible {
    display: block;
}

.kahos-chatbot-box {
    position: absolute;
    bottom: 80px;
    width: 350px;
    height: 500px;
    background-color: var(--secondary-color, #f8f9fc);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.kahos-chatbot-container.position-right .kahos-chatbot-box {
    right: 0;
}

.kahos-chatbot-container.position-left .kahos-chatbot-box {
    left: 0;
}

.kahos-chatbot-header {
    background-color: var(--primary-color, #4e73df);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.kahos-chatbot-title {
    font-weight: 600;
    font-size: 18px;
}

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

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

.kahos-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f1f3f8;
    scroll-behavior: smooth;
}

.kahos-chatbot-message {
    margin-bottom: 20px;
    display: flex;
    width: 100%;
    clear: both;
}

.kahos-chatbot-message-bot-container {
    display: flex;
    justify-content: flex-start;
    max-width: 80%;
}

.kahos-chatbot-message-user-container {
    display: flex;
    justify-content: flex-end;
    max-width: 80%;
    margin-left: auto;
}

.kahos-chatbot-message-bot {
    background-color: white;
    color: #333;
    border-radius: 18px 18px 18px 0;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 5px;
}

.kahos-chatbot-message-user {
    background-color: var(--primary-color, #4e73df);
    color: white;
    border-radius: 18px 18px 0 18px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 5px;
}

.kahos-chatbot-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
}

.kahos-chatbot-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 10px 16px 0 16px;
    border-radius: 12px;
    background: rgba(78, 115, 223, 0.08);
    border: 1px dashed rgba(78, 115, 223, 0.25);
    color: #1f2937;
    font-size: 13px;
    cursor: pointer;
}

.kahos-chatbot-suggestion:hover {
    background: rgba(78, 115, 223, 0.12);
}

.kahos-chatbot-suggestion.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.kahos-chatbot-suggestion-text {
    flex: 1;
}

.kahos-chatbot-suggestion-close {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.kahos-chatbot-suggestion-close:hover {
    color: #111827;
}

.kahos-chatbot-input-container {
    display: flex !important;
    align-items: center !important;
    background-color: #f9fafb !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 28px !important;
    overflow: hidden !important;
    padding: 4px 6px 4px 18px !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.kahos-chatbot-input-container:focus-within {
    background-color: #ffffff !important;
    border-color: var(--primary-color, #4e73df) !important;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1) !important;
}

.kahos-chatbot-input {
    flex: 1 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    outline: none !important;
    background: transparent !important;
    background-color: transparent !important;
    font-size: 14px !important;
    color: #1f2937 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: 100% !important;
    resize: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}

.kahos-chatbot-input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.kahos-chatbot-input:focus {
    outline: none !important;
}

.kahos-chatbot-send {
    background: linear-gradient(135deg, var(--primary-color, #4e73df) 0%, #3d5fc4 100%) !important;
    color: white !important;
    border: none !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 50% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-left: 8px !important;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(78, 115, 223, 0.3) !important;
    flex-shrink: 0 !important;
}

.kahos-chatbot-send:hover {
    transform: scale(1.0.55) !important;
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.4) !important;
}

.kahos-chatbot-send:active {
    transform: scale(0.95) !important;
}

.kahos-chatbot-send .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

.kahos-chatbot-typing {
    text-align: left;
    color: #6c757d;
    font-size: 12px;
    padding: 5px 10px;
    display: flex;
}

.kahos-chatbot-typing .kahos-chatbot-message-bot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.95);
}

.kahos-chatbot-thinking-text {
    font-size: 11px;
    font-weight: 500;
    color: #9aa0a6;
    letter-spacing: 0.01em;
}

/* Loading animation */
.kahos-chatbot-loading {
    display: inline-block;
    margin-left: 5px;
}

.kahos-chatbot-loading span {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #6c757d;
    margin: 0 1px;
    animation: dots 1.4s infinite ease-in-out;
}

.kahos-chatbot-loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.kahos-chatbot-loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Notification Badge */
.kahos-chatbot-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(255, 68, 68, 0.4);
    animation: pulse-badge 2s infinite;
    z-index: 1;
}

/* Efecto de pulso para el botón con notificación */
.kahos-chatbot-button.kahos-chatbot-has-notification {
    animation: pulse-button 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 2px 10px rgba(255, 68, 68, 0.6);
    }
}

@keyframes pulse-button {
    0%, 100% {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 15px rgba(78, 115, 223, 0.6);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .kahos-chatbot-box {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
    }
}
