/* 
 * Asistente Virtual CSS - CRM Dental
 * Estilos específicos para la página de Asistente Virtual por WhatsApp
 */

/* Estilos para la demostración de WhatsApp */
.whatsapp-demo {
    background: #F0F2F5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    max-width: 400px;
    margin: 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    height: 600px;
    display: flex;
    flex-direction: column;
}

.whatsapp-header {
    background-color: #075E54;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.contact-info {
    display: flex;
    align-items: center;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-avatar img {
    width: 80%;
    height: auto;
}

.contact-details h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.contact-details p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.header-actions i {
    margin-left: 15px;
    font-size: 1.1rem;
    cursor: pointer;
}

.whatsapp-messages {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    background-image: url('../img/whatsapp-bg.png');
    background-size: contain;
    background-color: #E5DDD5;
    display: flex;
    flex-direction: column;
}

.message-date {
    background-color: rgba(225, 245, 254, 0.92);
    color: #54656f;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 8px;
    align-self: center;
    margin: 10px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message {
    max-width: 75%;
    margin-bottom: 10px;
    border-radius: 8px;
    padding: 8px 10px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message .message-content {
    font-size: 0.9rem;
    padding-bottom: 15px;
    word-break: break-word;
    line-height: 1.4;
}

.message .message-time {
    position: absolute;
    bottom: 3px;
    right: 10px;
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.45);
}

.message.bot {
    background-color: #FFFFFF;
    align-self: flex-start;
    border-top-left-radius: 0;
}

.message.user {
    background-color: #D9FDD3;
    align-self: flex-end;
    border-top-right-radius: 0;
}

.whatsapp-input {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #F0F2F5;
    border-top: 1px solid #E0E0E0;
}

.whatsapp-input i {
    color: #54656f;
    font-size: 1.25rem;
    cursor: pointer;
}

.whatsapp-input input {
    flex: 1;
    border: none;
    background-color: white;
    border-radius: 20px;
    padding: 10px 15px;
    margin: 0 10px;
    outline: none;
    font-size: 0.95rem;
}

/* Estilos para el panel de configuración */
.bot-conversation-demo, 
.ai-learning-demo {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #E0E0E0;
    height: 480px;
    display: flex;
    flex-direction: column;
}

.bot-header,
.learning-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.bot-header h4,
.learning-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.bot-body,
.learning-body {
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bot-config-tabs {
    display: flex;
    border-bottom: 1px solid #E0E0E0;
    background-color: #f8f9fa;
}

.bot-config-tabs .tab {
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    position: relative;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.bot-config-tabs .tab.active {
    color: #007bff;
    background-color: white;
}

.bot-config-tabs .tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #007bff;
}

.bot-config-content {
    padding: 20px;
    overflow-y: auto;
}

.config-section {
    margin-bottom: 25px;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-section h5 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #212529;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.config-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.config-option {
    flex: 1 1 200px;
    margin-bottom: 15px;
}

.config-option label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.config-option select,
.config-option input[type="text"],
.config-option input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #495057;
}

.config-option.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-option.checkbox input[type="checkbox"] {
    margin: 0;
}

.config-option.checkbox label {
    margin-bottom: 0;
    cursor: pointer;
}

.message-template {
    border: 1px solid #ced4da;
    border-radius: 6px;
    overflow: hidden;
}

.template-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ced4da;
}

.template-header span {
    font-weight: 500;
    font-size: 0.9rem;
    color: #495057;
}

.template-tags {
    display: flex;
    gap: 5px;
}

.template-tag {
    background-color: #e9f5ff;
    color: #007bff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-tag:hover {
    background-color: #007bff;
    color: white;
}

.message-template textarea {
    width: 100%;
    padding: 12px;
    border: none;
    min-height: 100px;
    resize: none;
    outline: none;
    font-size: 0.9rem;
    color: #495057;
    font-family: inherit;
}

/* Estilos para el diagrama de flujo de IA */
.learning-visual {
    padding: 20px;
    overflow-x: auto;
}

.conversation-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.flow-node {
    padding: 12px 18px;
    border-radius: 6px;
    min-width: 150px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.flow-node.input {
    background-color: #e9f5ff;
    color: #0056b3;
    border: 1px solid #b8daff;
}

.flow-node.process {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
}

.flow-node.decision {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.flow-node.action {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flow-node.output {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.flow-node.ai {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flow-arrow {
    position: relative;
    height: 20px;
    width: 2px;
    background-color: #6c757d;
}

.flow-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #6c757d;
}

.flow-arrow.right {
    height: 2px;
    width: 20px;
}

.flow-arrow.right::after {
    left: auto;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #6c757d;
    border-right: 0;
}

.flow-arrow.left {
    height: 2px;
    width: 20px;
}

.flow-arrow.left::after {
    right: auto;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #6c757d;
    border-left: 0;
}

.flow-branches {
    display: flex;
    gap: 20px;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.learning-metrics {
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.metric-item {
    margin-bottom: 15px;
}

.metric-title {
    display: block;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 5px;
}

.metric-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.metric-progress {
    height: 100%;
    background-color: #007bff;
    border-radius: 5px;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 1s ease-in-out;
}

.metric-value {
    position: absolute;
    right: 10px;
    top: -20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #007bff;
}

/* Media Queries para responsividad */
@media (max-width: 992px) {
    .whatsapp-demo {
        height: 500px;
        max-width: 350px;
    }
    
    .bot-conversation-demo, 
    .ai-learning-demo {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .whatsapp-demo {
        height: 450px;
    }
    
    .flow-branches {
        flex-direction: column;
    }
}
