/**
 * Estilos del Ticxar ChatBot
 */

/* Contenedor principal */
#ticxar-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Botón flotante */
#ticxar-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6948 0%, #E55A3B 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: ticxar-pulse 2s infinite;
}

#ticxar-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 105, 72, 0.6);
}

#ticxar-chatbot-button.active {
    transform: rotate(45deg);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.ticxar-chatbot-icon {
    font-size: 28px;
    line-height: 1;
}

@keyframes ticxar-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(255, 105, 72, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(255, 105, 72, 0.6);
    }
    100% {
        box-shadow: 0 4px 20px rgba(255, 105, 72, 0.4);
    }
}

/* Modal */
.ticxar-chatbot-modal {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ticxar-chatbot-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.ticxar-chatbot-header {
    background: linear-gradient(135deg, #264370 0%, #172843 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticxar-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.ticxar-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

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

/* Body */
.ticxar-chatbot-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

/* Formulario */
.ticxar-form-group {
    margin-bottom: 16px;
}

.ticxar-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.ticxar-input,
.ticxar-select-indicativo,
.ticxar-input-phone,
.ticxar-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.ticxar-input:focus,
.ticxar-select-indicativo:focus,
.ticxar-input-phone:focus,
.ticxar-textarea:focus {
    outline: none;
    border-color: #FF6948;
    box-shadow: 0 0 0 3px rgba(255, 105, 72, 0.1);
}

.ticxar-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Contenedor de teléfono */
.ticxar-phone-container {
    display: flex;
    gap: 8px;
}

.ticxar-select-indicativo {
    flex: 0 0 140px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.ticxar-input-phone {
    flex: 1;
}

/* Errores */
.ticxar-error {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

.ticxar-input.error,
.ticxar-textarea.error,
.ticxar-select-indicativo.error,
.ticxar-input-phone.error {
    border-color: #e74c3c;
}

.ticxar-input.error:focus,
.ticxar-textarea.error:focus,
.ticxar-select-indicativo.error:focus,
.ticxar-input-phone.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Info de departamento */
.ticxar-departamento-info {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    text-align: center;
}

.ticxar-departamento-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.ticxar-departamento-nombre {
    display: block;
    font-weight: 600;
    color: #FF6948;
    font-size: 14px;
}

/* Botón enviar */
.ticxar-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: #FF6948;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.ticxar-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 72, 0.4);
}

.ticxar-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.ticxar-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ticxar-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes ticxar-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mensaje de éxito */
.ticxar-success {
    text-align: center;
    padding: 30px 20px;
}

.ticxar-success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    color: white;
    font-size: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: ticxar-bounce 0.5s ease;
}

@keyframes ticxar-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.ticxar-success h4 {
    margin: 0 0 10px;
    color: #333;
    font-size: 20px;
}

.ticxar-success p {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.ticxar-new-message-btn {
    padding: 12px 24px;
    background: transparent;
    border: 2px solid #FF6948;
    color: #FF6948;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.ticxar-new-message-btn:hover {
    background: #FF6948;
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    #ticxar-chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    #ticxar-chatbot-button {
        width: 55px;
        height: 55px;
    }
    
    .ticxar-chatbot-modal {
        width: calc(100vw - 30px);
        right: 0;
        bottom: 70px;
    }
    
    .ticxar-select-indicativo {
        flex: 0 0 120px;
        font-size: 13px;
        padding-left: 10px;
        padding-right: 25px;
    }
}

/* Animación de entrada */
@keyframes ticxar-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ticxar-chatbot-modal.active {
    animation: ticxar-fade-in-up 0.3s ease;
}

/* Scrollbar personalizado */
.ticxar-chatbot-body::-webkit-scrollbar {
    width: 6px;
}

.ticxar-chatbot-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ticxar-chatbot-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ticxar-chatbot-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
