/* Estilos para el widget de chat */
.zbot-bubble {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #01436e 0%, #0172bb 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(1,114,187,0.38);
    z-index: 1100;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: visible;
}

.zbot-bubble:hover, .zbot-bubble.open {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(1,114,187,0.5);
}

/* Modal del chat */
.chat-widget-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-widget-modal-overlay.chat-widget-modal-open {
    display: flex;
    opacity: 1;
}

.chat-widget-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.chat-widget-modal-overlay.chat-widget-modal-open .chat-widget-modal {
    transform: scale(1);
}

.chat-widget-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #01436e 0%, #0172bb 100%);
    border-radius: 12px 12px 0 0;
}

.chat-widget-title {
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-widget-title span:first-child {
    font-size: 20px;
}

.chat-widget-title strong {
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    background: #28a745;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.chat-widget-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-widget-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-widget-message {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.chat-widget-input-wrap {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 12px 12px;
}

.chat-widget-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-widget-input:focus {
    border-color: #0172bb;
}

.chat-widget-send {
    background: linear-gradient(135deg, #01436e 0%, #0172bb 100%);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-widget-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(1,114,187,0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .chat-widget-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .chat-widget-header {
        padding: 12px 16px;
    }
    
    .chat-widget-title {
        font-size: 14px;
    }
    
    .chat-widget-body {
        padding: 16px;
    }
    
    .chat-widget-input-wrap {
        padding: 12px 16px;
    }
}

/* Estilos para el panel del chatbot (zbot) */
.zbot-panel {
    position: fixed;
    bottom: 160px;
    right: 24px;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.zbot-panel-active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.zbot-head {
    padding: 16px 20px;
    background: linear-gradient(135deg, #01436e 0%, #0172bb 100%);
    display: flex;
    align-items: center;
    gap: 12px;
}

.zbot-head-av {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.zbot-head-info {
    flex: 1;
}

.zbot-head-info strong {
    color: white;
    font-size: 14px;
    display: block;
}

.zbot-online {
    color: #28a745;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.zbot-online::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    display: inline-block;
}

.zbot-x {
    background: transparent;
    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.2s ease;
}

.zbot-x:hover {
    background: rgba(255, 255, 255, 0.2);
}

.zbot-msgs {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zbot-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.zbot-msg-user {
    background: linear-gradient(135deg, #01436e 0%, #0172bb 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.zbot-msg-bot {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.zbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: fit-content;
}

.zbot-typing em {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.zbot-typing em:nth-child(2) {
    animation-delay: 0.2s;
}

.zbot-typing em:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.zbot-footer {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

.zbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.zbot-input:focus {
    border-color: #0172bb;
}

.zbot-send {
    background: linear-gradient(135deg, #01436e 0%, #0172bb 100%);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(1,114,187,0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .zbot-panel {
        width: 90%;
        right: 5%;
        bottom: 160px;
        max-height: 70vh;
    }
    
    .zbot-head {
        padding: 12px 16px;
    }
    
    .zbot-msg {
        max-width: 90%;
        font-size: 13px;
    }
    
    .zbot-footer {
        padding: 10px 12px;
    }
}